From a30245bbe1530ad391299e5aa160d3fe8f4ffc03 Mon Sep 17 00:00:00 2001 From: fred3m Date: Fri, 17 Oct 2025 11:52:15 -0700 Subject: [PATCH] Update for new API for isolated source persistence --- python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py | 2 +- python/lsst/pipe/tasks/fit_coadd_multiband.py | 2 +- python/lsst/pipe/tasks/measurementDriver.py | 7 +++---- python/lsst/pipe/tasks/multiBand.py | 2 +- tests/test_isPrimaryFlag.py | 1 + 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py b/python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py index e8e3a0a6c..35d785363 100644 --- a/python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py +++ b/python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py @@ -118,7 +118,7 @@ class DeblendCoaddSourcesMultiConnections(PipelineTaskConnections, scarletModelData = cT.Output( doc="Multiband scarlet models produced by the deblender", name="{outputCoaddName}Coadd_scarletModelData", - storageClass="ScarletModelData", + storageClass="LsstScarletModelData", dimensions=("tract", "patch", "skymap"), ) objectParents = cT.Output( diff --git a/python/lsst/pipe/tasks/fit_coadd_multiband.py b/python/lsst/pipe/tasks/fit_coadd_multiband.py index 45176e1e2..4af35fd98 100644 --- a/python/lsst/pipe/tasks/fit_coadd_multiband.py +++ b/python/lsst/pipe/tasks/fit_coadd_multiband.py @@ -104,7 +104,7 @@ class CoaddMultibandFitInputConnections( models_scarlet = pipeBase.connectionTypes.Input( doc="Multiband scarlet models produced by the deblender", name="{name_coadd}Coadd_scarletModelData", - storageClass="ScarletModelData", + storageClass="LsstScarletModelData", dimensions=("tract", "patch", "skymap"), ) diff --git a/python/lsst/pipe/tasks/measurementDriver.py b/python/lsst/pipe/tasks/measurementDriver.py index 19f52d292..2d0f089c4 100644 --- a/python/lsst/pipe/tasks/measurementDriver.py +++ b/python/lsst/pipe/tasks/measurementDriver.py @@ -44,7 +44,6 @@ import lsst.meas.deblender as measDeblender import lsst.meas.extensions.scarlet as scarlet import lsst.pipe.base as pipeBase -import lsst.scarlet.lite as scl import numpy as np from lsst.meas.extensions.scarlet.deconvolveExposureTask import DeconvolveExposureTask from lsst.pex.config import Config, ConfigurableField, Field @@ -983,7 +982,7 @@ def __init__(self, *args, **kwargs): # Placeholder for the model data produced by the deblender. Caching # this data has proven be useful for debugging. - self.modelData: scl.io.ScarletModelData + self.modelData: scarlet.io.LsstScarletModelData def run( self, @@ -1047,7 +1046,7 @@ def run( be None if detection is disabled. ``modelData`` Multiband scarlet models produced during deblending - (`~lsst.scarlet.lite.io.ScarletModelData`). Will be None if + (`~scarlet.io.LsstScarletModelData`). Will be None if deblending is disabled. """ @@ -1274,7 +1273,7 @@ def _deblendSources( mDeconvolved: afwImage.MultibandExposure | None, catalog: afwTable.SourceCatalog, refBand: str, - ) -> tuple[dict[str, afwTable.SourceCatalog], scl.io.ScarletModelData]: + ) -> tuple[dict[str, afwTable.SourceCatalog], scarlet.io.LsstScarletModelData]: """Run multi-band deblending given a multi-band exposure and a catalog. Parameters diff --git a/python/lsst/pipe/tasks/multiBand.py b/python/lsst/pipe/tasks/multiBand.py index fb40fa930..09d7cefb9 100644 --- a/python/lsst/pipe/tasks/multiBand.py +++ b/python/lsst/pipe/tasks/multiBand.py @@ -513,7 +513,7 @@ class MeasureMergedCoaddSourcesConnections( scarletModels = cT.Input( doc="Multiband scarlet models produced by the deblender", name="{inputCoaddName}Coadd_scarletModelData", - storageClass="ScarletModelData", + storageClass="LsstScarletModelData", dimensions=("tract", "patch", "skymap"), ) outputSources = cT.Output( diff --git a/tests/test_isPrimaryFlag.py b/tests/test_isPrimaryFlag.py index ad7daa862..17e3aa342 100755 --- a/tests/test_isPrimaryFlag.py +++ b/tests/test_isPrimaryFlag.py @@ -223,6 +223,7 @@ def testIsScarletPrimaryFlag(self): scarletConfig = ScarletDeblendTask.ConfigClass() scarletConfig.maxIter = 20 scarletConfig.columnInheritance["merge_peak_sky"] = "merge_peak_sky" + scarletConfig.processSingles = True deblendTask = ScarletDeblendTask(schema=schema, config=scarletConfig) # We'll customize the configuration of measurement to just run the