wrapForcedAlgorithm¶
-
lsst.meas.base.wrapForcedAlgorithm(AlgClass, executionOrder, name=None, needsMetadata=False, hasMeasureN=False, needsSchemaOnly=False, hasLogName=False, **kwds)¶ Expose a C++
ForcedAlgorithmclass as a measurement plugin.Parameters: - AlgClass : API compatible with
ForcedAlgorithm C++ algorithm class to convert. May either derive directly from
ForcedAlgorithmor be an unrelated class which has the samemeasure,measureNandfailsignatures.- executionOrder :
float The order this plugin should be run, relative to others (see
BasePlugin.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 aPropertySetmetadata argument.- hasMeasureN :
bool, optional Does the algorithm support simultaneous measurement of multiple sources? If
True, abooldoMeasureNfield will be added to the generated config class, and its value will be passed as the last argument when calling theAlgClassconstructor.- hasLogName :
bool, optional Trueif the C++ algorithm supportslogNameas a constructor argument.- needsSchemaOnly :
bool, optional Whether the algorithm constructor expects a Schema argument (representing the output
Schema) rather than the fullSchemaMapper(which provides access to both the reference schema and the output schema).- **kwds
Additional keyword arguments are passed to the lower-level
wrapAlgorithmandwrapAlgorithmControlclasses.
Returns: - forcedPlugin : subclass of
ForcedPlugin The new measurement plugin class.
Notes
The first two arguments to the C++ constructor are expected to be
Control const & ctrl, std::string const & nameIf
needsSchemaOnlyisTrue, then the third argument will beSchema & schema; otherwise, it will beSchemaMapper & schemaMapper.If
needsMetadataisTrue, we also appendPropertySet & metadata.If
hasMeasureNisTrue, we also appendbool doMeasureN.If
hasLogNameisTrue, we also appendstd::string logName.If more than one of the above is
True, the metadataPropertySetprecedes thedoMeasureNbooland thelogNamecomes last of the three.- AlgClass : API compatible with