Trouble Running DeblendCoaddSourcesSingleTask on v26

Hi Folks,

I’m working on a small project right now with DECam data which requires moving back to single-band deblending. I was able to run it alright by changing the deblend task in DRP-Merian to DeblendCoaddSourcesSingleTask, but I’m running into issues on the measure step. Right now I’ve followed the guidance outlined in comments on github, and have added the following to my configuration file:

config.inputCatalog='deblendedFlux'
config.doAddFootprints=False

But the qgraph generation fails with the following error:

FutureWarning: Dataset type(s) ['deepCoadd_deblendedCatalog'] are not registered; this will be an error after v26.
  with registry.queryDataIds(**queryArgs).materialize() as commonDataIds:

lsst.ctrl.bps.pre_transform INFO: CRITICAL 2024-10-18T22:51:31.525-04:00 lsst.pipe.base.graphBuilder ()(graphBuilder.py:1128) - Initial data ID query returned no rows, so QuantumGraph will be empty.

lsst.ctrl.bps.pre_transform INFO: CRITICAL 2024-10-18T22:51:31.526-04:00 lsst.pipe.base.graphBuilder ()(graphBuilder.py:1131) - Dataset type deepCoadd_deblendedCatalog is not registered.

lsst.ctrl.bps.pre_transform INFO: ERROR 2024-10-18T22:51:31.529-04:00 lsst.daf.butler.cli.utils ()(utils.py:1127) - Caught an exception, details are in traceback:
Traceback (most recent call last):
  File "/users/idellant/data/Clusters/gen3_processing/lsst_stack_v26_0_0/stack/miniconda3-py38_4.9.2-7.0.1/Linux64/ctrl_mpexec/g218a3a8f53+ca4789321c/python/lsst/ctrl/mpexec/cli/cmd/commands.py", line 178, in qgraph
    if script.qgraph(pipelineObj=pipeline, **kwargs, show=show) is None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/users/idellant/data/Clusters/gen3_processing/lsst_stack_v26_0_0/stack/miniconda3-py38_4.9.2-7.0.1/Linux64/ctrl_mpexec/g218a3a8f53+ca4789321c/python/lsst/ctrl/mpexec/cli/script/qgraph.py", line 210, in qgraph
    qgraph = f.makeGraph(pipelineObj, args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/users/idellant/data/Clusters/gen3_processing/lsst_stack_v26_0_0/stack/miniconda3-py38_4.9.2-7.0.1/Linux64/ctrl_mpexec/g218a3a8f53+ca4789321c/python/lsst/ctrl/mpexec/cmdLineFwk.py", line 622, in makeGraph
    qgraph = graphBuilder.makeGraph(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/users/idellant/data/Clusters/gen3_processing/lsst_stack_v26_0_0/stack/miniconda3-py38_4.9.2-7.0.1/Linux64/pipe_base/g8798d61f7d+6612571a14/python/lsst/pipe/base/graphBuilder.py", line 1831, in makeGraph
    scaffolding.resolveDatasetRefs(
  File "/users/idellant/data/Clusters/gen3_processing/lsst_stack_v26_0_0/stack/miniconda3-py38_4.9.2-7.0.1/Linux64/pipe_base/g8798d61f7d+6612571a14/python/lsst/pipe/base/graphBuilder.py", line 1348, in resolveDatasetRefs
    raise RuntimeError(
RuntimeError: 1 dataset(s) of type 'deepCoadd_deblendedFlux_schema' was/were present in a previous query, but could not be found now. This is either a logic bug in QuantumGraph generation or the input collections have been modified since QuantumGraph generation began.

Looking at the Github, I’m not sure why the pipeline is still looking for a dataset type deepCoadd_deblendedCatalog despite the inputCatalog being updated. I suspect that the trouble lies in line 298 and the pipeline is still expecting this dataset to exist and be defined… I’ve also already verified that both the deepCoadd_deblendedFlux and deepCoadd_deblendedFlux_schema dataset types have been created and are stored in my input collections, so I’m not sure where this is going wrong.

Any ideas? Thanks for the help!

What are you submitting exactly to BPS? What does the pipeline-graph look like?

pipetask build -p my_pipeline_yaml.yaml --show pipeline-graph

I think the problem is actually here: there is no connection called deblendedCatalog; the only thing with that name is a defaultTemplate (so actually I’m surprised that that line doesn’t raise). Try changing that line to self.inputs -= set(("scarletCatalog")) and see if that works, in which case this is a bug.

Uhoh for me, looks like I had a typo in my configs which was raising an error! After double-checking my earlier configs… I was using single quotation-marks instead of double-quotation marks, e.g. the fix here is simple:

config.inputCatalog="deblendedFlux"
config.doAddFootprints=False

Pipeline-graphs are all rendering and the preliminary issues are all fixed now, sorry for the false alarm! For completion I’ve also attached my pipeline-graphs for coaddmeasure, which has everything sorted out.

step_3b.pdf (24.1 KB)

2 Likes

Hey just a quick followup on this!

Updating the typo fixed the qgraph generation issue I was having, but @dtaranu was correct in that the "scarletCatalog" should be removed, not deblendedCatalog (which does not exist). The fix which worked for me was changing the line he linked to self.inputs -= set(("scarletCatalog",)) .

Thanks, @antenglert !

@antenglert, did you try using the Scarlet deblender prior to this post, or did you assume it wouldn’t work because you’ve only got data from a single band? I’m actually hoping that DM can drop support for DeblendCoaddSourcesSingleTask in the future, in part to clean up the mess of confusing configuration options you encountered here.

Hi Jim!

I’m only using the DeblendCoaddSourcesSingleTask to test the impact that moving from a single to multiband-deblender has on my processing pipeline, so dropping support won’t impact anything that I’m doing right now in the long-term.

Anthony