Skip to content

Commit

Permalink
Create option to skip footprints
Browse files Browse the repository at this point in the history
  • Loading branch information
fred3m committed May 30, 2022
1 parent 44200fe commit e9f1e54
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/lsst/pipe/tasks/multiBand.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,10 @@ class MeasureMergedCoaddSourcesConfig(PipelineTaskConfig,
doc="Whether to use the deblender models as templates to re-distribute the flux "
"from the 'exposure' (True), or to perform measurements on the deblender "
"model footprints.")
doStripFootprints = Field(dtype=bool, default=True,
doc="Whether to strip footprints from the output catalog before "
"saving to disk. "
"This is usually done when using scarlet models to save disk space.")
measurement = ConfigurableField(target=SingleFrameMeasurementTask, doc="Source measurement")
setPrimaryFlags = ConfigurableField(target=SetPrimaryFlagsTask, doc="Set flags for primary tract/patch")
doPropagateFlags = Field(
Expand Down Expand Up @@ -1033,9 +1037,11 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
if "scarletCatalog" in inputs:
inputCatalog = inputs.pop("scarletCatalog")
catalogRef = inputRefs.scarletCatalog
loadedModels = True
else:
inputCatalog = inputs.pop("inputCatalog")
catalogRef = inputRefs.inputCatalog
loadedModels = False
sources.extend(inputCatalog, self.schemaMapper)
del inputCatalog
# Add the HeavyFootprints to the deblended sources
Expand Down Expand Up @@ -1113,8 +1119,9 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
outputs = self.run(**inputs)
# Strip HeavyFootprints to save space on disk
sources = outputs.outputSources
for source in sources[sources["parent"] != 0]:
source.setFootprint(None)
if self.config.inputCatalog == "deblendedCatalog" and self.config.doStripFootprints:
for source in sources[sources["parent"] != 0]:
source.setFootprint(None)
butlerQC.put(outputs, outputRefs)

def runDataRef(self, patchRef, psfCache=100):
Expand Down

0 comments on commit e9f1e54

Please sign in to comment.