diff --git a/python/lsst/ip/diffim/detectAndMeasure.py b/python/lsst/ip/diffim/detectAndMeasure.py index 085b70fc..7d2b0bd6 100644 --- a/python/lsst/ip/diffim/detectAndMeasure.py +++ b/python/lsst/ip/diffim/detectAndMeasure.py @@ -726,6 +726,8 @@ def _runStreakMasking(self, difference): self.config.streakBinFactor) binnedExposure = afwImage.ExposureF(binnedMaskedImage.getBBox()) binnedExposure.setMaskedImage(binnedMaskedImage) + # Clear the DETECTED mask plane before streak detection + binnedExposure.mask &= ~binnedExposure.mask.getPlaneBitMask('DETECTED') # Rerun detection to set the DETECTED mask plane on binnedExposure sigma = difference.psf.computeShape(difference.psf.getAveragePosition()).getDeterminantRadius() _table = afwTable.SourceTable.make(afwTable.SourceTable.makeMinimalSchema())