LSST Applications g02d81e74bb+86cf3d8bc9,g180d380827+7a4e862ed4,g2079a07aa2+86d27d4dc4,g2305ad1205+e1ca1c66fa,g29320951ab+012e1474a1,g295015adf3+341ea1ce94,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+c429d67c83,g48712c4677+f88676dd22,g487adcacf7+27e1e21933,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+b41db86c35,g5a732f18d5+53520f316c,g64a986408d+86cf3d8bc9,g858d7b2824+86cf3d8bc9,g8a8a8dda67+585e252eca,g99cad8db69+84912a7fdc,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+a2b54eae19,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+6681f309db,gc120e1dc64+f0fcc2f6d8,gc28159a63d+0e5473021a,gcf0d15dbbd+c429d67c83,gdaeeff99f8+f9a426f77a,ge6526c86ff+0433e6603d,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+86cf3d8bc9,w.2024.17
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
lsst.meas.base.pluginRegistry.PluginRegistry Class Reference
Inheritance diagram for lsst.meas.base.pluginRegistry.PluginRegistry:
lsst.pex.config.registry.Registry

Classes

class  Configurable
 

Public Member Functions

 register (self, name, PluginClass, shouldApCorr=False, apCorrList=())
 
 makeField (self, doc, default=None, optional=False, multi=False)
 

Detailed Description

Base class for plugin registries.

Notes
-----
The class of plugins allowed in the registry is defined in the constructor
of the registry.

Single-frame and forced plugins have different registries.

Definition at line 76 of file pluginRegistry.py.

Member Function Documentation

◆ makeField()

lsst.meas.base.pluginRegistry.PluginRegistry.makeField ( self,
doc,
default = None,
optional = False,
multi = False )
Create a `RegistryField` configuration field from this registry.

Parameters
----------
doc : `str`
    A description of the field.
default : object, optional
    The default target for the field.
optional : `bool`, optional
    When `False`, `lsst.pex.config.Config.validate` fails if the
    field's value is `None`.
multi : `bool`, optional
    A flag to allow multiple selections in the `RegistryField` if
    `True`.
on_none : `Callable`, optional
    A callable that should be invoked when ``apply`` is called but the
    selected name or names is `None`.  Will be passed the field
    attribute proxy (`RegistryInstanceDict`) and then all positional
    and keyword arguments passed to ``apply``.

Returns
-------
field : `lsst.pex.config.RegistryField`
    `~lsst.pex.config.RegistryField` Configuration field.

Reimplemented from lsst.pex.config.registry.Registry.

Definition at line 159 of file pluginRegistry.py.

159 def makeField(self, doc, default=None, optional=False, multi=False):
160 return lsst.pex.config.RegistryField(doc, self, default, optional, multi)
161
162

◆ register()

lsst.meas.base.pluginRegistry.PluginRegistry.register ( self,
name,
PluginClass,
shouldApCorr = False,
apCorrList = () )
Register a plugin class with the given name.

Parameters
----------
name : `str`
    The name of the plugin. This is used as a prefix for all fields
    produced by the plugin, and it should generally contain the name
    of the plugin or algorithm class itself as well as enough of the
    namespace to make it clear where to find the code.  For example
    ``base_GaussianFlux`` indicates an algorithm in `lsst.meas.base`
    that measures Gaussian Flux and produces fields such as
    ``base_GaussianFlux_instFlux``, ``base_GaussianFlux_instFluxErr``
    and ``base_GaussianFlux_flag``.
shouldApCorr : `bool`
    If `True`, then this algorithm measures an instFlux that should
    be aperture corrected. This is shorthand for ``apCorrList=[name]``
    and is ignored if ``apCorrList`` is specified.
apCorrList : `list` of `str`
    List of field name prefixes for instFlux fields to be aperture
    corrected.  If an algorithm produces a single instFlux that should
    be aperture corrected then it is simpler to set
    ``shouldApCorr=True``. But if an algorithm produces multiple such
    fields then it must 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.

Notes
-----
The same plugin may be registered multiple times with different names;
this can be useful if we often want to run it multiple times with
different configuration.

Reimplemented from lsst.pex.config.registry.Registry.

Definition at line 118 of file pluginRegistry.py.

118 def register(self, name, PluginClass, shouldApCorr=False, apCorrList=()):
119 """Register a plugin class with the given name.
120
121 Parameters
122 ----------
123 name : `str`
124 The name of the plugin. This is used as a prefix for all fields
125 produced by the plugin, and it should generally contain the name
126 of the plugin or algorithm class itself as well as enough of the
127 namespace to make it clear where to find the code. For example
128 ``base_GaussianFlux`` indicates an algorithm in `lsst.meas.base`
129 that measures Gaussian Flux and produces fields such as
130 ``base_GaussianFlux_instFlux``, ``base_GaussianFlux_instFluxErr``
131 and ``base_GaussianFlux_flag``.
132 shouldApCorr : `bool`
133 If `True`, then this algorithm measures an instFlux that should
134 be aperture corrected. This is shorthand for ``apCorrList=[name]``
135 and is ignored if ``apCorrList`` is specified.
136 apCorrList : `list` of `str`
137 List of field name prefixes for instFlux fields to be aperture
138 corrected. If an algorithm produces a single instFlux that should
139 be aperture corrected then it is simpler to set
140 ``shouldApCorr=True``. But if an algorithm produces multiple such
141 fields then it must specify ``apCorrList`` instead. For example,
142 ``modelfit_CModel`` produces three such fields:
143 ``apCorrList=("modelfit_CModel_exp", "modelfit_CModel_exp",
144 "modelfit_CModel_def")``. If ``apCorrList`` is not empty then
145 shouldApCorr is ignored.
146
147 Notes
148 -----
149 The same plugin may be registered multiple times with different names;
150 this can be useful if we often want to run it multiple times with
151 different configuration.
152 """
153 lsst.pex.config.Registry.register(self, name, self.Configurable(name, PluginClass))
154 if shouldApCorr and not apCorrList:
155 apCorrList = [name]
156 for prefix in apCorrList:
157 addApCorrName(prefix)
158

The documentation for this class was generated from the following file: