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 | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.base.baseMeasurement.BasePlugin Class Reference

Base class for measurement plugins. More...

Inheritance diagram for lsst.meas.base.baseMeasurement.BasePlugin:

Public Member Functions

def getExecutionOrder
 
def __init__
 Initialize the measurement object. More...
 
def fail
 Record a failure of the measure or measureN() method. More...
 

Static Public Member Functions

def getTransformClass
 Get the measurement transformation appropriate to this plugin. More...
 

Public Attributes

 config
 
 name
 

Static Public Attributes

float CENTROID_ORDER = 0.0
 
float SHAPE_ORDER = 1.0
 
float FLUX_ORDER = 2.0
 
float APCORR_ORDER = 4.0
 
float CLASSIFY_ORDER = 5.0
 

Detailed Description

Base class for measurement plugins.

This is the base class for SingleFramePlugin and ForcedPlugin; derived classes should inherit from one of those.

Definition at line 58 of file baseMeasurement.py.

Constructor & Destructor Documentation

def lsst.meas.base.baseMeasurement.BasePlugin.__init__ (   self,
  config,
  name 
)

Initialize the measurement object.

Parameters
[in]configAn instance of this class's ConfigClass.
[in]nameThe string the plugin was registered with.

Definition at line 96 of file baseMeasurement.py.

96 
97  def __init__(self, config, name):
98  """!
99  Initialize the measurement object.
100 
101  @param[in] config An instance of this class's ConfigClass.
102  @param[in] name The string the plugin was registered with.
103  """
104  object.__init__(self)
105  self.config = config
106  self.name = name
def __init__
Initialize the measurement object.

Member Function Documentation

def lsst.meas.base.baseMeasurement.BasePlugin.fail (   self,
  measRecord,
  error = None 
)

Record a failure of the measure or measureN() method.

When measure() raises an exception, the measurement framework will call fail() to allow the plugin to set its failure flag field(s). When measureN() raises an exception, fail() will be called repeatedly with all the records that were being measured.

If the exception is a MeasurementError, it will be passed as the error argument; in all other cases the error argument will be None, and the failure will be logged by the measurement framework as a warning.

Definition at line 107 of file baseMeasurement.py.

108  def fail(self, measRecord, error=None):
109  """!
110  Record a failure of the measure or measureN() method.
111 
112  When measure() raises an exception, the measurement framework
113  will call fail() to allow the plugin to set its failure flag
114  field(s). When measureN() raises an exception, fail() will be
115  called repeatedly with all the records that were being
116  measured.
117 
118  If the exception is a MeasurementError, it will be passed as
119  the error argument; in all other cases the error argument will
120  be None, and the failure will be logged by the measurement
121  framework as a warning.
122  """
123  traceback.print_exc()
124  message = ("The algorithm '%s' thinks it cannot fail, but it did; "
125  "please report this as a bug (the full traceback is above)."
126  % self.__class__.__name__)
127  raise NotImplementedError(message)
def fail
Record a failure of the measure or measureN() method.
def lsst.meas.base.baseMeasurement.BasePlugin.getExecutionOrder (   cls)
Sets the relative order of plugins (smaller numbers run first).

In general, the following class constants should be used (other values
are also allowed, but should be avoided unless they are needed):
CENTROID_ORDER  centroids and other algorithms that require only a Footprint and its Peaks as input
SHAPE_ORDER     shape measurements and other algorithms that require getCentroid() to return
        a good centroid (in addition to a Footprint and its Peaks).
FLUX_ORDER      flux algorithms that require both getShape() and getCentroid(),
        in addition to a Footprint and its Peaks
APCORR_ORDER    aperture corrections
CLASSIFY_ORDER  algorithms that operate on aperture-corrected fluxes

Must be reimplemented as a class method by concrete derived classes.

This approach was chosen instead of a full graph-based analysis of dependencies
because algorithm dependencies are usually both quite simple and entirely substitutable:
an algorithm that requires a centroid can typically make use of any centroid algorithms
outputs.  That makes it relatively easy to figure out the correct value to use for any
particular algorithm.

Definition at line 73 of file baseMeasurement.py.

73 
74  def getExecutionOrder(cls):
75  """Sets the relative order of plugins (smaller numbers run first).
76 
77  In general, the following class constants should be used (other values
78  are also allowed, but should be avoided unless they are needed):
79  CENTROID_ORDER centroids and other algorithms that require only a Footprint and its Peaks as input
80  SHAPE_ORDER shape measurements and other algorithms that require getCentroid() to return
81  a good centroid (in addition to a Footprint and its Peaks).
82  FLUX_ORDER flux algorithms that require both getShape() and getCentroid(),
83  in addition to a Footprint and its Peaks
84  APCORR_ORDER aperture corrections
85  CLASSIFY_ORDER algorithms that operate on aperture-corrected fluxes
86 
87  Must be reimplemented as a class method by concrete derived classes.
88 
89  This approach was chosen instead of a full graph-based analysis of dependencies
90  because algorithm dependencies are usually both quite simple and entirely substitutable:
91  an algorithm that requires a centroid can typically make use of any centroid algorithms
92  outputs. That makes it relatively easy to figure out the correct value to use for any
93  particular algorithm.
94  """
95  raise NotImplementedError("All plugins must implement getExecutionOrder()")
def lsst.meas.base.baseMeasurement.BasePlugin.getTransformClass ( )
static

Get the measurement transformation appropriate to this plugin.

This returns a subclass of MeasurementTransform, which may be instantiated with details of the algorithm configuration and then called with information about calibration and WCS to convert from raw measurement quantities to calibrated units. Calibrated data is then provided in a separate output table.

By default, we copy everything from the input to the output without transformation.

Definition at line 129 of file baseMeasurement.py.

130  def getTransformClass():
131  """!
132  Get the measurement transformation appropriate to this plugin.
133 
134  This returns a subclass of MeasurementTransform, which may be
135  instantiated with details of the algorithm configuration and then
136  called with information about calibration and WCS to convert from raw
137  measurement quantities to calibrated units. Calibrated data is then
138  provided in a separate output table.
139 
140  By default, we copy everything from the input to the output without
141  transformation.
142  """
143  return PassThroughTransform
144 
def getTransformClass
Get the measurement transformation appropriate to this plugin.

Member Data Documentation

float lsst.meas.base.baseMeasurement.BasePlugin.APCORR_ORDER = 4.0
static

Definition at line 69 of file baseMeasurement.py.

float lsst.meas.base.baseMeasurement.BasePlugin.CENTROID_ORDER = 0.0
static

Definition at line 66 of file baseMeasurement.py.

float lsst.meas.base.baseMeasurement.BasePlugin.CLASSIFY_ORDER = 5.0
static

Definition at line 70 of file baseMeasurement.py.

lsst.meas.base.baseMeasurement.BasePlugin.config

Definition at line 104 of file baseMeasurement.py.

float lsst.meas.base.baseMeasurement.BasePlugin.FLUX_ORDER = 2.0
static

Definition at line 68 of file baseMeasurement.py.

lsst.meas.base.baseMeasurement.BasePlugin.name

Definition at line 105 of file baseMeasurement.py.

float lsst.meas.base.baseMeasurement.BasePlugin.SHAPE_ORDER = 1.0
static

Definition at line 67 of file baseMeasurement.py.


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