Skip to content

Commit 144923e

Browse files
committed
Add log and change saturation height threshold for saturation sag masking.
1 parent ffe7e49 commit 144923e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

python/lsst/ip/isr/isrFunctions.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def _applyMaskITLEdgeBleed(ccdExposure, xCore,
517517
sliceMask[y, lowerRange:upperRange] |= saturatedBit
518518

519519

520-
def maskITLSatSag(ccdExposure, fpCore, saturatedMaskName="SAT"):
520+
def maskITLSatSag(ccdExposure, fpCore, saturatedMaskName="SAT", log=None):
521521
"""Mask columns presenting saturation sag in saturated footprints in
522522
ITL detectors.
523523
@@ -529,20 +529,25 @@ def maskITLSatSag(ccdExposure, fpCore, saturatedMaskName="SAT"):
529529
Footprint of saturated core.
530530
saturatedMaskName : `str`, optional
531531
Mask name for saturation.
532+
log : `logging.Logger`, optional
533+
Logger to handle messages.
532534
"""
535+
log = log if log else logging.getLogger(__name__)
533536

534537
# TODO DM-49736: add a flux level check to apply masking
535538

536539
maskedImage = ccdExposure.maskedImage
537540
saturatedBit = maskedImage.mask.getPlaneBitMask(saturatedMaskName)
538541

539542
cc = numpy.sum(fpCore.getSpans().asArray(), axis=0)
540-
# Mask full columns that have 20 percent of the height of the footprint
543+
# Mask full columns that have 30 percent of the height of the footprint
541544
# saturated
542-
columnsToMaskFP = numpy.where(cc > fpCore.getSpans().asArray().shape[0]/5.)
545+
columnsToMaskFP = numpy.where(cc > fpCore.getSpans().asArray().shape[0]*0.3)
543546

544547
columnsToMask = [x + int(fpCore.getBBox().getMinX()) for x in columnsToMaskFP]
545-
maskedImage.mask.array[:, columnsToMask] |= saturatedBit
548+
549+
log.info("Masking %d columns for saturation sag masking.", len(columnsToMask[0]))
550+
maskedImage.mask.array[:, columnsToMask[0]] |= saturatedBit
546551

547552

548553
def maskITLDip(exposure, detectorConfig, maskPlaneNames=["SUSPECT", "ITL_DIP"], log=None):

python/lsst/ip/isr/isrTaskLSST.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ def maskITLSatEdgesAndColumns(self, exposure, badAmpDict):
10731073
)
10741074
if self.config.doITLSatSagMask:
10751075
isrFunctions.maskITLSatSag(ccdExposure=exposure, fpCore=fpCore,
1076-
saturatedMaskName=self.config.saturatedMaskName)
1076+
saturatedMaskName=self.config.saturatedMaskName, log=self.log)
10771077

10781078
def overscanCorrection(self, mode, detectorConfig, detector, badAmpDict, ccdExposure):
10791079
"""Apply serial overscan correction in place to all amps.

0 commit comments

Comments
 (0)