wrapAlgorithm¶
-
lsst.meas.base.wrapAlgorithm(Base, AlgClass, factory, executionOrder, name=None, Control=None, ConfigClass=None, TransformClass=None, doRegister=True, shouldApCorr=False, apCorrList=(), hasLogName=False, **kwds)¶ Wrap a C++ algorithm class to create a measurement plugin.
Parameters: - Base :
SingleFramePluginorForcedPlugin Base class for the returned Plugin.
- AlgClass : API compatible with
SingleFrameAlgorithmorForcedAlgorithm C++ algorithm class to convert. May either derive directly from
SingleFrameAlgorithmorForcedAlgorithm, or be an unrelated class which has the samemeasureandmeasureNsignatures.- factory : callable
A 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.- executionOrder :
float The order this plugin should be run, relative to others (see
BasePlugin.getExecutionOrder).- name :
str, optional String to use when registering the algorithm. Ignored if
doRegistry=False, set togenerateAlgorithmName(AlgClass)ifNone.- Control : Pybind11-wrapped version of a C++ class, optional
Pybind11-wrapped C++ Control class for the algorithm;
AlgClass.Controlis used ifNone. Ignored ifConfigClassis notNone.- ConfigClass : subclass of
BaseMeasurementPluginConfig Python config class that wraps the C++ algorithm’s pybind11-wrapped Control class. If
None,wrapAlgorithmControlis called to generate a Config class using theControlargument.- TransformClass : subclass of
MeasurementTransform, optional Transformation which may be used to post-process the results of measurement. If
None, the default defined byBasePluginis used.- doRegister :
bool, optional If
True(the default), register the plugin withBase’s registry, allowing it to be used by measurement tasks.- shouldApCorr :
bool, optional Does this algorithm measure an instFlux that can be aperture corrected? This is shorthand for
apCorrList=[name]and is ignored ifapCorrListis specified.- apCorrList : iterable of
str, optional Field name prefixes for instFlux fields to be aperture corrected. If an algorithm measures a single instFlux that should be aperture corrected, then it is simpler to set
shouldApCorr=True. However, if an algorithm produces multiple such fields, then specifyapCorrListinstead. For example,modelfit_CModelproduces three such fields:apCorrList= ("modelfit_CModel_exp", "modelfit_CModel_exp", "modelfit_CModel_def")IfapCorrListis not empty thenshouldApCorris ignored. If non-empty anddoRegisterisTruethen the names are added to the set retrieved bygetApCorrNameSet.- hasLogName :
bool, optional Trueif the C++ algorithm supportslogNameas a constructor argument.- **kwds
Additional keyword arguments passed to generateAlgorithmControl, which may include:
hasMeasureN: Whether the plugin supports fitting multiple objects at once ;if so, a config option to enable/disable this will be added (bool).executionOrder: If notNone, an override for the default execution order for this plugin (the default is2.0, which is usually appropriate for fluxes;bool).
Returns: - PluginClass : subclass of
Base The new plugin class.
- Base :