279 def build_catexps(self, butlerQC, inputRefs, inputs) -> list[CatalogExposureInputs]:
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 updateCatalogFootprints(
295 modelData=models_scarlet,
298 imageForRedistribution=exposure,
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]]
310 inputs = butlerQC.get(inputRefs)
312 outputs = self.
run(catexps=catexps, cat_ref=inputs[
'cat_ref'])
313 butlerQC.put(outputs, outputRefs)
315 def run(self, catexps: list[CatalogExposure], cat_ref: afwTable.SourceCatalog) -> pipeBase.Struct:
316 """Fit sources from a reference catalog using data from multiple
317 exposures in the same region (patch).
321 catexps : `typing.List [CatalogExposure]`
322 A list of catalog-exposure pairs in a given band.
323 cat_ref : `lsst.afw.table.SourceCatalog`
324 A reference source catalog to fit.
328 retStruct : `lsst.pipe.base.Struct`
329 A struct with a cat_output attribute containing the output
334 Subtasks may have further requirements; see `CoaddMultibandFitSubTask.run`.
336 cat_output = self.fit_coadd_multiband.run(catalog_multi=cat_ref, catexps=catexps).output
337 retStruct = pipeBase.Struct(cat_output=cat_output)