279 inputs = butlerQC.get(inputRefs)
280 id_tp = self.config.idGenerator.apply(butlerQC.quantum.dataId).catalog_id
282 input_refs_objs = [(getattr(inputRefs, key), inputs[key])
283 for key
in (
"cats_meas",
"coadds",
"models_psf")]
284 cats, exps, models_psf = [
285 {dRef.dataId: obj
for dRef, obj
in zip(refs, objs)}
286 for refs, objs
in input_refs_objs
288 dataIds = set(cats).union(set(exps))
289 models_scarlet = inputs[
"models_scarlet"]
290 catexps = [
None]*len(dataIds)
291 for idx, dataId
in enumerate(dataIds):
292 catalog = cats[dataId]
293 exposure = exps[dataId]
294 models_scarlet.updateCatalogFootprints(
297 psfModel=exposure.getPsf(),
298 redistributeImage=exposure.image,
299 removeScarletData=
True,
300 updateFluxColumns=
False,
303 catalog=catalog, exposure=exposure, table_psf_fits=models_psf[dataId],
304 dataId=dataId, id_tract_patch=id_tp,
306 outputs = self.
run(catexps=catexps, cat_ref=inputs[
'cat_ref'])
307 butlerQC.put(outputs, outputRefs)
309 def run(self, catexps: list[CatalogExposure], cat_ref: afwTable.SourceCatalog) -> pipeBase.Struct:
310 """Fit sources from a reference catalog using data from multiple
311 exposures in the same region (patch).
315 catexps : `typing.List [CatalogExposure]`
316 A list of catalog-exposure pairs in a given band.
317 cat_ref : `lsst.afw.table.SourceCatalog`
318 A reference source catalog to fit.
322 retStruct : `lsst.pipe.base.Struct`
323 A struct with a cat_output attribute containing the output
328 Subtasks may have further requirements; see `CoaddMultibandFitSubTask.run`.
330 cat_output = self.fit_coadd_multiband.run(catalog_multi=cat_ref, catexps=catexps).output
331 retStruct = pipeBase.Struct(cat_output=cat_output)