diff --git a/python/lsst/pipe/tasks/multiBand.py b/python/lsst/pipe/tasks/multiBand.py index 88775c317..4de7bd2ab 100644 --- a/python/lsst/pipe/tasks/multiBand.py +++ b/python/lsst/pipe/tasks/multiBand.py @@ -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 @@ -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. diff --git a/tests/test_isPrimaryFlag.py b/tests/test_isPrimaryFlag.py index b4b643801..31b663555 100755 --- a/tests/test_isPrimaryFlag.py +++ b/tests/test_isPrimaryFlag.py @@ -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 @@ -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)