LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
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

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__()

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
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33

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 
def run(self, coaddExposures, bbox, wcs)
Definition: getTemplate.py:603
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 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: