Skip to content

Commit

Permalink
Use scarlet_lite io
Browse files Browse the repository at this point in the history
  • Loading branch information
fred3m committed Jun 1, 2023
1 parent cdb7959 commit 1e2006d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions python/lsst/pipe/tasks/multiBand.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
CatalogCalculationTask,
SkyMapIdGeneratorConfig,
)
from lsst.meas.extensions.scarlet.io import updateCatalogFootprints
from lsst.meas.astrom import DirectMatchTask, denormalizeMatches
from lsst.pipe.tasks.fakes import BaseFakeSourcesTask
from lsst.pipe.tasks.setPrimaryFlags import SetPrimaryFlagsTask
Expand Down Expand Up @@ -577,12 +578,13 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
redistributeImage = inputs['exposure'].image
else:
redistributeImage = None
modelData.updateCatalogFootprints(
updateCatalogFootprints(
modelData=modelData,
catalog=sources,
band=inputRefs.exposure.dataId["band"],
psfModel=inputs['exposure'].getPsf(),
redistributeImage=redistributeImage,
removeScarletData=True,
updateFluxColumns=True,
)
table = sources.getTable()
table.setMetadata(self.algMetadata) # Capture algorithm metadata to write out to the source catalog.
Expand Down
9 changes: 6 additions & 3 deletions tests/test_isPrimaryFlag.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from lsst.pipe.tasks.characterizeImage import CharacterizeImageTask, CharacterizeImageConfig
from lsst.pipe.tasks.calibrate import CalibrateTask, CalibrateConfig
from lsst.meas.algorithms import SourceDetectionTask, SkyObjectsTask
import lsst.meas.extensions.scarlet as mes
from lsst.meas.extensions.scarlet.scarletDeblendTask import ScarletDeblendTask
from lsst.meas.base import SingleFrameMeasurementTask
from lsst.pipe.tasks.setPrimaryFlags import SetPrimaryFlagsTask, getPseudoSources
Expand Down Expand Up @@ -251,11 +252,13 @@ def testIsScarletPrimaryFlag(self):
# deblend
catalog, modelData = deblendTask.run(coadds, catalog)
# Attach footprints to the catalog
modelData.updateCatalogFootprints(
mes.io.updateCatalogFootprints(
modelData=modelData,
catalog=catalog,
band="test",
psfModel=coadds["test"].getPsf(),
redistributeImage=None,
redistributeImage=coadds.image["test"],
removeScarletData=True,
updateFluxColumns=True
)
# measure
measureTask.run(catalog, self.exposure)
Expand Down

0 comments on commit 1e2006d

Please sign in to comment.