Skip to content

Commit

Permalink
Merge branch 'tickets/DM-46498'
Browse files Browse the repository at this point in the history
  • Loading branch information
taranu committed Jan 8, 2025
2 parents f1e97e5 + e3af1ac commit 3d4cdee
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions python/lsst/pipe/tasks/fit_coadd_multiband.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,27 @@ def __init__(self, initInputs, **kwargs):
super().__init__(initInputs=initInputs, **kwargs)
self.makeSubtask("fit_coadd_multiband")

def make_kwargs(self, butlerQC, inputRefs, inputs):
"""Make any kwargs needed to be passed to run.
This method should be overloaded by subclasses that are configured to
use a specific subtask that needs additional arguments derived from
the inputs but do not otherwise need to overload runQuantum."""
return {}

def runQuantum(self, butlerQC, inputRefs, outputRefs):
inputs = butlerQC.get(inputRefs)
catexps = self.build_catexps(butlerQC, inputRefs, inputs)
outputs = self.run(catexps=catexps, cat_ref=inputs['cat_ref'])
kwargs = self.make_kwargs(butlerQC, inputRefs, inputs)
outputs = self.run(catexps=catexps, cat_ref=inputs['cat_ref'], **kwargs)
butlerQC.put(outputs, outputRefs)

def run(self, catexps: list[CatalogExposure], cat_ref: afwTable.SourceCatalog) -> pipeBase.Struct:
def run(
self,
catexps: list[CatalogExposure],
cat_ref: afwTable.SourceCatalog,
**kwargs
) -> pipeBase.Struct:
"""Fit sources from a reference catalog using data from multiple
exposures in the same region (patch).
Expand All @@ -376,6 +390,6 @@ def run(self, catexps: list[CatalogExposure], cat_ref: afwTable.SourceCatalog) -
-----
Subtasks may have further requirements; see `CoaddMultibandFitSubTask.run`.
"""
cat_output = self.fit_coadd_multiband.run(catalog_multi=cat_ref, catexps=catexps).output
cat_output = self.fit_coadd_multiband.run(catalog_multi=cat_ref, catexps=catexps, **kwargs).output
retStruct = pipeBase.Struct(cat_output=cat_output)
return retStruct

0 comments on commit 3d4cdee

Please sign in to comment.