LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
Classes | Functions | Variables
lsst.meas.base.wrappers Namespace Reference

Classes

class  WrappedSingleFramePlugin
 
class  WrappedForcedPlugin
 

Functions

def wrapAlgorithmControl
 Wrap a C++ algorithm's control class into a Python Config class. More...
 
def wrapAlgorithm
 Wrap a C++ Algorithm class into a Python Plugin class. More...
 
def wrapSingleFrameAlgorithm
 Wrap a C++ SingleFrameAlgorithm class into a Python SingleFramePlugin class. More...
 
def wrapForcedAlgorithm
 Wrap a C++ ForcedAlgorithm class into a Python ForcedPlugin class. More...
 
def wrapSimpleAlgorithm
 Wrap a C++ SimpleAlgorithm class into both a Python SingleFramePlugin and ForcedPlugin classes. More...
 

Variables

tuple __all__ = ("wrapSingleFrameAlgorithm", "wrapForcedAlgorithm", "wrapSimpleAlgorithm")
 

Function Documentation

def lsst.meas.base.wrappers.wrapAlgorithm (   Base,
  AlgClass,
  factory,
  executionOrder,
  name = None,
  Control = None,
  ConfigClass = None,
  TransformClass = None,
  doRegister = True,
  kwds 
)

Wrap a C++ Algorithm class into a Python Plugin class.

Parameters
[in]BaseBase class for the returned Plugin; one of SingleFramePlugin or ForcedPlugin
[in]AlgClassSwigged C++ Algorithm class to convert; must be a subclass of SingleFrameAlgorithm or ForcedAlgorithm (matching the Base argument), or an unrelated class with the same measure() and measureN() signatures as those base classes.
[in]factoryA callable that is used to construct an instance of AlgClass. It must take four arguments, either (config, name, schema, metadata) or (config, name, schemaMapper, metadata), depending on whether the algorithm is single-frame or forced.
[in]executionOrderThe order this plugin should be run, relative to others (see BasePlugin.getExecutionOrder()).
[in]nameString to use when registering the algorithm. Ignored if doRegistry=False, set to generateAlgorithmName(AlgClass) if None.
[in]ControlSwigged C++ Control class for the algorithm; AlgClass.Control is used if None. Ignored if ConfigClass is not None.
[in]ConfigClassPython Config class that wraps the C++ Algorithm's swigged Control class. If None, wrapAlgorithmControl is called to generate a Config class using the Control argument.
[in]TransformClassTransformation which may be used to post-process the results of measurement. If None, the default (defined by BasePlugin) is used.
[in]doRegisterIf True (the default), register the plugin with Base's registry, allowing it to be used by measurement Tasks.
[in]**kwdsAdditional keyword arguments passed to generateAlgorithmControl, including:
  • hasMeasureN: Whether the plugin supports fitting multiple objects at once (if so, a config option to enable/disable this will be added).
  • executionOrder: If not None, an override for the default executionOrder for this plugin (the default is 2.0, which is usually appropriate for fluxes).
Returns
the new Plugin class, a subclass of Base

This function is generally only called by the public wrapSingleFrameAlgorithm, wrapForcedAlgorithm, and wrapSimpleAlgorithm functions; it is unlikely users will have to call it directly.

Definition at line 77 of file wrappers.py.

77 
78  ConfigClass=None, TransformClass=None, doRegister=True, **kwds):
79  """!
80  Wrap a C++ Algorithm class into a Python Plugin class.
81 
82  @param[in] Base Base class for the returned Plugin; one of SingleFramePlugin or
83  ForcedPlugin
84  @param[in] AlgClass Swigged C++ Algorithm class to convert; must be a subclass of
85  SingleFrameAlgorithm or ForcedAlgorithm (matching the Base argument), or
86  an unrelated class with the same measure() and measureN() signatures as
87  those base classes.
88  @param[in] factory A callable that is used to construct an instance of AlgClass. It must take
89  four arguments, either (config, name, schema, metadata) or
90  (config, name, schemaMapper, metadata), depending on whether the algorithm is
91  single-frame or forced.
92  @param[in] executionOrder The order this plugin should be run, relative to others
93  (see BasePlugin.getExecutionOrder()).
94  @param[in] name String to use when registering the algorithm. Ignored if doRegistry=False,
95  set to generateAlgorithmName(AlgClass) if None.
96  @param[in] Control Swigged C++ Control class for the algorithm; AlgClass.Control is used if None.
97  Ignored if ConfigClass is not None.
98  @param[in] ConfigClass Python Config class that wraps the C++ Algorithm's swigged Control class. If
99  None, wrapAlgorithmControl is called to generate a Config class using the
100  Control argument.
101  @param[in] TransformClass Transformation which may be used to post-process the results of measurement.
102  If None, the default (defined by BasePlugin) is used.
103  @param[in] doRegister If True (the default), register the plugin with Base's registry, allowing it
104  to be used by measurement Tasks.
105  @param[in] **kwds Additional keyword arguments passed to generateAlgorithmControl, including:
106  - hasMeasureN: Whether the plugin supports fitting multiple objects at once
107  (if so, a config option to enable/disable this will be added).
108  - executionOrder: If not None, an override for the default executionOrder for
109  this plugin (the default is 2.0, which is usually appropriate for fluxes).
110 
111  @return the new Plugin class, a subclass of Base
112 
113  This function is generally only called by the public wrapSingleFrameAlgorithm, wrapForcedAlgorithm, and
114  wrapSimpleAlgorithm functions; it is unlikely users will have to call it directly.
115  """
116  if ConfigClass is None:
117  if Control is None:
118  Control = AlgClass.Control
119  ConfigClass = wrapAlgorithmControl(Base.ConfigClass, Control, **kwds)
120  def getExecutionOrder():
121  return executionOrder
122  typeDict = dict(AlgClass=AlgClass, ConfigClass=ConfigClass, factory=staticmethod(factory),
123  getExecutionOrder=staticmethod(getExecutionOrder))
124  if TransformClass:
125  typeDict['getTransformClass'] = staticmethod(lambda: TransformClass)
126  PluginClass = type(AlgClass.__name__ + Base.__name__, (Base,), typeDict)
127  if doRegister:
128  if name is None:
129  name = generateAlgorithmName(AlgClass)
130  Base.registry.register(name, PluginClass)
131  return PluginClass
132 
def generateAlgorithmName
Definition: base.py:42
def wrapAlgorithmControl
Wrap a C++ algorithm's control class into a Python Config class.
Definition: wrappers.py:42
def lsst.meas.base.wrappers.wrapAlgorithmControl (   Base,
  Control,
  hasMeasureN = False 
)

Wrap a C++ algorithm's control class into a Python Config class.

Parameters
[in]BaseBase class for the returned ConfigClass; one of SingleFramePluginConfig or ForcedPluginConfig
[in]ControlControl class to be wrapped (a Swigged C++ class)
[in]hasMeasureNWhether the plugin supports fitting multiple objects at once (if so, a config option to enable/disable this will be added).
Returns
a new subclass of lsst.pex.config.Config

This function is generally only called by wrapAlgorithm; it is unlikely users will have to call it directly.

Definition at line 42 of file wrappers.py.

42 
43 def wrapAlgorithmControl(Base, Control, hasMeasureN=False):
44  """!
45  Wrap a C++ algorithm's control class into a Python Config class.
46 
47  @param[in] Base Base class for the returned ConfigClass; one of SingleFramePluginConfig or
48  ForcedPluginConfig
49  @param[in] Control Control class to be wrapped (a Swigged C++ class)
50  @param[in] hasMeasureN Whether the plugin supports fitting multiple objects at once (if so, a
51  config option to enable/disable this will be added).
52 
53  @return a new subclass of lsst.pex.config.Config
54 
55  This function is generally only called by wrapAlgorithm; it is unlikely users will have to call it
56  directly.
57  """
58  if hasMeasureN:
59  # We need to add a Config field to enable multi-object measurement, to replace
60  # the simple bool class attribute that's on the base class. To do that, we
61  # create the Config class dynamically here, then call makeControlClass to finish
62  # it off by adding fields from the control object.
63  cls = type(
64  Control.__name__.replace("Control", "Config"),
65  (Base,),
66  {"doMeasureN": lsst.pex.config.Field(dtype=bool, default=True,
67  doc="whether to run this plugin in multi-object mode")}
68  )
69  ConfigClass = lsst.pex.config.makeConfigClass(Control, module=Control.__module__, cls=cls)
70  else:
71  # If we don't have to add that Config field, we can delegate all of the work to
72  # pex_config's makeControlClass
73  ConfigClass = lsst.pex.config.makeConfigClass(Control, module=Control.__module__, base=Base)
74  return ConfigClass
75 
def wrapAlgorithmControl
Wrap a C++ algorithm's control class into a Python Config class.
Definition: wrappers.py:42
def lsst.meas.base.wrappers.wrapForcedAlgorithm (   AlgClass,
  executionOrder,
  name = None,
  needsMetadata = False,
  hasMeasureN = False,
  needsSchemaOnly = False,
  kwds 
)

Wrap a C++ ForcedAlgorithm class into a Python ForcedPlugin class.

Parameters
[in]AlgClassSwigged C++ Algorithm class to convert; must be a subclass of ForcedAlgorithm, or an unrelated class with the same measure(), measureN(), and fail() signatures.
[in]executionOrderThe order this plugin should be run, relative to others (see BasePlugin.getExecutionOrder()).
[in]nameString to use when registering the algorithm. Ignored if doRegistry=False, set to generateAlgorithmName(AlgClass) if None.
[in]needsMetadataSets whether the AlgClass's constructor should be passed a PropertySet metadata argument.
[in]hasMeasureNWhether the algorithm supports simultaneous measurement of multiple sources. If True, a bool doMeasureN field will be added to the generated Config class, and its value will be passed as the last argument when calling the AlgClass constructor.
[in]needsSchemaOnlyWhether the algorithm constructor expects a Schema argument (representing the output Schema) rather than the full SchemaMapper (which provides access to both the reference Schema and the output Schema).
[in]**kwdsAdditional keyword arguments passed to the lower-level wrapAlgorithm and wrapAlgorithmControl classes. These include:
  • Control: Swigged C++ Control class for the algorithm; AlgClass.Control is used if None. Ignored if ConfigClass is not None.
  • ConfigClass: Python Config class that wraps the C++ Algorithm's swigged Control class. If None, wrapAlgorithmControl is called to generate a Config class using the Control argument.
  • doRegister: If True (the default), register the plugin with ForcedPlugin.registry, allowing it to be used by ForcedMeasurementTask.
  • executionOrder: If not None, an override for the default executionOrder for this plugin (the default is 2.0, which is usually appropriate for fluxes).
Returns
the new ForcedPlugin subclass

The needsMetadata, hasMeasureN, and needsSchemaOnly arguments combine to determine the expected constructor signature; we always expect the first two arguments to be:

Control const & ctrl, std::string const & name

If needsSchemaOnly is True, then the third argument will be

Schema & schema

otherwise, it will be:

SchemaMapper & schemaMapper

If needsMetadata, we also append:

PropertySet & metadata

If hasMeasureN, we also append:

bool doMeasureN

If both are True, the metadata PropertySet precedes the doMeasureN bool.

Definition at line 200 of file wrappers.py.

201  hasMeasureN=False, needsSchemaOnly=False, **kwds):
202  """!
203  Wrap a C++ ForcedAlgorithm class into a Python ForcedPlugin class.
204 
205  @param[in] AlgClass Swigged C++ Algorithm class to convert; must be a subclass of
206  ForcedAlgorithm, or an unrelated class with the same measure(), measureN(),
207  and fail() signatures.
208  @param[in] executionOrder The order this plugin should be run, relative to others
209  (see BasePlugin.getExecutionOrder()).
210  @param[in] name String to use when registering the algorithm. Ignored if doRegistry=False,
211  set to generateAlgorithmName(AlgClass) if None.
212  @param[in] needsMetadata Sets whether the AlgClass's constructor should be passed a PropertySet
213  metadata argument.
214  @param[in] hasMeasureN Whether the algorithm supports simultaneous measurement of multiple sources.
215  If True, a bool doMeasureN field will be added to the generated Config class,
216  and its value will be passed as the last argument when calling the AlgClass
217  constructor.
218  @param[in] needsSchemaOnly Whether the algorithm constructor expects a Schema argument (representing the
219  output Schema) rather than the full SchemaMapper (which provides access to
220  both the reference Schema and the output Schema).
221  @param[in] **kwds Additional keyword arguments passed to the lower-level wrapAlgorithm and
222  wrapAlgorithmControl classes. These include:
223  - Control: Swigged C++ Control class for the algorithm; AlgClass.Control
224  is used if None. Ignored if ConfigClass is not None.
225  - ConfigClass: Python Config class that wraps the C++ Algorithm's swigged
226  Control class. If None, wrapAlgorithmControl is called to generate a
227  Config class using the Control argument.
228  - doRegister: If True (the default), register the plugin with
229  ForcedPlugin.registry, allowing it to be used by ForcedMeasurementTask.
230  - executionOrder: If not None, an override for the default executionOrder for
231  this plugin (the default is 2.0, which is usually appropriate for fluxes).
232 
233  @return the new ForcedPlugin subclass
234 
235  The needsMetadata, hasMeasureN, and needsSchemaOnly arguments combine to determine the expected
236  constructor signature; we always expect the first two arguments to be:
237  @verbatim
238  Control const & ctrl, std::string const & name
239  @endverbatim
240  If needsSchemaOnly is True, then the third argument will be
241  @verbatim
242  Schema & schema
243  @endverbatim
244  otherwise, it will be:
245  @verbatim
246  SchemaMapper & schemaMapper
247  @endverbatim
248  If needsMetadata, we also append:
249  @verbatim
250  PropertySet & metadata
251  @endverbatim
252  If hasMeasureN, we also append:
253  @verbatim
254  bool doMeasureN
255  @endverbatim
256  If both are True, the metadata PropertySet precedes the doMeasureN bool.
257  """
258  if needsSchemaOnly:
259  extractSchemaArg = lambda m: m.editOutputSchema()
260  else:
261  extractSchemaArg = lambda m: m
262  if hasMeasureN:
263  if needsMetadata:
264  def factory(config, name, schemaMapper, metadata):
265  return AlgClass(config.makeControl(), name, extractSchemaArg(schemaMapper),
266  metadata, config.doMeasureN)
267  else:
268  def factory(config, name, schemaMapper, metadata):
269  return AlgClass(config.makeControl(), name, extractSchemaArg(schemaMapper),
270  config.doMeasureN)
271  else:
272  if needsMetadata:
273  def factory(config, name, schemaMapper, metadata):
274  return AlgClass(config.makeControl(), name, extractSchemaArg(schemaMapper),
275  metadata)
276  else:
277  def factory(config, name, schemaMapper, metadata):
278  return AlgClass(config.makeControl(), name, extractSchemaArg(schemaMapper))
279  return wrapAlgorithm(WrappedForcedPlugin, AlgClass, executionOrder=executionOrder, name=name,
280  factory=factory, **kwds)
281 
def wrapAlgorithm
Wrap a C++ Algorithm class into a Python Plugin class.
Definition: wrappers.py:77
def lsst.meas.base.wrappers.wrapSimpleAlgorithm (   AlgClass,
  executionOrder,
  name = None,
  needsMetadata = False,
  hasMeasureN = False,
  kwds 
)

Wrap a C++ SimpleAlgorithm class into both a Python SingleFramePlugin and ForcedPlugin classes.

Parameters
[in]AlgClassSwigged C++ Algorithm class to convert; must be a subclass of simpleAlgorithm, or an unrelated class with the same measure(), measureN(), and fail() signatures.
[in]executionOrderThe order this plugin should be run, relative to others (see BasePlugin.getExecutionOrder()).
[in]nameString to use when registering the algorithm. Ignored if doRegistry=False, set to generateAlgorithmName(AlgClass) if None.
[in]needsMetadataSets whether the AlgClass's constructor should be passed a PropertySet metadata argument.
[in]hasMeasureNWhether the algorithm supports simultaneous measurement of multiple sources. If True, a bool doMeasureN field will be added to the generated Config class, and its value will be passed as the last argument when calling the AlgClass constructor.
[in]**kwdsAdditional keyword arguments passed to the lower-level wrapAlgorithm and wrapAlgorithmControl classes. These include:
  • Control: Swigged C++ Control class for the algorithm; AlgClass.Control is used if None. Ignored if ConfigClass is not None.
  • ConfigClass: Python Config class that wraps the C++ Algorithm's swigged Control class. If None, wrapAlgorithmControl is called to generate a Config class using the Control argument.
  • doRegister: If True (the default), register the plugins with Base's registry, allowing it to be used by measurement Tasks.
  • executionOrder: If not None, an override for the default executionOrder for this plugin (the default is 2.0, which is usually appropriate for fluxes).
Returns
a two-element tuple, containing the new SingleFramePlugin and ForcedPlugin subclasses

The needsMetadata and hasMeasureN arguments combine to determine the expected constructor signature; we always expect the first three arguments to be:

Control const & ctrl, std::string const & name, Schema & schema

If needsMetadata, we also append:

PropertySet & metadata

If hasMeasureN, we also append:

bool doMeasureN

If both are True, the metadata PropertySet precedes the doMeasureN bool.

Definition at line 282 of file wrappers.py.

283 def wrapSimpleAlgorithm(AlgClass, executionOrder, name=None, needsMetadata=False, hasMeasureN=False, **kwds):
284  """!
285  Wrap a C++ SimpleAlgorithm class into both a Python SingleFramePlugin and ForcedPlugin classes
286 
287  @param[in] AlgClass Swigged C++ Algorithm class to convert; must be a subclass of
288  simpleAlgorithm, or an unrelated class with the same measure(), measureN(),
289  and fail() signatures.
290  @param[in] executionOrder The order this plugin should be run, relative to others
291  (see BasePlugin.getExecutionOrder()).
292  @param[in] name String to use when registering the algorithm. Ignored if doRegistry=False,
293  set to generateAlgorithmName(AlgClass) if None.
294  @param[in] needsMetadata Sets whether the AlgClass's constructor should be passed a PropertySet
295  metadata argument.
296  @param[in] hasMeasureN Whether the algorithm supports simultaneous measurement of multiple sources.
297  If True, a bool doMeasureN field will be added to the generated Config class,
298  and its value will be passed as the last argument when calling the AlgClass
299  constructor.
300  @param[in] **kwds Additional keyword arguments passed to the lower-level wrapAlgorithm and
301  wrapAlgorithmControl classes. These include:
302  - Control: Swigged C++ Control class for the algorithm; AlgClass.Control
303  is used if None. Ignored if ConfigClass is not None.
304  - ConfigClass: Python Config class that wraps the C++ Algorithm's swigged
305  Control class. If None, wrapAlgorithmControl is called to generate a
306  Config class using the Control argument.
307  - doRegister: If True (the default), register the plugins with Base's
308  registry, allowing it to be used by measurement Tasks.
309  - executionOrder: If not None, an override for the default executionOrder for
310  this plugin (the default is 2.0, which is usually appropriate for fluxes).
311 
312  @return a two-element tuple, containing the new SingleFramePlugin and ForcedPlugin subclasses
313 
314  The needsMetadata and hasMeasureN arguments combine to determine the expected constructor signature;
315  we always expect the first three arguments to be:
316  @verbatim
317  Control const & ctrl, std::string const & name, Schema & schema
318  @endverbatim
319  If needsMetadata, we also append:
320  @verbatim
321  PropertySet & metadata
322  @endverbatim
323  If hasMeasureN, we also append:
324  @verbatim
325  bool doMeasureN
326  @endverbatim
327  If both are True, the metadata PropertySet precedes the doMeasureN bool.
328  """
329  return (wrapSingleFrameAlgorithm(AlgClass, executionOrder=executionOrder, name=name,
330  needsMetadata=needsMetadata, **kwds),
331  wrapForcedAlgorithm(AlgClass, executionOrder=executionOrder, name=name,
332  needsMetadata=needsMetadata, needsSchemaOnly=True, **kwds))
def wrapSingleFrameAlgorithm
Wrap a C++ SingleFrameAlgorithm class into a Python SingleFramePlugin class.
Definition: wrappers.py:134
def wrapForcedAlgorithm
Wrap a C++ ForcedAlgorithm class into a Python ForcedPlugin class.
Definition: wrappers.py:200
def wrapSimpleAlgorithm
Wrap a C++ SimpleAlgorithm class into both a Python SingleFramePlugin and ForcedPlugin classes...
Definition: wrappers.py:282
def lsst.meas.base.wrappers.wrapSingleFrameAlgorithm (   AlgClass,
  executionOrder,
  name = None,
  needsMetadata = False,
  hasMeasureN = False,
  kwds 
)

Wrap a C++ SingleFrameAlgorithm class into a Python SingleFramePlugin class.

Parameters
[in]AlgClassSwigged C++ Algorithm class to convert; must be a subclass of SingleFrameAlgorithm, or an unrelated class with the same measure(), measureN(), and fail() signatures.
[in]executionOrderThe order this plugin should be run, relative to others (see BasePlugin.getExecutionOrder()).
[in]nameString to use when registering the algorithm. Ignored if doRegistry=False, set to generateAlgorithmName(AlgClass) if None.
[in]needsMetadataSets whether the AlgClass's constructor should be passed a PropertySet metadata argument.
[in]hasMeasureNWhether the algorithm supports simultaneous measurement of multiple sources. If True, a bool doMeasureN field will be added to the generated Config class, and its value will be passed as the last argument when calling the AlgClass constructor.
[in]**kwdsAdditional keyword arguments passed to the lower-level wrapAlgorithm and wrapAlgorithmControl classes. These include:
  • Control: Swigged C++ Control class for the algorithm; AlgClass.Control is used if None. Ignored if ConfigClass is not None.
  • ConfigClass: Python Config class that wraps the C++ Algorithm's swigged Control class. If None, wrapAlgorithmControl is called to generate a Config class using the Control argument.
  • doRegister: If True (the default), register the plugin with SingleFramePlugin.registry, allowing it to be used by SingleFrameMeasurementTask.
  • executionOrder: If not None, an override for the default executionOrder for this plugin (the default is 2.0, which is usually appropriate for fluxes).
Returns
the new SingleFramePlugin subclass

The needsMetadata and hasMeasureN arguments combine to determine the expected constructor signature; we always expect the first three arguments to be:

Control const & ctrl, std::string const & name, Schema & schema

If needsMetadata, we also append:

PropertySet & metadata

If hasMeasureN, we also append:

bool doMeasureN

If both are True, the metadata PropertySet precedes the doMeasureN bool.

Definition at line 134 of file wrappers.py.

135  **kwds):
136  """!
137  Wrap a C++ SingleFrameAlgorithm class into a Python SingleFramePlugin class.
138 
139  @param[in] AlgClass Swigged C++ Algorithm class to convert; must be a subclass of
140  SingleFrameAlgorithm, or an unrelated class with the same measure(),
141  measureN(), and fail() signatures.
142  @param[in] executionOrder The order this plugin should be run, relative to others
143  (see BasePlugin.getExecutionOrder()).
144  @param[in] name String to use when registering the algorithm. Ignored if doRegistry=False,
145  set to generateAlgorithmName(AlgClass) if None.
146  @param[in] needsMetadata Sets whether the AlgClass's constructor should be passed a PropertySet
147  metadata argument.
148  @param[in] hasMeasureN Whether the algorithm supports simultaneous measurement of multiple sources.
149  If True, a bool doMeasureN field will be added to the generated Config class,
150  and its value will be passed as the last argument when calling the AlgClass
151  constructor.
152  @param[in] **kwds Additional keyword arguments passed to the lower-level wrapAlgorithm and
153  wrapAlgorithmControl classes. These include:
154  - Control: Swigged C++ Control class for the algorithm; AlgClass.Control
155  is used if None. Ignored if ConfigClass is not None.
156  - ConfigClass: Python Config class that wraps the C++ Algorithm's swigged
157  Control class. If None, wrapAlgorithmControl is called to generate a
158  Config class using the Control argument.
159  - doRegister: If True (the default), register the plugin with
160  SingleFramePlugin.registry, allowing it to be used by
161  SingleFrameMeasurementTask.
162  - executionOrder: If not None, an override for the default executionOrder for
163  this plugin (the default is 2.0, which is usually appropriate for fluxes).
164 
165  @return the new SingleFramePlugin subclass
166 
167  The needsMetadata and hasMeasureN arguments combine to determine the expected constructor signature;
168  we always expect the first three arguments to be:
169  @verbatim
170  Control const & ctrl, std::string const & name, Schema & schema
171  @endverbatim
172  If needsMetadata, we also append:
173  @verbatim
174  PropertySet & metadata
175  @endverbatim
176  If hasMeasureN, we also append:
177  @verbatim
178  bool doMeasureN
179  @endverbatim
180  If both are True, the metadata PropertySet precedes the doMeasureN bool.
181  """
182  if hasMeasureN:
183  if needsMetadata:
184  def factory(config, name, schema, metadata):
185  return AlgClass(config.makeControl(), name, schema, metadata, config.doMeasureN)
186  else:
187  def factory(config, name, schema, metadata):
188  return AlgClass(config.makeControl(), name, schema, config.doMeasureN)
189  else:
190  if needsMetadata:
191  def factory(config, name, schema, metadata):
192  return AlgClass(config.makeControl(), name, schema, metadata)
193  else:
194  def factory(config, name, schema, metadata):
195  return AlgClass(config.makeControl(), name, schema)
196  return wrapAlgorithm(WrappedSingleFramePlugin, AlgClass, executionOrder=executionOrder, name=name,
197  factory=factory, hasMeasureN=hasMeasureN, **kwds)
198 
def wrapAlgorithm
Wrap a C++ Algorithm class into a Python Plugin class.
Definition: wrappers.py:77

Variable Documentation

tuple lsst.meas.base.wrappers.__all__ = ("wrapSingleFrameAlgorithm", "wrapForcedAlgorithm", "wrapSimpleAlgorithm")

Definition at line 7 of file wrappers.py.