diff --git a/python/lsst/ip/isr/deferredCharge.py b/python/lsst/ip/isr/deferredCharge.py index b984fce6..a1a40f50 100644 --- a/python/lsst/ip/isr/deferredCharge.py +++ b/python/lsst/ip/isr/deferredCharge.py @@ -953,11 +953,11 @@ def fromTable(cls, tableList): # Version check if calibVersion < 1.1: - #This version might be in the wrong units (not electron), and does not - # contain the gain information to convert into a a new calibration - # version. + # This version might be in the wrong units (not electron), + # and does not contain the gain information to convert + # into a new calibration version. raise RuntimeError(f"Using old version of CTI calibration (ver. {calibVersion} < 1.1), " - "which is no longer supported.") + "which is no longer supported.") return cls.fromDict(inDict) @@ -1128,7 +1128,7 @@ def run(self, exposure, ctiCalib, gains=None): for amp in detector.getAmplifiers(): ampName = amp.getName() - ampImage = image[amp.getRawDataBBox()] + ampImage = image[amp.getRawBBox()] if self.config.zeroUnusedPixels: # We don't apply overscan subtraction, so zero these # out for now. diff --git a/python/lsst/ip/isr/isrFunctions.py b/python/lsst/ip/isr/isrFunctions.py index bc6696ee..08ba1c6a 100644 --- a/python/lsst/ip/isr/isrFunctions.py +++ b/python/lsst/ip/isr/isrFunctions.py @@ -1323,4 +1323,4 @@ def isTrimmedImage(image, detector): result : `bool` True if the image is trimmed, else False. """ - return detector.getBBox() == image.getBBox() \ No newline at end of file + return detector.getBBox() == image.getBBox() diff --git a/python/lsst/ip/isr/isrStatistics.py b/python/lsst/ip/isr/isrStatistics.py index a02193a0..a73a47e8 100644 --- a/python/lsst/ip/isr/isrStatistics.py +++ b/python/lsst/ip/isr/isrStatistics.py @@ -365,7 +365,7 @@ def measureCti(self, inputExp, overscans, gains): # Ensure we have the same number of overscans as amplifiers. assert len(overscans) == len(detector.getAmplifiers()) - with gainContext(inputExp, image, applyGain, gains, isTrimmed=isTrimmed: + with gainContext(inputExp, image, applyGain, gains, isTrimmed=isTrimmed): for ampIter, amp in enumerate(detector.getAmplifiers()): ampStats = {} readoutCorner = amp.getReadoutCorner() diff --git a/python/lsst/ip/isr/isrTask.py b/python/lsst/ip/isr/isrTask.py index c1a83761..4cfd2242 100644 --- a/python/lsst/ip/isr/isrTask.py +++ b/python/lsst/ip/isr/isrTask.py @@ -1437,23 +1437,29 @@ def run(self, ccdExposure, *, camera=None, bias=None, linearizer=None, if isinstance(overscanResults.overscanMean, float): # Only serial overscan was run mean = overscanResults.overscanMean + median = overscanResults.overscanMedian sigma = overscanResults.overscanSigma residMean = overscanResults.residualMean + residMedian = overscanResults.residualMedian residSigma = overscanResults.residualSigma else: # Both serial and parallel overscan were # run. Only report serial here. mean = overscanResults.overscanMean[0] + median = overscanResults.overscanMedian[0] sigma = overscanResults.overscanSigma[0] residMean = overscanResults.residualMean[0] + residMedian = overscanResults.residualMedian[0] residSigma = overscanResults.residualSigma[0] - self.metadata[f"FIT MEDIAN {amp.getName()}"] = mean + self.metadata[f"FIT MEDIAN {amp.getName()}"] = median + self.metadata[f"FIT MEAN {amp.getName()}"] = mean self.metadata[f"FIT STDEV {amp.getName()}"] = sigma self.log.debug(" Overscan stats for amplifer %s: %f +/- %f", amp.getName(), mean, sigma) - self.metadata[f"RESIDUAL MEDIAN {amp.getName()}"] = residMean + self.metadata[f"RESIDUAL MEDIAN {amp.getName()}"] = residMedian + self.metadata[f"RESIDUAL MEAN {amp.getName()}"] = residMean self.metadata[f"RESIDUAL STDEV {amp.getName()}"] = residSigma self.log.debug(" Overscan stats for amplifer %s after correction: %f +/- %f", amp.getName(), residMean, residSigma) diff --git a/python/lsst/ip/isr/isrTaskLSST.py b/python/lsst/ip/isr/isrTaskLSST.py index 24cf9464..3abcdde9 100644 --- a/python/lsst/ip/isr/isrTaskLSST.py +++ b/python/lsst/ip/isr/isrTaskLSST.py @@ -774,6 +774,7 @@ def overscanCorrection(self, mode, detectorConfig, detector, badAmpDict, ccdExpo Returns ------- overscans : `list` [`lsst.pipe.base.Struct` or None] + Overscan measurements (always in adu). Each result struct has components: ``imageFit`` diff --git a/python/lsst/ip/isr/linearize.py b/python/lsst/ip/isr/linearize.py index fa65e873..ef63460f 100644 --- a/python/lsst/ip/isr/linearize.py +++ b/python/lsst/ip/isr/linearize.py @@ -498,7 +498,9 @@ def applyLinearity(self, image, detector=None, log=None, gains=None): self.validate(detector) # Check if the image is trimmed. - isTrimmed = isTrimmedImage(image, detector) + isTrimmed = None + if detector: + isTrimmed = isTrimmedImage(image, detector) numAmps = 0 numLinearized = 0