LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes | List of all members
lsst.pipe.tasks.transformMeasurement.TransformTask Class Reference

Transform a SourceCatalog containing raw measurements to calibrated form. More...

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

Public Member Functions

def __init__
 Initialize TransformTask. More...
 
def getSchemaCatalogs
 Return a dict containing an empty catalog representative of this task's output. More...
 
def run
 Transform raw source measurements to calibrated quantities. More...
 

Public Attributes

 outputDataset
 
 mapper
 
 transforms
 

Static Public Attributes

 ConfigClass = TransformConfig
 

Static Private Attributes

string _DefaultName = "transform"
 

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

Initialize TransformTask.

Parameters
[in]measConfigConfiguration for the measurement task which produced the measurments being transformed.
[in]inputSchemaThe schema of the input catalog.
[in]outputDatasetThe butler dataset type of the output catalog.
[in]*argsPassed through to pipeBase.Task.__init__()
[in]*kwargsPassed through to pipeBase.Task.__init__()

Task invocation

Transform raw source measurements to calibrated quantities.

Parameters
[in]inputCatSourceCatalog of sources to transform.
[in]wcsThe world coordinate system under which transformations will take place.
[in]calibThe calibration under which transformations will take place.
Returns
A BaseCatalog containing the transformed measurements.

Definition at line 54 of file transformMeasurement.py.

Constructor & Destructor Documentation

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

Initialize TransformTask.

Parameters
[in]measConfigConfiguration for the measurement task which produced the measurments being transformed.
[in]inputSchemaThe schema of the input catalog.
[in]outputDatasetThe butler dataset type of the output catalog.
[in]*argsPassed through to pipeBase.Task.__init__()
[in]*kwargsPassed through to pipeBase.Task.__init__()

Definition at line 97 of file transformMeasurement.py.

97 
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))
A mapping between the keys of two Schemas, used to copy data between them.
Definition: SchemaMapper.h:19

Member Function Documentation

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

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

Definition at line 126 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}
A custom container class for records, based on std::vector.
Definition: Catalog.h:94
def getSchemaCatalogs
Return a dict containing an empty catalog representative of this task's output.
def lsst.pipe.tasks.transformMeasurement.TransformTask.run (   self,
  inputCat,
  wcs,
  calib 
)

Transform raw source measurements to calibrated quantities.

Parameters
[in]inputCatSourceCatalog of sources to transform.
[in]wcsThe world coordinate system under which transformations will take place.
[in]calibThe calibration under which transformations will take place.
Returns
A BaseCatalog containing the transformed measurements.

Definition at line 131 of file transformMeasurement.py.

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

Member Data Documentation

string lsst.pipe.tasks.transformMeasurement.TransformTask._DefaultName = "transform"
staticprivate

Definition at line 95 of file transformMeasurement.py.

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

Definition at line 94 of file transformMeasurement.py.

lsst.pipe.tasks.transformMeasurement.TransformTask.mapper

Definition at line 114 of file transformMeasurement.py.

lsst.pipe.tasks.transformMeasurement.TransformTask.outputDataset

Definition at line 111 of file transformMeasurement.py.

lsst.pipe.tasks.transformMeasurement.TransformTask.transforms

Definition at line 120 of file transformMeasurement.py.


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