Skip to content

Commit

Permalink
Fix overscan mean/median typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Broughton committed Oct 7, 2024
1 parent 5ed87b5 commit 6c748ae
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
10 changes: 5 additions & 5 deletions python/lsst/ip/isr/deferredCharge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/ip/isr/isrFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,4 +1323,4 @@ def isTrimmedImage(image, detector):
result : `bool`
True if the image is trimmed, else False.
"""
return detector.getBBox() == image.getBBox()
return detector.getBBox() == image.getBBox()
2 changes: 1 addition & 1 deletion python/lsst/ip/isr/isrStatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 8 additions & 2 deletions python/lsst/ip/isr/isrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions python/lsst/ip/isr/isrTaskLSST.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
4 changes: 3 additions & 1 deletion python/lsst/ip/isr/linearize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6c748ae

Please sign in to comment.