From d9b8c2e15ed4397e7f6b1c2d4e22bcc5cbaf24cd Mon Sep 17 00:00:00 2001 From: fred3m Date: Tue, 18 Apr 2023 15:35:51 -0700 Subject: [PATCH] Use scarlet_lite io --- python/lsst/pipe/tasks/multiBand.py | 6 ++++-- tests/test_isPrimaryFlag.py | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/python/lsst/pipe/tasks/multiBand.py b/python/lsst/pipe/tasks/multiBand.py index 892170c56c..1b12467367 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 @@ -562,12 +563,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. diff --git a/tests/test_isPrimaryFlag.py b/tests/test_isPrimaryFlag.py index 2473ceb3ea..6e6a530a9e 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,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)