|
LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Classes | |
| class | WrappedSingleFramePlugin |
| class | WrappedForcedPlugin |
| class | GenericPlugin |
Functions | |
| def | wrapAlgorithmControl (Base, Control, module=None, hasMeasureN=False) |
| def | wrapAlgorithm (Base, AlgClass, factory, executionOrder, name=None, Control=None, ConfigClass=None, TransformClass=None, doRegister=True, shouldApCorr=False, apCorrList=(), hasLogName=False, **kwds) |
| def | wrapSingleFrameAlgorithm (AlgClass, executionOrder, name=None, needsMetadata=False, hasMeasureN=False, hasLogName=False, **kwds) |
| def | wrapForcedAlgorithm (AlgClass, executionOrder, name=None, needsMetadata=False, hasMeasureN=False, needsSchemaOnly=False, hasLogName=False, **kwds) |
| def | wrapSimpleAlgorithm (AlgClass, executionOrder, name=None, needsMetadata=False, hasMeasureN=False, hasLogName=False, **kwds) |
| def | wrapTransform (transformClass, hasLogName=False) |
| def lsst.meas.base.wrappers.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 : `SingleFramePlugin` or `ForcedPlugin`
Base class for the returned Plugin.
AlgClass : API compatible with `SingleFrameAlgorithm` or `ForcedAlgorithm`
C++ algorithm class to convert. May either derive directly from
`SingleFrameAlgorithm` or `ForcedAlgorithm`, or be an unrelated class
which has the same ``measure`` and ``measureN`` signatures.
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 to ``generateAlgorithmName(AlgClass)`` if
`None`.
Control : Pybind11-wrapped version of a C++ class, optional
Pybind11-wrapped C++ Control class for the algorithm;
``AlgClass.Control`` is used if `None`. Ignored if ``ConfigClass``
is not `None`.
ConfigClass : subclass of `BaseMeasurementPluginConfig`
Python config class that wraps the C++ algorithm's pybind11-wrapped
Control class. If `None`, `wrapAlgorithmControl` is called to
generate a Config class using the ``Control`` argument.
TransformClass : subclass of `MeasurementTransform`, optional
Transformation which may be used to post-process the results of
measurement. If `None`, the default defined by `BasePlugin` is
used.
doRegister : `bool`, optional
If `True` (the default), register the plugin with ``Base``'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
if ``apCorrList`` is 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 specify
``apCorrList`` instead. For example, ``modelfit_CModel`` produces
three such fields: ``apCorrList= ("modelfit_CModel_exp",
"modelfit_CModel_exp", "modelfit_CModel_def")`` If ``apCorrList`` is
not empty then ``shouldApCorr`` is ignored. If non-empty and
``doRegister`` is `True` then the names are added to the set
retrieved by ``getApCorrNameSet``.
hasLogName : `bool`, optional
`True` if the C++ algorithm supports ``logName`` as 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 not `None`, an override for the default
execution order for this plugin (the default is ``2.0``, which is
usually appropriate for fluxes; `bool`).
Returns
-------
PluginClass : subclass of ``Base``
The new plugin class.
Definition at line 122 of file wrappers.py.
| def lsst.meas.base.wrappers.wrapAlgorithmControl | ( | Base, | |
| Control, | |||
module = None, |
|||
hasMeasureN = False |
|||
| ) |
Wrap a C++ algorithm's control class into a Python config class.
Parameters
----------
Base : `SingleFramePluginConfig` or `ForcedPluginConfig`
Base class for the returned config.
Control : pybind11-wrapped version of a C++ class.
Control class to be wrapped.
module : module, `str`, `int`, or `None`; optional
Either a module object, a string specifying the name of the module, or
an integer specifying how far back in the stack to look for the module
to use: ``0`` is `lsst.pex.config.wrap`, ``1`` is
`lsst.meas.base.wrappers`, ``2`` is the immediate caller, etc. This
will be used to set ``__module__`` for the new config class, and the
class will also be added to the module. The default is none in which
case module will be looked up from Control.
hasMeasureN : `bool`, optional
Whether the plugin supports fitting multiple objects at once (if so, a
config option to enable/disable this will be added).
Returns
-------
ConfigClass : `lsst.pex.config.Config`
A new subclass of lsst.pex.config.Config.
Notes
-----
This function is generally only called by `wrapAlgorithm`; it is unlikely
users will have to call it directly.
Definition at line 71 of file wrappers.py.
| def lsst.meas.base.wrappers.wrapForcedAlgorithm | ( | AlgClass, | |
| executionOrder, | |||
name = None, |
|||
needsMetadata = False, |
|||
hasMeasureN = False, |
|||
needsSchemaOnly = False, |
|||
hasLogName = False, |
|||
| ** | kwds | ||
| ) |
Expose a C++ ``ForcedAlgorithm`` class as a measurement plugin.
Parameters
----------
AlgClass : API compatible with `ForcedAlgorithm`
C++ algorithm class to convert. May either derive directly from
`ForcedAlgorithm` or be an unrelated class which has the same
``measure``, ``measureN`` and ``fail`` signatures.
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 to ``generateAlgorithmName(AlgClass)`` if
`None`.
needsMetadata : `bool`, optional
Sets whether the ``AlgClass``'s constructor should be passed a
`~lsst.daf.base.PropertySet` metadata argument.
hasMeasureN : `bool`, optional
Does the algorithm support 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.
hasLogName : `bool`, optional
`True` if the C++ algorithm supports ``logName`` as a constructor
argument.
needsSchemaOnly : `bool`, optional
Whether the algorithm constructor expects a Schema argument
(representing the output `~lsst.afw.table.Schema`) rather than the
full `~lsst.afw.table.SchemaMapper` (which provides access to both the
reference schema and the output schema).
**kwds
Additional keyword arguments are passed to the lower-level
`wrapAlgorithm` and `wrapAlgorithmControl` classes.
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 & name``
If ``needsSchemaOnly`` is `True`, then the third argument will be
``Schema & schema``; otherwise, it will be ``SchemaMapper &
schemaMapper``.
If ``needsMetadata`` is `True`, we also append ``PropertySet &
metadata``.
If ``hasMeasureN`` is `True`, we also append ``bool doMeasureN``.
If ``hasLogName`` is `True`, we also append ``std::string logName``.
If more than one of the above is `True`, the metadata ``PropertySet``
precedes the ``doMeasureN`` ``bool`` and the ``logName`` comes last of the
three.
Definition at line 289 of file wrappers.py.
| def lsst.meas.base.wrappers.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 both `SingleFramePlugin`\ s
and `ForcedPlugin`\ s.
Parameters
----------
AlgClass : Subclass of C++ ``SimpleAlgorithm``, or API compatible
Algorithm class to convert. The C++ class should be wrapped with
Pybind11, and must provide ``measure()``, ``measureN()`` and ``fail()`
signatures equivalent to ``SimpleAlgorithm``.
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 to ``generateAlgorithmName(AlgClass)`` if
`None`.
needsMetadata : `bool`, optional
Sets whether the ``AlgClass``'s constructor should be passed a
`~lsst.daf.base.PropertySet` metadata argument.
hasMeasureN : `bool`, optional
Does the algorithm support 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.
hasLogName : `bool`, optional
`True` if the C++ algorithm supports ``logName`` as a constructor
argument.
**kwds
Additional keyword arguments are passed to the lower-level
`wrapAlgorithm` and `wrapAlgorithmControl` classes.
Returns
-------
singleFramePlugin : subclass of `SingleFramePlugin`
The new single frame measurement plugin class.
forcedPlugin : subclass of `ForcedPlugin`
The new forced measurement plugin class.
Notes
-----
The first three arguments to the C++ constructor are expected to be
``Control const & ctrl, std::string const & name, Schema & schema``.
If ``needsMetadata`` is `True`, we also append ``PropertySet &
metadata``.
If ``hasMeasureN`` is `True`, we also append ``bool doMeasureN``.
If ``hasLogName`` is `True`, we also append ``std::string logName``.
If more than one of the above is `True`, the metadata ``PropertySet``
precedes the ``doMeasureN`` ``bool`` and the ``logName`` comes last of the
three.
Definition at line 379 of file wrappers.py.
| def lsst.meas.base.wrappers.wrapSingleFrameAlgorithm | ( | AlgClass, | |
| executionOrder, | |||
name = None, |
|||
needsMetadata = False, |
|||
hasMeasureN = False, |
|||
hasLogName = False, |
|||
| ** | kwds | ||
| ) |
Expose a C++ ``SingleFrameAlgorithm`` class as a measurement plugin.
Parameters
----------
AlgClass : API compatible with `SingleFrameAlgorithm`
C++ algorithm class to convert. May either derive directly from
`SingleFrameAlgorithm` or be an unrelated class which has the same
``measure``, ``measureN`` and ``fail`` signatures.
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 to ``generateAlgorithmName(AlgClass)`` if
`None`.
needsMetadata : `bool`, optional
Sets whether the ``AlgClass``'s constructor should be passed a
`~lsst.daf.base.PropertySet` metadata argument.
hasMeasureN : `bool`, optional
Does the algorithm support 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.
hasLogName : `bool`, optional
`True` if the C++ algorithm supports ``logName`` as a constructor
argument.
**kwds
Additional keyword arguments are passed to the lower-level
`wrapAlgorithm` and `wrapAlgorithmControl` classes.
Returns
-------
singleFramePlugin : subclass of `SingleFramePlugin`
The new measurement plugin class.
Notes
-----
The first three arguments to the C++ constructor are expected to be
``Control const & ctrl, std::string const & name, Schema & schema``.
If ``needsMetadata`` is `True`, we also append ``PropertySet & metadata``.
If ``hasMeasureN`` is `True`, we also append ``bool doMeasureN``.
If ``hasLogName`` is `True`, we also append ``std::string logName``.
If more than one of the above is `True`, the metadata ``PropertySet``
precedes the ``doMeasureN`` ``bool`` and the ``logName`` comes last of the
three.
Definition at line 218 of file wrappers.py.
| def lsst.meas.base.wrappers.wrapTransform | ( | transformClass, | |
hasLogName = False |
|||
| ) |
Modify a C++ transform to accept either a ``Config`` or a ``Control``.
That is, the configuration may either be provided as a (C++) ``Control``
object or an instance of a Python class derived from
`~lsst.meas.base.BasePluginConfig`.
Parameters
----------
transformClass : Subclass of C++ ``BaseTransform``
A C++ transform class, wrapped with pybind11. Its constructor must
take a ``Control`` object, a ``std::string``, and a
`~lsst.afw.table.SchemaMapper`, in that order.
hasLogName : `bool`, optional
Unused.
Definition at line 444 of file wrappers.py.