@@ -517,7 +517,7 @@ def _applyMaskITLEdgeBleed(ccdExposure, xCore,
517
517
sliceMask [y , lowerRange :upperRange ] |= saturatedBit
518
518
519
519
520
- def maskITLSatSag (ccdExposure , fpCore , saturatedMaskName = "SAT" ):
520
+ def maskITLSatSag (ccdExposure , fpCore , saturatedMaskName = "SAT" , log = None ):
521
521
"""Mask columns presenting saturation sag in saturated footprints in
522
522
ITL detectors.
523
523
@@ -529,20 +529,25 @@ def maskITLSatSag(ccdExposure, fpCore, saturatedMaskName="SAT"):
529
529
Footprint of saturated core.
530
530
saturatedMaskName : `str`, optional
531
531
Mask name for saturation.
532
+ log : `logging.Logger`, optional
533
+ Logger to handle messages.
532
534
"""
535
+ log = log if log else logging .getLogger (__name__ )
533
536
534
537
# TODO DM-49736: add a flux level check to apply masking
535
538
536
539
maskedImage = ccdExposure .maskedImage
537
540
saturatedBit = maskedImage .mask .getPlaneBitMask (saturatedMaskName )
538
541
539
542
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
541
544
# saturated
542
- columnsToMaskFP = numpy .where (cc > fpCore .getSpans ().asArray ().shape [0 ]/ 5. )
545
+ columnsToMaskFP = numpy .where (cc > fpCore .getSpans ().asArray ().shape [0 ]* 0.3 )
543
546
544
547
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
546
551
547
552
548
553
def maskITLDip (exposure , detectorConfig , maskPlaneNames = ["SUSPECT" , "ITL_DIP" ], log = None ):
0 commit comments