LSSTApplications  16.0-10-g9d3e444,16.0-11-g09ed895+3,16.0-11-g12e47bd+5,16.0-12-g5c924a4+12,16.0-12-g71e5ef5+1,16.0-15-g7af1f30,16.0-15-gdd5ca33+2,16.0-16-gf0259e2+1,16.0-17-g5cf0468+5,16.0-18-ga4d4bcb+7,16.0-18-gcf94535+4,16.0-18-geff7d6b+1,16.0-19-g9d290d5+4,16.0-2-g0febb12+22,16.0-2-g9d5294e+73,16.0-2-ga8830df+7,16.0-20-gec02d88,16.0-22-gf55172b7,16.0-28-g0a7b887,16.0-28-gfc9ea6c+11,16.0-29-ge8801f9+5,16.0-3-ge00e371+40,16.0-4-g18f3627+17,16.0-4-g5f3a788+21,16.0-4-ga3eb747+11,16.0-4-gabf74b7+35,16.0-4-gb13d127+7,16.0-5-g27fb78a+13,16.0-5-g6a53317+40,16.0-5-gb3f8a4b+93,16.0-53-ga4affb86,16.0-6-g9321be7+5,16.0-6-gcbc7b31+49,16.0-6-gf49912c+35,16.0-75-gbf7a9a820,16.0-8-g21fd5fe+36,16.0-8-g3a9f023+24,16.0-8-gc11f1cf+2,16.0-9-gf3bc169+3,16.0-9-gf5c1f43+12,master-gc237143d49+1,w.2019.03
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | Static Public 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__ (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, calib)
 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

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

◆ __init__()

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

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 126 of file transformMeasurement.py.

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

◆ run()

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.

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

Member Data Documentation

◆ ConfigClass

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

Definition at line 94 of file transformMeasurement.py.

◆ mapper

lsst.pipe.tasks.transformMeasurement.TransformTask.mapper

Definition at line 114 of file transformMeasurement.py.

◆ outputDataset

lsst.pipe.tasks.transformMeasurement.TransformTask.outputDataset

Definition at line 111 of file transformMeasurement.py.

◆ transforms

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: