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

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/>.
InputDatasetField, OutputDatasetField, PipelineTaskConfig)
"DeblendCoaddSourcesMultiConfig", "DeblendCoaddSourcesMultiTask")
doc="Input schema to use in the deblend catalog", nameTemplate="{inputCoaddName}Coadd_mergeDet_schema", storageClass="SourceCatalog" ) doc="Schema of the footprint peak catalogs", nameTemplate="{inputCoaddName}Coadd_peak_schema", storageClass="PeakCatalog" ) doc="Detection catalog merged across bands", nameTemplate="{inputCoaddName}Coadd_mergeDet", storageClass="SourceCatalog", scalar=True, dimensions=("Tract", "Patch", "SkyMap") )
super().setDefaults() self.quantum.dimensions = ("Tract", "Patch", "AbstractFilter", "SkyMap") self.formatTemplateNames({"inputCoaddName": "deep", "outputCoaddName": "deep"})
target=SourceDeblendTask, doc="Task to deblend an image in one band" ) doc="Exposure on which to run deblending", nameTemplate="{inputCoaddName}Coadd_calexp", storageClass="ExposureF", scalar=True, dimensions=("Tract", "Patch", "AbstractFilter", "SkyMap") ) doc="The output measurement catalog of deblended sources", nameTemplate="{outputCoaddName}Coadd_deblendedFlux", scalar=True, storageClass="SourceCatalog", dimensions=("Tract", "Patch", "AbstractFilter", "SkyMap") ) doc="Output of the schema used in deblending task", nameTemplate="{outputCoaddName}Coadd_deblendedFlux_schema", storageClass="SourceCatalog" )
target=MultibandDeblendTask, doc="Task to deblend an images in multiple bands" ) doc="Exposure on which to run deblending", nameTemplate="{inputCoaddName}Coadd_calexp", storageClass="ExposureF", dimensions=("Tract", "Patch", "AbstractFilter", "SkyMap") ) doc="Output of the schema used in deblending task", nameTemplate="{outputCoaddName}Coadd_deblendedModel_schema", storageClass="SourceCatalog" ) doc="Flux catalogs produced by multiband deblending, not written " "if conserve flux is turned off", nameTemplate="{outputCoaddName}Coadd_deblendedFlux", storageClass="SourceCatalog", dimensions=("Tract", "Patch", "AbstractFilter", "SkyMap") ) doc="Template catalogs produced by multiband deblending", nameTemplate="{outputCoaddName}Coadd_deblendedModel", storageClass="SourceCatalog", dimensions=("Tract", "Patch", "AbstractFilter", "SkyMap") )
super().setDefaults() self.quantum.dimensions = ("Tract", "Patch", "SkyMap")
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()
return {"outputSchema": afwTable.SourceCatalog(self.schema)}
packedId, maxBits = butler.registry.packDataId("TractPatch", inputDataIds["mergedDetections"], returnMaxBits=True) inputData["idFactory"] = afwTable.IdFactory.makeSource(packedId, 64 - maxBits) return self.run(**inputData)
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)
sources = self._makeSourceCatalog(mergedDetections, idFactory) self.singleBandDeblend.run(coadd, sources) return Struct(measureCatalog=sources)
super().__init__(initInputs=initInputs, **kwargs) self.makeSubtask("multibandDeblend", schema=self.schema, peakSchema=self.peakSchema)
def getOutputDatasetTypes(cls, config): outputTypeDict = super().getOutputDatasetTypes(config) # If Conserve flux is set to false, remove that catalog as a possible output if not config.multibandDeblend.conserveFlux: outputTypeDict.pop("fluxCatalogs", None) return outputTypeDict
inputData["filters"] = [dId["abstract_filter"] for dId in inputDataIds["coadds"]] return super().adaptArgsAndRun(inputData, inputDataIds, outputDataIds, butler)
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 |