lsst.meas.base  13.0-20-g03c8adc+4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
plugins.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # LSST Data Management System
4 # Copyright 2008-2016 AURA/LSST.
5 #
6 # This product includes software developed by the
7 # LSST Project (http://www.lsst.org/).
8 #
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the LSST License Statement and
20 # the GNU General Public License along with this program. If not,
21 # see <http://www.lsstcorp.org/LegalNotices/>.
22 #
23 """
24 Definitions and registration of pure-Python plugins with trivial implementations,
25 and automatic plugin-from-algorithm calls for those implemented in C++.
26 """
27 import numpy
28 
29 import lsst.pex.exceptions
30 import lsst.afw.detection
31 import lsst.afw.geom
32 
33 from .pluginRegistry import register
34 from .pluginsBase import BasePlugin
35 from .sfm import SingleFramePluginConfig, SingleFramePlugin
36 from .forcedMeasurement import ForcedPluginConfig, ForcedPlugin
37 from .wrappers import wrapSimpleAlgorithm, wrapTransform
38 from .transforms import SimpleCentroidTransform
39 
40 from .apertureFlux import ApertureFluxControl, ApertureFluxTransform
41 from .transform import BaseTransform
42 from .blendedness import BlendednessAlgorithm, BlendednessControl
43 from .circularApertureFlux import CircularApertureFluxAlgorithm
44 from .gaussianCentroid import GaussianCentroidAlgorithm, GaussianCentroidControl, GaussianCentroidTransform
45 from .gaussianFlux import GaussianFluxAlgorithm, GaussianFluxControl, GaussianFluxTransform
46 from .exceptions import MeasurementError
47 from .naiveCentroid import NaiveCentroidAlgorithm, NaiveCentroidControl, NaiveCentroidTransform
48 from .peakLikelihoodFlux import PeakLikelihoodFluxAlgorithm, PeakLikelihoodFluxControl, PeakLikelihoodFluxTransform
49 from .pixelFlags import PixelFlagsAlgorithm, PixelFlagsControl
50 from .psfFlux import PsfFluxAlgorithm, PsfFluxControl, PsfFluxTransform
51 from .scaledApertureFlux import ScaledApertureFluxAlgorithm, ScaledApertureFluxControl, ScaledApertureFluxTransform
52 from .sdssCentroid import SdssCentroidAlgorithm, SdssCentroidControl, SdssCentroidTransform
53 from .sdssShape import SdssShapeAlgorithm, SdssShapeControl, SdssShapeTransform
54 
55 __all__ = (
56  "SingleFrameFPPositionConfig", "SingleFrameFPPositionPlugin",
57  "SingleFrameJacobianConfig", "SingleFrameJacobianPlugin",
58  "SingleFrameVarianceConfig", "SingleFrameVariancePlugin",
59  "SingleFrameInputCountConfig", "SingleFrameInputCountPlugin",
60  "SingleFramePeakCentroidConfig", "SingleFramePeakCentroidPlugin",
61  "SingleFrameSkyCoordConfig", "SingleFrameSkyCoordPlugin",
62  "ForcedPeakCentroidConfig", "ForcedPeakCentroidPlugin",
63  "ForcedTransformedCentroidConfig", "ForcedTransformedCentroidPlugin",
64  "ForcedTransformedShapeConfig", "ForcedTransformedShapePlugin",
65 )
66 
67 # --- Wrapped C++ Plugins ---
68 
69 wrapSimpleAlgorithm(PsfFluxAlgorithm, Control=PsfFluxControl,
70  TransformClass=PsfFluxTransform, executionOrder=BasePlugin.FLUX_ORDER,
71  shouldApCorr=True, hasLogName=True)
72 wrapSimpleAlgorithm(PeakLikelihoodFluxAlgorithm, Control=PeakLikelihoodFluxControl,
73  TransformClass=PeakLikelihoodFluxTransform, executionOrder=BasePlugin.FLUX_ORDER)
74 wrapSimpleAlgorithm(GaussianFluxAlgorithm, Control=GaussianFluxControl,
75  TransformClass=GaussianFluxTransform, executionOrder=BasePlugin.FLUX_ORDER,
76  shouldApCorr=True)
77 wrapSimpleAlgorithm(GaussianCentroidAlgorithm, Control=GaussianCentroidControl,
78  TransformClass=GaussianCentroidTransform, executionOrder=BasePlugin.CENTROID_ORDER)
79 wrapSimpleAlgorithm(NaiveCentroidAlgorithm, Control=NaiveCentroidControl,
80  TransformClass=NaiveCentroidTransform, executionOrder=BasePlugin.CENTROID_ORDER)
81 wrapSimpleAlgorithm(SdssCentroidAlgorithm, Control=SdssCentroidControl,
82  TransformClass=SdssCentroidTransform, executionOrder=BasePlugin.CENTROID_ORDER)
83 wrapSimpleAlgorithm(PixelFlagsAlgorithm, Control=PixelFlagsControl,
84  executionOrder=BasePlugin.FLUX_ORDER)
85 wrapSimpleAlgorithm(SdssShapeAlgorithm, Control=SdssShapeControl,
86  TransformClass=SdssShapeTransform, executionOrder=BasePlugin.SHAPE_ORDER)
87 wrapSimpleAlgorithm(ScaledApertureFluxAlgorithm, Control=ScaledApertureFluxControl,
88  TransformClass=ScaledApertureFluxTransform, executionOrder=BasePlugin.FLUX_ORDER)
89 
90 wrapSimpleAlgorithm(CircularApertureFluxAlgorithm, needsMetadata=True, Control=ApertureFluxControl,
91  TransformClass=ApertureFluxTransform, executionOrder=BasePlugin.FLUX_ORDER)
92 wrapSimpleAlgorithm(BlendednessAlgorithm, Control=BlendednessControl,
93  TransformClass=BaseTransform, executionOrder=BasePlugin.SHAPE_ORDER)
94 
95 wrapTransform(PsfFluxTransform)
96 wrapTransform(PeakLikelihoodFluxTransform)
97 wrapTransform(GaussianFluxTransform)
98 wrapTransform(GaussianCentroidTransform)
99 wrapTransform(NaiveCentroidTransform)
100 wrapTransform(SdssCentroidTransform)
101 wrapTransform(SdssShapeTransform)
102 wrapTransform(ScaledApertureFluxTransform)
103 wrapTransform(ApertureFluxTransform)
104 
105 # --- Single-Frame Measurement Plugins ---
106 
107 
108 class SingleFrameFPPositionConfig(SingleFramePluginConfig):
109  pass
110 
111 
112 @register("base_FPPosition")
113 class SingleFrameFPPositionPlugin(SingleFramePlugin):
114  '''
115  Algorithm to calculate the position of a centroid on the focal plane
116  '''
117 
118  ConfigClass = SingleFrameFPPositionConfig
119 
120  @classmethod
122  return cls.SHAPE_ORDER
123 
124  def __init__(self, config, name, schema, metadata):
125  SingleFramePlugin.__init__(self, config, name, schema, metadata)
126  self.focalValue = lsst.afw.table.Point2DKey.addFields(schema, name, "Position on the focal plane",
127  "mm")
128  self.focalFlag = schema.addField(name + "_flag", type="Flag", doc="Set to True for any fatal failure")
129  self.detectorFlag = schema.addField(name + "_missingDetector_flag", type="Flag",
130  doc="Set to True if detector object is missing")
131 
132  def measure(self, measRecord, exposure):
133  det = exposure.getDetector()
134  if not det:
135  measRecord.set(self.detectorFlag, True)
136  fp = lsst.afw.geom.Point2D(numpy.nan, numpy.nan)
137  else:
138  center = measRecord.getCentroid()
139  posInPix = det.makeCameraPoint(center, lsst.afw.cameraGeom.PIXELS)
140  fp = det.transform(posInPix, lsst.afw.cameraGeom.FOCAL_PLANE).getPoint()
141  measRecord.set(self.focalValue, fp)
142 
143  def fail(self, measRecord, error=None):
144  measRecord.set(self.focalFlag, True)
145 
146 
147 class SingleFrameJacobianConfig(SingleFramePluginConfig):
148  pixelScale = lsst.pex.config.Field(dtype=float, default=0.5, doc="Nominal pixel size (arcsec)")
149 
150 
151 @register("base_Jacobian")
152 class SingleFrameJacobianPlugin(SingleFramePlugin):
153  '''
154  Algorithm which computes the Jacobian about a source and computes its ratio with a nominal pixel area.
155  This allows one to compare relative instead of absolute areas of pixels.
156  '''
157 
158  ConfigClass = SingleFrameJacobianConfig
159 
160  @classmethod
162  return cls.SHAPE_ORDER
163 
164  def __init__(self, config, name, schema, metadata):
165  SingleFramePlugin.__init__(self, config, name, schema, metadata)
166  self.jacValue = schema.addField(name + '_value', type="D", doc="Jacobian correction")
167  self.jacFlag = schema.addField(name + '_flag', type="Flag", doc="Set to 1 for any fatal failure")
168  # Calculate one over the area of a nominal reference pixel
169  self.scale = pow(self.config.pixelScale, -2)
170 
171  def measure(self, measRecord, exposure):
172  center = measRecord.getCentroid()
173  # Compute the area of a pixel at the center of a source records centroid, and take the
174  # ratio of that with the defined reference pixel area.
175  result = numpy.abs(self.scale*exposure.getWcs().linearizePixelToSky(
176  center,
177  lsst.afw.geom.arcseconds).getLinear().computeDeterminant())
178  measRecord.set(self.jacValue, result)
179 
180  def fail(self, measRecord, error=None):
181  measRecord.set(self.jacFlag, True)
182 
183 
184 class SingleFrameVarianceConfig(SingleFramePluginConfig):
185  scale = lsst.pex.config.Field(dtype=float, default=5.0, optional=True,
186  doc="Scale factor to apply to shape for aperture")
187  mask = lsst.pex.config.ListField(doc="Mask planes to ignore", dtype=str,
188  default=["DETECTED", "DETECTED_NEGATIVE", "BAD", "SAT"])
189 
190 
191 @register("base_Variance")
192 class SingleFrameVariancePlugin(SingleFramePlugin):
193  '''
194  Calculate the median variance within a Footprint scaled from the object shape so
195  the value is not terribly influenced by the object and instead represents the
196  variance in the background near the object.
197  '''
198  ConfigClass = SingleFrameVarianceConfig
199  FAILURE_BAD_CENTROID = 1
200  FAILURE_EMPTY_FOOTPRINT = 2
201 
202  @classmethod
204  return cls.FLUX_ORDER
205 
206  def __init__(self, config, name, schema, metadata):
207  SingleFramePlugin.__init__(self, config, name, schema, metadata)
208  self.varValue = schema.addField(name + '_value', type="D", doc="Variance at object position")
209  self.varFlag = schema.addField(name + '_flag', type="Flag", doc="Set to True for any fatal failure")
210  self.emptyFootprintFlag = schema.addField(name + '_flag_emptyFootprint', type="Flag",
211  doc="Set to True when the footprint has no usable pixels")
212 
213  # Alias the badCentroid flag to that which is defined for the target of the centroid slot.
214  # We do not simply rely on the alias because that could be changed post-measurement.
215  schema.getAliasMap().set(name + '_flag_badCentroid', schema.getAliasMap().apply("slot_Centroid_flag"))
216 
217  def measure(self, measRecord, exposure):
218  if measRecord.getCentroidFlag():
219  raise MeasurementError("Source record has a bad centroid.", self.FAILURE_BAD_CENTROID)
220  # Create an aperture and grow it by scale value defined in config to ensure there are enough
221  # pixels around the object to get decent statistics
222  aperture = lsst.afw.geom.ellipses.Ellipse(measRecord.getShape(), measRecord.getCentroid())
223  aperture.scale(self.config.scale)
224  ellipse = lsst.afw.geom.SpanSet.fromShape(aperture)
225  foot = lsst.afw.detection.Footprint(ellipse)
226  foot.clipTo(exposure.getBBox(lsst.afw.image.PARENT))
227  # Filter out any pixels which have mask bits set corresponding to the planes to be excluded
228  # (defined in config.mask)
229  maskedImage = exposure.getMaskedImage()
230  pixels = lsst.afw.detection.makeHeavyFootprint(foot, maskedImage)
231  maskBits = maskedImage.getMask().getPlaneBitMask(self.config.mask)
232  logicalMask = numpy.logical_not(pixels.getMaskArray() & maskBits)
233  # Compute the median variance value for each pixel not excluded by the mask and write the record.
234  # Numpy median is used here instead of afw.math makeStatistics because of an issue with data types
235  # being passed into the C++ layer (DM-2379).
236  if numpy.any(logicalMask):
237  medVar = numpy.median(pixels.getVarianceArray()[logicalMask])
238  measRecord.set(self.varValue, medVar)
239  else:
240  raise MeasurementError("Footprint empty, or all pixels are masked, can't compute median",
242 
243  def fail(self, measRecord, error=None):
244  # Check that we have a error object and that it is of type MeasurementError
245  if isinstance(error, MeasurementError):
246  assert error.getFlagBit() in (self.FAILURE_BAD_CENTROID, self.FAILURE_EMPTY_FOOTPRINT)
247  # FAILURE_BAD_CENTROID handled by alias to centroid record.
248  if error.getFlagBit() == self.FAILURE_EMPTY_FOOTPRINT:
249  measRecord.set(self.emptyFootprintFlag, True)
250  measRecord.set(self.varValue, numpy.nan)
251  measRecord.set(self.varFlag, True)
252 
253 
254 class SingleFrameInputCountConfig(SingleFramePluginConfig):
255  pass
256 
257 
258 @register("base_InputCount")
259 class SingleFrameInputCountPlugin(SingleFramePlugin):
260  """
261  Plugin to count how many input images contributed to each source. This information
262  is in the exposure's coaddInputs. Some limitations:
263  * This is only for the pixel containing the center, not for all the pixels in the
264  Footprint
265  * This does not account for any clipping in the coadd
266  """
267 
268  ConfigClass = SingleFrameInputCountConfig
269  FAILURE_BAD_CENTROID = 1
270  FAILURE_NO_INPUTS = 2
271 
272  @classmethod
274  return cls.SHAPE_ORDER
275 
276  def __init__(self, config, name, schema, metadata):
277  SingleFramePlugin.__init__(self, config, name, schema, metadata)
278  self.numberKey = schema.addField(name + '_value', type="I",
279  doc="Number of images contributing at center, not including any"
280  "clipping")
281  self.numberFlag = schema.addField(name + '_flag', type="Flag", doc="Set to True for fatal failure")
282  self.noInputsFlag = schema.addField(name + '_flag_noInputs', type="Flag",
283  doc="No coadd inputs available")
284  # Alias the badCentroid flag to that which is defined for the target of the centroid slot.
285  # We do not simply rely on the alias because that could be changed post-measurement.
286  schema.getAliasMap().set(name + '_flag_badCentroid', schema.getAliasMap().apply("slot_Centroid_flag"))
287 
288  def measure(self, measRecord, exposure):
289  if not exposure.getInfo().getCoaddInputs():
290  raise MeasurementError("No coadd inputs defined.", self.FAILURE_NO_INPUTS)
291  if measRecord.getCentroidFlag():
292  raise MeasurementError("Source has a bad centroid.", self.FAILURE_BAD_CENTROID)
293 
294  center = measRecord.getCentroid()
295  ccds = exposure.getInfo().getCoaddInputs().ccds
296  measRecord.set(self.numberKey, len(ccds.subsetContaining(center, exposure.getWcs())))
297 
298  def fail(self, measRecord, error=None):
299  measRecord.set(self.numberFlag, True)
300  if error is not None:
301  assert error.getFlagBit() in (self.FAILURE_BAD_CENTROID, self.FAILURE_NO_INPUTS)
302  # FAILURE_BAD_CENTROID handled by alias to centroid record.
303  if error.getFlagBit() == self.FAILURE_NO_INPUTS:
304  measRecord.set(self.noInputsFlag, True)
305 
306 
307 class SingleFramePeakCentroidConfig(SingleFramePluginConfig):
308  pass
309 
310 
311 @register("base_PeakCentroid")
312 class SingleFramePeakCentroidPlugin(SingleFramePlugin):
313  """
314  A centroid algorithm that simply uses the first (i.e. highest) Peak in the Source's
315  Footprint as the centroid. This is of course a relatively poor measure of the true
316  centroid of the object; this algorithm is provided mostly for testing and debugging.
317  """
318 
319  ConfigClass = SingleFramePeakCentroidConfig
320 
321  @classmethod
323  return cls.CENTROID_ORDER
324 
325  def __init__(self, config, name, schema, metadata):
326  SingleFramePlugin.__init__(self, config, name, schema, metadata)
327  self.keyX = schema.addField(name + "_x", type="D", doc="peak centroid", units="pixel")
328  self.keyY = schema.addField(name + "_y", type="D", doc="peak centroid", units="pixel")
329  self.flag = schema.addField(name + "_flag", type="Flag", doc="Centroiding failed")
330 
331  def measure(self, measRecord, exposure):
332  peak = measRecord.getFootprint().getPeaks()[0]
333  measRecord.set(self.keyX, peak.getFx())
334  measRecord.set(self.keyY, peak.getFy())
335 
336  def fail(self, measRecord, error=None):
337  measRecord.set(self.flag, True)
338 
339  @staticmethod
341  return SimpleCentroidTransform
342 
343 
344 class SingleFrameSkyCoordConfig(SingleFramePluginConfig):
345  pass
346 
347 
348 @register("base_SkyCoord")
349 class SingleFrameSkyCoordPlugin(SingleFramePlugin):
350  """
351  A measurement plugin that sets the "coord" field (part of the Source minimal schema)
352  using the slot centroid and the Wcs attached to the Exposure.
353  """
354 
355  ConfigClass = SingleFrameSkyCoordConfig
356 
357  @classmethod
359  return cls.SHAPE_ORDER
360 
361  def measure(self, measRecord, exposure):
362  # there should be a base class method for handling this exception. Put this on a later ticket
363  # Also, there should be a python Exception of the appropriate type for this error
364  if not exposure.hasWcs():
365  raise Exception("Wcs not attached to exposure. Required for " + self.name + " algorithm")
366  measRecord.updateCoord(exposure.getWcs())
367 
368  def fail(self, measRecord, error=None):
369  # Override fail() to do nothing in the case of an exception: this is not ideal,
370  # but we don't have a place to put failures because we don't allocate any fields.
371  # Should consider fixing as part of DM-1011
372  pass
373 
374 
375 # --- Forced Plugins ---
376 
377 class ForcedPeakCentroidConfig(ForcedPluginConfig):
378  pass
379 
380 
381 @register("base_PeakCentroid")
382 class ForcedPeakCentroidPlugin(ForcedPlugin):
383  """
384  The forced peak centroid is like the SFM peak centroid plugin, except that it must transform
385  the peak coordinate from the original (reference) coordinate system to the coordinate system
386  of the exposure being measured.
387  """
388 
389  ConfigClass = ForcedPeakCentroidConfig
390 
391  @classmethod
393  return cls.CENTROID_ORDER
394 
395  def __init__(self, config, name, schemaMapper, metadata):
396  ForcedPlugin.__init__(self, config, name, schemaMapper, metadata)
397  schema = schemaMapper.editOutputSchema()
398  self.keyX = schema.addField(name + "_x", type="D", doc="peak centroid", units="pixel")
399  self.keyY = schema.addField(name + "_y", type="D", doc="peak centroid", units="pixel")
400 
401  def measure(self, measRecord, exposure, refRecord, refWcs):
402  targetWcs = exposure.getWcs()
403  peak = refRecord.getFootprint().getPeaks()[0]
404  result = lsst.afw.geom.Point2D(peak.getFx(), peak.getFy())
405  if not refWcs == targetWcs:
406  result = targetWcs.skyToPixel(refWcs.pixelToSky(result))
407  measRecord.set(self.keyX, result.getX())
408  measRecord.set(self.keyY, result.getY())
409 
410  @staticmethod
412  return SimpleCentroidTransform
413 
414 
415 class ForcedTransformedCentroidConfig(ForcedPluginConfig):
416  pass
417 
418 
419 @register("base_TransformedCentroid")
421  """A centroid pseudo-algorithm for forced measurement that simply transforms the centroid
422  from the reference catalog to the measurement coordinate system. This is used as
423  the slot centroid by default in forced measurement, allowing subsequent measurements
424  to simply refer to the slot value just as they would in single-frame measurement.
425  """
426 
427  ConfigClass = ForcedTransformedCentroidConfig
428 
429  @classmethod
431  return cls.CENTROID_ORDER
432 
433  def __init__(self, config, name, schemaMapper, metadata):
434  ForcedPlugin.__init__(self, config, name, schemaMapper, metadata)
435  schema = schemaMapper.editOutputSchema()
436  # Allocate x and y fields, join these into a single FunctorKey for ease-of-use.
437  xKey = schema.addField(name + "_x", type="D", doc="transformed reference centroid column",
438  units="pixel")
439  yKey = schema.addField(name + "_y", type="D", doc="transformed reference centroid row",
440  units="pixel")
441  self.centroidKey = lsst.afw.table.Point2DKey(xKey, yKey)
442  # Because we're taking the reference position as given, we don't bother transforming its
443  # uncertainty and reporting that here, so there are no sigma or cov fields. We do propagate
444  # the flag field, if it exists.
445  if "slot_Centroid_flag" in schemaMapper.getInputSchema():
446  self.flagKey = schema.addField(name + "_flag", type="Flag",
447  doc="whether the reference centroid is marked as bad")
448  else:
449  self.flagKey = None
450 
451  def measure(self, measRecord, exposure, refRecord, refWcs):
452  targetWcs = exposure.getWcs()
453  if not refWcs == targetWcs:
454  targetPos = targetWcs.skyToPixel(refWcs.pixelToSky(refRecord.getCentroid()))
455  measRecord.set(self.centroidKey, targetPos)
456  else:
457  measRecord.set(self.centroidKey, refRecord.getCentroid())
458  if self.flagKey is not None:
459  measRecord.set(self.flagKey, refRecord.getCentroidFlag())
460 
461 
462 class ForcedTransformedShapeConfig(ForcedPluginConfig):
463  pass
464 
465 
466 @register("base_TransformedShape")
467 class ForcedTransformedShapePlugin(ForcedPlugin):
468  """A shape pseudo-algorithm for forced measurement that simply transforms the shape
469  from the reference catalog to the measurement coordinate system. This is used as
470  the slot shape by default in forced measurement, allowing subsequent measurements
471  to simply refer to the slot value just as they would in single-frame measurement.
472  """
473 
474  ConfigClass = ForcedTransformedShapeConfig
475 
476  @classmethod
478  return cls.SHAPE_ORDER
479 
480  def __init__(self, config, name, schemaMapper, metadata):
481  ForcedPlugin.__init__(self, config, name, schemaMapper, metadata)
482  schema = schemaMapper.editOutputSchema()
483  # Allocate xx, yy, xy fields, join these into a single FunctorKey for ease-of-use.
484  xxKey = schema.addField(name + "_xx", type="D", doc="transformed reference shape x^2 moment",
485  units="pixel^2")
486  yyKey = schema.addField(name + "_yy", type="D", doc="transformed reference shape y^2 moment",
487  units="pixel^2")
488  xyKey = schema.addField(name + "_xy", type="D", doc="transformed reference shape xy moment",
489  units="pixel^2")
490  self.shapeKey = lsst.afw.table.QuadrupoleKey(xxKey, yyKey, xyKey)
491  # Because we're taking the reference position as given, we don't bother transforming its
492  # uncertainty and reporting that here, so there are no sigma or cov fields. We do propagate
493  # the flag field, if it exists.
494  if "slot_Shape_flag" in schemaMapper.getInputSchema():
495  self.flagKey = schema.addField(name + "_flag", type="Flag",
496  doc="whether the reference shape is marked as bad")
497  else:
498  self.flagKey = None
499 
500  def measure(self, measRecord, exposure, refRecord, refWcs):
501  targetWcs = exposure.getWcs()
502  if not refWcs == targetWcs:
503  fullTransform = lsst.afw.image.XYTransformFromWcsPair(targetWcs, refWcs)
504  localTransform = fullTransform.linearizeForwardTransform(refRecord.getCentroid())
505  measRecord.set(self.shapeKey, refRecord.getShape().transform(localTransform.getLinear()))
506  else:
507  measRecord.set(self.shapeKey, refRecord.getShape())
508  if self.flagKey is not None:
509  measRecord.set(self.flagKey, refRecord.getShapeFlag())
def register
A Python decorator that registers a class, using the given name, in its base class&#39;s PluginRegistry...
def wrapSimpleAlgorithm
Wrap a C++ SimpleAlgorithm class into both a Python SingleFramePlugin and ForcedPlugin classes...
Definition: wrappers.py:352