PluginRegistry¶
-
class
lsst.meas.base.
PluginRegistry
(configBaseType=<class 'lsst.pex.config.config.Config'>)¶ Bases:
lsst.pex.config.Registry
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.
Methods Summary
get
(k[,d])items
()keys
()makeField
(doc[, default, optional, multi])Create a RegistryField
configuration field from this registry.register
(name, PluginClass[, shouldApCorr, …])Register a plugin class with the given name. values
()Methods Documentation
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
items
() → a set-like object providing a view on D's items¶
-
keys
() → a set-like object providing a view on D's keys¶
-
makeField
(doc, default=None, optional=False, multi=False)¶ Create a
RegistryField
configuration field from this registry.Parameters: Returns: - field :
lsst.pex.config.RegistryField
RegistryField
Configuration field.
- field :
-
register
(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 inlsst.meas.base
that measures Gaussian Flux and produces fields such asbase_GaussianFlux_instFlux
,base_GaussianFlux_instFluxErr
andbase_GaussianFlux_flag
.- shouldApCorr :
bool
If
True
, then this algorithm measures an instFlux that should be aperture corrected. This is shorthand forapCorrList=[name]
and is ignored ifapCorrList
is specified.- apCorrList :
list
ofstr
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 specifyapCorrList
instead. For example,modelfit_CModel
produces three such fields:apCorrList=("modelfit_CModel_exp", "modelfit_CModel_exp", "modelfit_CModel_def")
. IfapCorrList
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.
- name :
-
values
() → an object providing a view on D's values¶
-