Coverage for python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py : 46%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# This file is part of pipe_tasks. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (https://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>.
"DeblendCoaddSourcesMultiConfig", "DeblendCoaddSourcesMultiTask")
dimensions=("tract", "patch", "abstract_filter", "skymap"), defaultTemplates=deblendBaseTemplates): doc="Input schema to use in the deblend catalog", name="{inputCoaddName}Coadd_mergeDet_schema", storageClass="SourceCatalog" ) doc="Schema of the footprint peak catalogs", name="{inputCoaddName}Coadd_peak_schema", storageClass="PeakCatalog" ) doc="Detection catalog merged across bands", name="{inputCoaddName}Coadd_mergeDet", storageClass="SourceCatalog", dimensions=("tract", "patch", "skymap") ) doc="Exposure on which to run deblending", name="{inputCoaddName}Coadd_calexp", storageClass="ExposureF", dimensions=("tract", "patch", "abstract_filter", "skymap") ) doc="The output measurement catalog of deblended sources", name="{outputCoaddName}Coadd_deblendedFlux", storageClass="SourceCatalog", dimensions=("tract", "patch", "abstract_filter", "skymap") ) doc="Output of the schema used in deblending task", name="{outputCoaddName}Coadd_deblendedFlux_schema", storageClass="SourceCatalog" )
super().setDefaults() self.singleBandDeblend.propagateAllPeaks = True
pipelineConnections=DeblendCoaddSourceSingleConnections): target=SourceDeblendTask, doc="Task to deblend an image in one band" )
dimensions=("tract", "patch", "skymap"), defaultTemplates=deblendBaseTemplates): doc="Input schema to use in the deblend catalog", name="{inputCoaddName}Coadd_mergeDet_schema", storageClass="SourceCatalog" ) doc="Schema of the footprint peak catalogs", name="{inputCoaddName}Coadd_peak_schema", storageClass="PeakCatalog" ) doc="Detection catalog merged across bands", name="{inputCoaddName}Coadd_mergeDet", storageClass="SourceCatalog", dimensions=("tract", "patch", "skymap") ) doc="Exposure on which to run deblending", name="{inputCoaddName}Coadd_calexp", storageClass="ExposureF", multiple=True, dimensions=("tract", "patch", "abstract_filter", "skymap") ) doc="Output of the schema used in deblending task", name="{outputCoaddName}Coadd_deblendedModel_schema", storageClass="SourceCatalog" ) doc="Flux catalogs produced by multiband deblending, not written " "if conserve flux is turned off", name="{outputCoaddName}Coadd_deblendedFlux", storageClass="SourceCatalog", dimensions=("tract", "patch", "abstract_filter", "skymap") ) doc="Template catalogs produced by multiband deblending", name="{outputCoaddName}Coadd_deblendedModel", storageClass="SourceCatalog", dimensions=("tract", "patch", "abstract_filter", "skymap") )
super().__init__(config=config) if not config.multibandDeblend.conserveFlux: self.outputs -= set(("fluxCatalogs",))
pipelineConnections=DeblendCoaddSourcesMultiConnections): target=MultibandDeblendTask, doc="Task to deblend an images in multiple bands" )
super().__init__(initInputs=initInputs, **kwargs) schema = initInputs["inputSchema"].schema self.peakSchema = initInputs["peakSchema"].schema self.schemaMapper = afwTable.SchemaMapper(schema) self.schemaMapper.addMinimalSchema(schema) self.schema = self.schemaMapper.getOutputSchema()
inputs = butlerQC.get(inputRefs) packedId, maxBits = butlerQC.quantum.dataId.pack("tract_patch", returnMaxBits=True) inputs["idFactory"] = afwTable.IdFactory.makeSource(packedId, 64 - maxBits) outputs = self.run(**inputs) butlerQC.put(outputs, outputRefs)
table = afwTable.SourceTable.make(self.schema, idFactory) sources = afwTable.SourceCatalog(table) sources.extend(mergedDetections, self.schemaMapper) return sources
super().__init__(initInputs=initInputs, **kwargs) self.makeSubtask("singleBandDeblend", schema=self.schema, peakSchema=self.peakSchema) self.outputSchema = afwTable.SourceCatalog(self.schema)
sources = self._makeSourceCatalog(mergedDetections, idFactory) self.singleBandDeblend.run(coadd, sources) if not sources.isContiguous(): sources = sources.copy(deep=True) return Struct(measureCatalog=sources)
super().__init__(initInputs=initInputs, **kwargs) self.makeSubtask("multibandDeblend", schema=self.schema, peakSchema=self.peakSchema) self.outputSchema = afwTable.SourceCatalog(self.schema)
inputs = butlerQC.get(inputRefs) packedId, maxBits = butlerQC.quantum.dataId.pack("tract_patch", returnMaxBits=True) inputs["idFactory"] = afwTable.IdFactory.makeSource(packedId, 64 - maxBits) inputs["filters"] = [dRef.dataId["abstract_filter"] for dRef in inputRefs.coadds] outputs = self.run(**inputs) butlerQC.put(outputs, outputRefs)
sources = self._makeSourceCatalog(mergedDetections, idFactory) multiExposure = afwImage.MultibandExposure.fromExposures(filters, coadds) fluxCatalogs, templateCatalogs = self.multibandDeblend.run(multiExposure, sources) retStruct = Struct(templateCatalogs) if self.config.multibandDeblend.conserveFlux: retStruct.fluxCatalogs = fluxCatalogs return retStruct |