Skip to content

Commit

Permalink
Add streak masking
Browse files Browse the repository at this point in the history
Also add the STREAK mask plane to the test exposure util.
Without this, the pixelFlags plugin will fail, and we
cannot run maskStreaksTask directly since it's in pipe_tasks.
  • Loading branch information
mrawls committed Oct 25, 2023
1 parent a7c8634 commit 5b11695
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/lsst/ip/diffim/detectAndMeasure.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ def setDefaults(self):
self.forcedMeasurement.slots.centroid = "base_TransformedCentroid"
self.forcedMeasurement.slots.shape = None

# Keep track of which footprints contain streaks
self.measurement.plugins['base_PixelFlags'].masksFpAnywhere = ['STREAK']
self.measurement.plugins['base_PixelFlags'].masksFpCenter = ['STREAK']


class DetectAndMeasureTask(lsst.pipe.base.PipelineTask):
"""Detect and measure sources on a difference image.
Expand Down
1 change: 1 addition & 0 deletions python/lsst/ip/diffim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,7 @@ def detectTestSources(exposure):
sigma=None, # The appropriate sigma is calculated from the PSF
doSmooth=True
)
exposure.mask.addMaskPlane("STREAK") # Cannot run maskStreaksTask here, as it's in pipe_tasks
selectSources = detRet.sources
selectMeasurement.run(measCat=selectSources, exposure=exposure)

Expand Down

0 comments on commit 5b11695

Please sign in to comment.