Skip to content

Commit

Permalink
Merge pull request #639 from lsst/tickets/DM-33888
Browse files Browse the repository at this point in the history
DM-33888: Add config parameter to grow streak footprints
  • Loading branch information
cmsaunders committed Apr 6, 2022
2 parents 3073db8 + d97a310 commit cc30fec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/lsst/pipe/tasks/assembleCoadd.py
Expand Up @@ -2012,6 +2012,11 @@ class CompareWarpAssembleCoaddConfig(AssembleCoaddConfig,
dtype=bool,
default=False
)
growStreakFp = pexConfig.Field(
doc="Grow streak footprints by this number multiplied by the PSF width",
dtype=float,
default=5
)

def setDefaults(self):
AssembleCoaddConfig.setDefaults(self)
Expand Down Expand Up @@ -2417,6 +2422,13 @@ def findArtifacts(self, templateCoadd, tempExpRefList, imageScalerList):
streakMask = warpDiffExp.mask
spanSetStreak = afwGeom.SpanSet.fromMask(streakMask,
streakMask.getPlaneBitMask(maskName)).split()
# Pad the streaks to account for low-surface brightness wings
psf = warpDiffExp.getPsf()
for s, sset in enumerate(spanSetStreak):
psfShape = psf.computeShape(sset.computeCentroid())
dilation = self.config.growStreakFp * psfShape.getDeterminantRadius()
sset_dilated = sset.dilated(int(dilation))
spanSetStreak[s] = sset_dilated

# PSF-Matched warps have less available area (~the matching kernel) because the calexps
# undergo a second convolution. Pixels with data in the direct warp
Expand Down

0 comments on commit cc30fec

Please sign in to comment.