From 20b9dc8e866162c8ae64e216039d35fdbfa0f4a6 Mon Sep 17 00:00:00 2001 From: Erfan Nourbakhsh Date: Wed, 22 Mar 2023 15:55:35 -0400 Subject: [PATCH 1/2] test commit - rebase later --- python/lsst/pipe/tasks/multiBand.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/lsst/pipe/tasks/multiBand.py b/python/lsst/pipe/tasks/multiBand.py index ba813996b..115e3da7d 100644 --- a/python/lsst/pipe/tasks/multiBand.py +++ b/python/lsst/pipe/tasks/multiBand.py @@ -661,7 +661,12 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs): outputs = self.run(**inputs) # Strip HeavyFootprints to save space on disk - sources = outputs.outputSources + if self.config.doStripFootprints: + sources = outputs.outputSources + for source in sources[sources["parent"] != 0]: + source.setFootprint(None) + else: + raise ValueError('should never reach this if doStripFootprints is True by default!') butlerQC.put(outputs, outputRefs) def run(self, exposure, sources, skyInfo, exposureId, ccdInputs=None, visitCatalogs=None, wcsUpdates=None, From ec44c8e70fc0bb4b1d923371b9c4afb3ac271428 Mon Sep 17 00:00:00 2001 From: Erfan Nourbakhsh Date: Wed, 26 Apr 2023 15:30:37 -0400 Subject: [PATCH 2/2] squash me --- python/lsst/pipe/tasks/multiBand.py | 45 +++++++++++++++++------------ 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/python/lsst/pipe/tasks/multiBand.py b/python/lsst/pipe/tasks/multiBand.py index 115e3da7d..94ead4402 100644 --- a/python/lsst/pipe/tasks/multiBand.py +++ b/python/lsst/pipe/tasks/multiBand.py @@ -23,32 +23,40 @@ import warnings -from lsst.pipe.base import (Struct, PipelineTask, PipelineTaskConfig, PipelineTaskConnections) +import lsst.afw.math as afwMath +import lsst.afw.table as afwTable import lsst.pipe.base.connectionTypes as cT -from lsst.pex.config import Config, Field, ConfigurableField, ChoiceField -from lsst.meas.algorithms import DynamicDetectionTask, ReferenceObjectLoader, ScaleVarianceTask -from lsst.meas.base import SingleFrameMeasurementTask, ApplyApCorrTask, CatalogCalculationTask +from lsst.daf.base import PropertyList +from lsst.meas.algorithms import (DynamicDetectionTask, ReferenceObjectLoader, + ScaleVarianceTask) +from lsst.meas.astrom import DirectMatchTask, denormalizeMatches +from lsst.meas.base import (ApplyApCorrTask, CatalogCalculationTask, + SingleFrameMeasurementTask) from lsst.meas.deblender import SourceDeblendTask from lsst.meas.extensions.scarlet import ScarletDeblendTask -from lsst.meas.astrom import DirectMatchTask, denormalizeMatches +from lsst.obs.base import ExposureIdInfo +from lsst.pex.config import ChoiceField, Config, ConfigurableField, Field +from lsst.pipe.base import (PipelineTask, PipelineTaskConfig, + PipelineTaskConnections, Struct) from lsst.pipe.tasks.fakes import BaseFakeSourcesTask -from lsst.pipe.tasks.setPrimaryFlags import SetPrimaryFlagsTask from lsst.pipe.tasks.propagateSourceFlags import PropagateSourceFlagsTask -import lsst.afw.table as afwTable -import lsst.afw.math as afwMath -from lsst.daf.base import PropertyList +from lsst.pipe.tasks.setPrimaryFlags import SetPrimaryFlagsTask from lsst.skymap import BaseSkyMap -from lsst.obs.base import ExposureIdInfo +from .deblendCoaddSourcesPipeline import \ + DeblendCoaddSourcesMultiConfig # noqa: F401 +from .deblendCoaddSourcesPipeline import \ + DeblendCoaddSourcesMultiTask # noqa: F401 +from .deblendCoaddSourcesPipeline import \ + DeblendCoaddSourcesSingleConfig # noqa: F401 +from .deblendCoaddSourcesPipeline import \ + DeblendCoaddSourcesSingleTask # noqa: F401 # NOTE: these imports are a convenience so multiband users only have to import this file. -from .mergeDetections import MergeDetectionsConfig, MergeDetectionsTask # noqa: F401 -from .mergeMeasurements import MergeMeasurementsConfig, MergeMeasurementsTask # noqa: F401 +from .mergeDetections import (MergeDetectionsConfig, # noqa: F401 + MergeDetectionsTask) +from .mergeMeasurements import (MergeMeasurementsConfig, # noqa: F401 + MergeMeasurementsTask) from .multiBandUtils import CullPeaksConfig # noqa: F401 -from .deblendCoaddSourcesPipeline import DeblendCoaddSourcesSingleConfig # noqa: F401 -from .deblendCoaddSourcesPipeline import DeblendCoaddSourcesSingleTask # noqa: F401 -from .deblendCoaddSourcesPipeline import DeblendCoaddSourcesMultiConfig # noqa: F401 -from .deblendCoaddSourcesPipeline import DeblendCoaddSourcesMultiTask # noqa: F401 - """ New set types: @@ -665,8 +673,7 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs): sources = outputs.outputSources for source in sources[sources["parent"] != 0]: source.setFootprint(None) - else: - raise ValueError('should never reach this if doStripFootprints is True by default!') + butlerQC.put(outputs, outputRefs) def run(self, exposure, sources, skyInfo, exposureId, ccdInputs=None, visitCatalogs=None, wcsUpdates=None,