Skip to content

Commit

Permalink
Add maskStreaks to test exposure util
Browse files Browse the repository at this point in the history
Need to run MaskStreaks to add the STREAK plane to the Exposure,
otherwise the pixelFlags plugin will fail.
  • Loading branch information
parejkoj authored and mrawls committed Oct 18, 2023
1 parent f4f8d7a commit 53c39d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/lsst/ip/diffim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import lsst.meas.algorithms as measAlg
import lsst.meas.base as measBase
from lsst.meas.algorithms.testUtils import plantSources
from lsst.pipe.tasks.maskStreaks import MaskStreaksTask
from lsst.pex.exceptions import InvalidParameterError
from lsst.utils.logging import getLogger
from .dipoleFitTask import DipoleFitAlgorithm
Expand Down Expand Up @@ -1256,6 +1257,8 @@ def detectTestSources(exposure):

schema = afwTable.SourceTable.makeMinimalSchema()
selectDetection = measAlg.SourceDetectionTask(schema=schema)
# Run streak detection to create the STREAK mask plane.
maskStreaks = MaskStreaksTask()
selectMeasurement = measBase.SingleFrameMeasurementTask(schema=schema)
table = afwTable.SourceTable.make(schema)

Expand All @@ -1265,6 +1268,7 @@ def detectTestSources(exposure):
sigma=None, # The appropriate sigma is calculated from the PSF
doSmooth=True
)
maskStreaks.run(exposure)
selectSources = detRet.sources
selectMeasurement.run(measCat=selectSources, exposure=exposure)

Expand Down

0 comments on commit 53c39d8

Please sign in to comment.