Skip to content

Commit

Permalink
Merge pull request #777 from lsst/tickets/DM-38432
Browse files Browse the repository at this point in the history
DM-38432: implement scarlet_lite package
  • Loading branch information
fred3m authored Sep 30, 2023
2 parents aec7515 + 2d472af commit 7ef1670
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
13 changes: 7 additions & 6 deletions python/lsst/pipe/tasks/multiBand.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CatalogCalculationTask,
SkyMapIdGeneratorConfig,
)
from lsst.meas.extensions.scarlet.io import updateCatalogFootprints
from lsst.meas.astrom import DirectMatchTask, denormalizeMatches
from lsst.pipe.tasks.setPrimaryFlags import SetPrimaryFlagsTask
from lsst.pipe.tasks.propagateSourceFlags import PropagateSourceFlagsTask
Expand Down Expand Up @@ -559,16 +560,16 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
if self.config.doAddFootprints:
modelData = inputs.pop('scarletModels')
if self.config.doConserveFlux:
redistributeImage = inputs['exposure'].image
imageForResdistibution = inputs['exposure']
else:
redistributeImage = None
modelData.updateCatalogFootprints(
imageForResdistibution = None
updateCatalogFootprints(
modelData=modelData,
catalog=sources,
band=inputRefs.exposure.dataId["band"],
psfModel=inputs['exposure'].getPsf(),
maskImage=inputs['exposure'].mask,
redistributeImage=redistributeImage,
imageForResdistibution=imageForResdistibution,
removeScarletData=True,
updateFluxColumns=True,
)
table = sources.getTable()
table.setMetadata(self.algMetadata) # Capture algorithm metadata to write out to the source catalog.
Expand Down
10 changes: 6 additions & 4 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,12 +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(),
maskImage=coadds["test"].mask,
redistributeImage=None,
imageForResdistibution=coadds["test"],
removeScarletData=True,
updateFluxColumns=True,
)
# measure
measureTask.run(catalog, self.exposure)
Expand Down

0 comments on commit 7ef1670

Please sign in to comment.