Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-37022: overscan.py parallel overscan sigma clip is really a threshold clip #240

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion python/lsst/ip/isr/overscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,15 @@ def run(self, exposure, amp, isTransposed=False):

maskIm = exposure.getMaskedImage()
maskIm = maskIm.Factory(maskIm, parallelOverscanBBox)
makeThresholdMask(maskIm, threshold=self.config.numSigmaClip, growFootprints=0)

# The serial overscan correction has removed the majority
# of the signal in the parallel overscan region, so the
# mean should be close to zero. The noise in both should
# be similar, so we can use the noise from the serial
# overscan region to set the threshold for bleed
# detection.
thresholdLevel = self.config.numSigmaClip * serialResults.overscanSigmaResidual
makeThresholdMask(maskIm, threshold=thresholdLevel, growFootprints=0)
maskPix = countMaskedPixels(maskIm, self.config.maskPlanes)
xSize, ySize = parallelOverscanBBox.getDimensions()
if maskPix > xSize*ySize*self.config.parallelOverscanMaskThreshold:
Expand Down