Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-37814: Strip heavy footprints #768

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 30 additions & 18 deletions python/lsst/pipe/tasks/multiBand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -661,7 +669,11 @@ 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)

butlerQC.put(outputs, outputRefs)

def run(self, exposure, sources, skyInfo, exposureId, ccdInputs=None, visitCatalogs=None, wcsUpdates=None,
Expand Down