Skip to content

Commit

Permalink
Update for exposure time and date not in Calib
Browse files Browse the repository at this point in the history
Update all code that used exposure time or date in Calib,
switching to VisitInfo instead.
  • Loading branch information
r-owen committed Sep 29, 2016
1 parent 9c3bb33 commit ebad5bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions examples/exampleUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ def makeRaw(darkval, oscan, gradient, exptime):
'''
rawExposure = makeAssemblyInput(False)
detector = rawExposure.getDetector()
calib = rawExposure.getCalib()
calib.setExptime(exptime)
visitInfo = afwImage.makeVisitInfo(exposureTime=exptime)
rawExposure.getInfo().setVisitInfo(visitInfo)
im = rawExposure.getMaskedImage().getImage()
for amp in detector:
subim = im.Factory(im, amp.getRawDataBBox())
Expand All @@ -289,8 +289,8 @@ def makeDark(darkval, exptime):
'''
darkExposure = makeAssemblyInput(False, doTrim=True)
detector = darkExposure.getDetector()
calib = darkExposure.getCalib()
calib.setExptime(exptime)
visitInfo = afwImage.makeVisitInfo(exposureTime=exptime)
darkExposure.getInfo().setVisitInfo(visitInfo)
im = darkExposure.getMaskedImage().getImage()
for amp in detector:
subim = im.Factory(im, amp.getBBox())
Expand Down
7 changes: 2 additions & 5 deletions python/lsst/ip/isr/assembleCcdTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,9 @@ def postprocessExposure(self, outExposure, inExposure):
if self.config.setGain:
self.setGain(outExposure=outExposure)

inCalib = inExposure.getCalib()
outCalib = outExposure.getCalib()
outCalib.setExptime(inCalib.getExptime())
outCalib.setMidTime(inCalib.getMidTime())

# note: Calib is not copied, presumably because it is assumed unknown in raw data
outExposure.setFilter(inExposure.getFilter())
outExposure.getInfo().setVisitInfo(inExposure.getInfo().getVisitInfo())

frame = getDebugFrame(self._display, "assembledExposure")
if frame:
Expand Down
8 changes: 4 additions & 4 deletions python/lsst/ip/isr/isrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,8 @@ def run(self, ccdExposure, bias=None, linearizer=None, dark=None, flat=None, def
if self.config.doFringe and self.config.fringeAfterFlat:
self.fringe.run(ccdExposure, **fringes.getDict())

ccdExposure.getCalib().setFluxMag0(self.config.fluxMag0T1 * ccdExposure.getCalib().getExptime())
exposureTime = ccdExposure.getInfo().getVisitInfo().getExposureTime()
ccdExposure.getCalib().setFluxMag0(self.config.fluxMag0T1*exposureTime)

frame = getDebugFrame(self._display, "postISRCCD")
if frame:
Expand Down Expand Up @@ -593,12 +594,11 @@ def darkCorrection(self, exposure, darkExposure):
\param[in,out] exposure exposure to process
\param[in] darkExposure dark exposure of same size as exposure
"""
darkCalib = darkExposure.getCalib()
isr.darkCorrection(
maskedImage=exposure.getMaskedImage(),
darkMaskedImage=darkExposure.getMaskedImage(),
expScale=exposure.getCalib().getExptime(),
darkScale=darkCalib.getExptime(),
expScale=exposure.getInfo().getVisitInfo().getExposureTime(),
darkScale=darkExposure.getInfo().getVisitInfo().getExposureTime(),
)

def doLinearize(self, detector):
Expand Down

0 comments on commit ebad5bc

Please sign in to comment.