LSST Applications 24.1.0,g0b6bd0c080+e62dec11b2,g17e5ecfddb+2f99ec5bff,g1d67935e3f+aeba7d5376,g33b6a96d52+e24369602a,g38293774b4+ac198e9f13,g396055baef+a9fc9fe987,g3b44f30a73+6ed7a0bf37,g45a0052f0b+d5a0214cf8,g48ccf36440+89c08d0516,g5c4744a4d9+9e5e24d318,g6c8d09e9e7+60190443eb,g8b9e2231ea+b61c7debcc,g9c8be92ad0+d5a0214cf8,g9d27549199+9e5e24d318,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+8c170280cc,gaa63f70f4e+a45a85e39e,gabf319e997+a153293d79,gb22ebf5633+adf3385ca5,gbec6a3398f+aeba7d5376,gc75b51116a+846e1f9efd,gca4adeb000+d5a0214cf8,gd01420fc67+aeba7d5376,gd82bb2a289+52e0a19ca3,gd877ba84e5+aeba7d5376,gd95cd18b76+8a093cac5b,gdb4cecd868+a5301bf5a0,gecc7e12556+d5a0214cf8,gf14d0188e3+a153293d79,gf3ee170dca+60190443eb,gf4ac96e456+a153293d79,gf51b12da82+3612beda7c,gf8609944d8+9adb1d6802,gf9f5ea5b4d+ac198e9f13,gff490e6085+9d6cf01b2b
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.tasks.transformMeasurement.TransformTask Class Reference

More...

Inheritance diagram for lsst.pipe.tasks.transformMeasurement.TransformTask:

Public Member Functions

def __init__ (self, measConfig, inputSchema, outputDataset, *args, **kwargs)
 Initialize TransformTask. More...
 
def getSchemaCatalogs (self)
 Return a dict containing an empty catalog representative of this task's output. More...
 
def run (self, inputCat, wcs, photoCalib)
 Transform raw source measurements to calibrated quantities. More...
 

Public Attributes

 outputDataset
 
 mapper
 
 transforms
 

Static Public Attributes

 ConfigClass = TransformConfig
 

Detailed Description

Transform a SourceCatalog containing raw measurements to calibrated form.

Contents

Description

Given a set of measurement algorithms with their associated configuration, the table of source measurements they have produced, and information about an associated WCS and calibration, transform the raw measurement output to a calibrated form.

Transformations are defined on a per-measurement-plugin basis. In addition, a configurable set of fields may be simply copied from the input to the output catalog.

This task operates on an input SourceCatalog and returns a BaseCatalog containing the transformed results. It requires that the caller supply information on the configuration of the measurement task which produced the input data as well as the world coordinate system and calibration under which the transformation will take place. It provides no functionality for reading or writing data from a Butler: rather, per-dataset-type command line tasks are provided to obtain the appropriate information from a Butler (or elsewhere) and then delegate to this task.

Task initialization

Task invocation

Transform raw source measurements to calibrated quantities.

    @param[in] inputCat  SourceCatalog of sources to transform.
    @param[in] wcs       The world coordinate system under which transformations will take place.
    @param[in] photoCalib     The calibration under which transformations will take place.

    @return A BaseCatalog containing the transformed measurements.

Definition at line 55 of file transformMeasurement.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.transformMeasurement.TransformTask.__init__ (   self,
  measConfig,
  inputSchema,
  outputDataset,
args,
**  kwargs 
)

Initialize TransformTask.

    @param[in] measConfig      Configuration for the measurement task which
                               produced the measurments being transformed.
    @param[in] inputSchema     The schema of the input catalog.
    @param[in] outputDataset   The butler dataset type of the output catalog.
    @param[in] *args           Passed through to pipeBase.Task.__init__()
    @param[in] *kwargs         Passed through to pipeBase.Task.__init__()

Definition at line 98 of file transformMeasurement.py.

98 def __init__(self, measConfig, inputSchema, outputDataset, *args, **kwargs):
99 """!Initialize TransformTask.
100
101 @param[in] measConfig Configuration for the measurement task which
102 produced the measurments being transformed.
103 @param[in] inputSchema The schema of the input catalog.
104 @param[in] outputDataset The butler dataset type of the output catalog.
105 @param[in] *args Passed through to pipeBase.Task.__init__()
106 @param[in] *kwargs Passed through to pipeBase.Task.__init__()
107 """
108 pipeBase.Task.__init__(self, *args, **kwargs)
109
110 # This task can be used to generate multiple different output dataset types. We
111 # need to be able to specify the output type together with its schema.
112 self.outputDataset = outputDataset
113
114 # Define a mapper and add the basic fields to be copied.
115 self.mapper = afwTable.SchemaMapper(inputSchema)
116 for field in self.config.copyFields:
117 self.mapper.addMapping(inputSchema.find(field).key)
118
119 # Build a list of all transforms that will be applied to the input. We
120 # will iterate over this in run().
121 self.transforms = []
122 for name in measConfig.plugins.names:
123 config = measConfig.plugins.get(name)
124 transformClass = measConfig.plugins.registry.get(name).PluginClass.getTransformClass()
125 self.transforms.append(transformClass(config, name, self.mapper))
126
A mapping between the keys of two Schemas, used to copy data between them.
Definition: SchemaMapper.h:21

Member Function Documentation

◆ getSchemaCatalogs()

def lsst.pipe.tasks.transformMeasurement.TransformTask.getSchemaCatalogs (   self)

Return a dict containing an empty catalog representative of this task's output.

Definition at line 127 of file transformMeasurement.py.

127 def getSchemaCatalogs(self):
128 """!Return a dict containing an empty catalog representative of this task's output."""
129 transformedSrc = afwTable.BaseCatalog(self.mapper.getOutputSchema())
130 return {self.outputDataset: transformedSrc}
131

◆ run()

def lsst.pipe.tasks.transformMeasurement.TransformTask.run (   self,
  inputCat,
  wcs,
  photoCalib 
)

Transform raw source measurements to calibrated quantities.

    @param[in] inputCat  SourceCatalog of sources to transform.
    @param[in] wcs       The world coordinate system under which transformations will take place.
    @param[in] photoCalib     The calibration under which transformations will take place.

    @return A BaseCatalog containing the transformed measurements.

Definition at line 133 of file transformMeasurement.py.

133 def run(self, inputCat, wcs, photoCalib):
134 """!Transform raw source measurements to calibrated quantities.
135
136 @param[in] inputCat SourceCatalog of sources to transform.
137 @param[in] wcs The world coordinate system under which transformations will take place.
138 @param[in] photoCalib The calibration under which transformations will take place.
139
140 @return A BaseCatalog containing the transformed measurements.
141 """
142 outputCat = afwTable.BaseCatalog(self.mapper.getOutputSchema())
143 outputCat.extend(inputCat, mapper=self.mapper)
144
145 # Transforms may use a ColumnView on the input and output catalogs,
146 # which requires that the data be contiguous in memory.
147 inputCat = makeContiguous(inputCat)
148 outputCat = makeContiguous(outputCat)
149
150 for transform in self.transforms:
151 transform(inputCat, outputCat, wcs, photoCalib)
152 return outputCat
153
154

Member Data Documentation

◆ ConfigClass

lsst.pipe.tasks.transformMeasurement.TransformTask.ConfigClass = TransformConfig
static

Definition at line 95 of file transformMeasurement.py.

◆ mapper

lsst.pipe.tasks.transformMeasurement.TransformTask.mapper

Definition at line 115 of file transformMeasurement.py.

◆ outputDataset

lsst.pipe.tasks.transformMeasurement.TransformTask.outputDataset

Definition at line 112 of file transformMeasurement.py.

◆ transforms

lsst.pipe.tasks.transformMeasurement.TransformTask.transforms

Definition at line 121 of file transformMeasurement.py.


The documentation for this class was generated from the following file: