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 the existing mask if it
is already there. The streaks detected on the differences should be
better. They are straight, cross multiple detectors, and are not competing
against the background of static sources
  • Loading branch information
yalsayyad committed Dec 8, 2023
1 parent 44a7e41 commit 154dff0
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
try:
warpDiffExp.mask.clearMaskPlane(warpDiffExp.mask.getMaskPlane(maskName))
except pexExceptions.InvalidParameterError:
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 154dff0

Please sign in to comment.