PluginRegistry¶
- class lsst.meas.base.PluginRegistry(configBaseType=<class 'lsst.pex.config.config.Config'>)¶
- Bases: - 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 - RegistryFieldconfiguration 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 - RegistryFieldconfiguration field from this registry.- Parameters:
- docstr
- A description of the field. 
- defaultobject, optional
- The default target for the field. 
- optionalbool, optional
- When - False,- lsst.pex.config.Config.validatefails if the field’s value is- None.
- multibool, optional
- A flag to allow multiple selections in the - RegistryFieldif- True.
- on_noneCallable, optional
- A callable that should be invoked when - applyis 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.
 
- doc
- Returns:
- fieldlsst.pex.config.RegistryField
- RegistryFieldConfiguration field.
 
- field
 
 - register(name, PluginClass, shouldApCorr=False, apCorrList=())¶
- Register a plugin class with the given name. - Parameters:
- namestr
- 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_GaussianFluxindicates an algorithm in- lsst.meas.basethat measures Gaussian Flux and produces fields such as- base_GaussianFlux_instFlux,- base_GaussianFlux_instFluxErrand- base_GaussianFlux_flag.
- shouldApCorrbool
- If - True, then this algorithm measures an instFlux that should be aperture corrected. This is shorthand for- apCorrList=[name]and is ignored if- apCorrListis specified.
- apCorrListlistofstr
- 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- apCorrListinstead. For example,- modelfit_CModelproduces three such fields:- apCorrList=("modelfit_CModel_exp", "modelfit_CModel_exp", "modelfit_CModel_def"). If- apCorrListis not empty then shouldApCorr is ignored.
 
- name
 - 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. 
 - values() an object providing a view on D's values¶