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"]
291 for dataId
in 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 catexps = [catexps[band]
for band
in self.config.get_band_sets()[0]]
307 outputs = self.
run(catexps=catexps, cat_ref=inputs[
'cat_ref'])
308 butlerQC.put(outputs, outputRefs)
310 def run(self, catexps: list[CatalogExposure], cat_ref: afwTable.SourceCatalog) -> pipeBase.Struct:
311 """Fit sources from a reference catalog using data from multiple
312 exposures in the same region (patch).
316 catexps : `typing.List [CatalogExposure]`
317 A list of catalog-exposure pairs in a given band.
318 cat_ref : `lsst.afw.table.SourceCatalog`
319 A reference source catalog to fit.
323 retStruct : `lsst.pipe.base.Struct`
324 A struct with a cat_output attribute containing the output
329 Subtasks may have further requirements; see `CoaddMultibandFitSubTask.run`.
331 cat_output = self.fit_coadd_multiband.run(catalog_multi=cat_ref, catexps=catexps).output
332 retStruct = pipeBase.Struct(cat_output=cat_output)