Skip to content

Commit

Permalink
Clear single-frame streak mask if it exists already
Browse files Browse the repository at this point in the history
Before detecting streaks on the difference warps, clear any existing
mask using the same name. Any existing mask has been PSF-matched,
is not a replacement for detecting streaks on the differences, and
should not be used in the artifact rejection loop.

To clip pixels based on the single-frame streak masks, add that mask
name to the badMaskPlanes config parameter.

Streaks detected on the warp differences are expected to be better
in that they are straight, cross multiple detectors, and are not competing
against the background of static sources
  • Loading branch information
yalsayyad committed Dec 9, 2023
1 parent 44a7e41 commit ce899e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/lsst/drp/tasks/assemble_coadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,12 @@ def findArtifacts(self, templateCoadd, tempExpRefList, imageScalerList):

if self.config.doFilterMorphological:
maskName = self.config.streakMaskName
# clear single frame streak mask if it exists already
if maskName in warpDiffExp.mask.getMaskPlaneDict():
warpDiffExp.mask.clearMaskPlane(warpDiffExp.mask.getMaskPlane(maskName))
else:
self.log.debug(f"Did not (need to) clear {maskName} mask because it didn't exist")

_ = self.maskStreaks.run(warpDiffExp)
streakMask = warpDiffExp.mask
spanSetStreak = afwGeom.SpanSet.fromMask(
Expand Down

0 comments on commit ce899e7

Please sign in to comment.