wrapSimpleAlgorithm¶
- lsst.meas.base.wrapSimpleAlgorithm(AlgClass, executionOrder, name=None, needsMetadata=False, hasMeasureN=False, hasLogName=False, **kwds)¶
Expose a C++
SimpleAlgorithm
class as a measurement plugin.SimpleAlgorithm
s are made available as bothSingleFramePlugin
s andForcedPlugin
s.- Parameters:
- AlgClassSubclass of C++
SimpleAlgorithm
, or API compatible Algorithm class to convert. The C++ class should be wrapped with Pybind11, and must provide
measure()
,measureN()
andfail()` signatures equivalent to ``SimpleAlgorithm
.- executionOrder
float
The order this plugin should be run, relative to others (see
getExecutionOrder
).- name
str
, optional Name to use when registering the algorithm. Ignored if
doRegistry=False
; set togenerateAlgorithmName(AlgClass)
ifNone
.- needsMetadata
bool
, optional Sets whether the
AlgClass
’s constructor should be passed aPropertySet
metadata argument.- hasMeasureN
bool
, optional Does the algorithm support simultaneous measurement of multiple sources? If
True
, abool
doMeasureN
field will be added to the generated config class, and its value will be passed as the last argument when calling theAlgClass
constructor.- hasLogName
bool
, optional True
if the C++ algorithm supportslogName
as a constructor argument.- **kwds
Additional keyword arguments are passed to the lower-level
wrapAlgorithm
andwrapAlgorithmControl
classes.
- AlgClassSubclass of C++
- Returns:
- singleFramePluginsubclass of
SingleFramePlugin
The new single frame measurement plugin class.
- forcedPluginsubclass of
ForcedPlugin
The new forced measurement plugin class.
- singleFramePluginsubclass of
Notes
The first three arguments to the C++ constructor are expected to be
Control const & ctrl, std::string const & name, Schema & schema
.If
needsMetadata
isTrue
, we also appendPropertySet & metadata
.If
hasMeasureN
isTrue
, we also appendbool doMeasureN
.If
hasLogName
isTrue
, we also appendstd::string logName
.If more than one of the above is
True
, the metadataPropertySet
precedes thedoMeasureN
bool
and thelogName
comes last of the three.