Skip to content

Commit

Permalink
Allow for missing inputs when deblending
Browse files Browse the repository at this point in the history
Sometimes inputs to the deblender are missing due to previous tasks
not producing them. This means the corresponding output catalog will
not be present. Adjust the 'put' logic in DeblendCoaddSourcesMultiTask
such that missing datasets will be set to None.
  • Loading branch information
natelust committed Aug 2, 2021
1 parent 81e6017 commit 5872353
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
sortedTemplateCatalogs = []
for outRef in outputRefs.templateCatalogs:
band = outRef.dataId['band']
sortedTemplateCatalogs.append(outputs.templateCatalogs[band])
# use the .get method because if the key does not exist, it will return
# None, putting None is the same as not putting something, and down-stream
# tasks can use that as a signal the dataset was not processed
sortedTemplateCatalogs.append(outputs.templateCatalogs.get(band))
outputs.templateCatalogs = sortedTemplateCatalogs
butlerQC.put(outputs, outputRefs)

Expand Down

0 comments on commit 5872353

Please sign in to comment.