280 inputs = butlerQC.get(inputRefs)
281 id_tp = self.config.idGenerator.apply(butlerQC.quantum.dataId).catalog_id
283 input_refs_objs = [(getattr(inputRefs, key), inputs[key])
284 for key
in (
"cats_meas",
"coadds",
"models_psf")]
285 cats, exps, models_psf = [
286 {dRef.dataId: obj
for dRef, obj
in zip(refs, objs)}
287 for refs, objs
in input_refs_objs
289 dataIds = set(cats).union(set(exps))
290 models_scarlet = inputs[
"models_scarlet"]
292 for dataId
in dataIds:
293 catalog = cats[dataId]
294 exposure = exps[dataId]
295 updateCatalogFootprints(
296 modelData=models_scarlet,
299 imageForRedistribution=exposure,
300 removeScarletData=
True,
301 updateFluxColumns=
False,
304 catalog=catalog, exposure=exposure, table_psf_fits=models_psf[dataId],
305 dataId=dataId, id_tract_patch=id_tp,
307 catexps = [catexps[band]
for band
in self.config.get_band_sets()[0]]
308 outputs = self.
run(catexps=catexps, cat_ref=inputs[
'cat_ref'])
309 butlerQC.put(outputs, outputRefs)
311 def run(self, catexps: list[CatalogExposure], cat_ref: afwTable.SourceCatalog) -> pipeBase.Struct:
312 """Fit sources from a reference catalog using data from multiple
313 exposures in the same region (patch).
317 catexps : `typing.List [CatalogExposure]`
318 A list of catalog-exposure pairs in a given band.
319 cat_ref : `lsst.afw.table.SourceCatalog`
320 A reference source catalog to fit.
324 retStruct : `lsst.pipe.base.Struct`
325 A struct with a cat_output attribute containing the output
330 Subtasks may have further requirements; see `CoaddMultibandFitSubTask.run`.
332 cat_output = self.fit_coadd_multiband.run(catalog_multi=cat_ref, catexps=catexps).output
333 retStruct = pipeBase.Struct(cat_output=cat_output)