LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+bd2ed33bd6,g1470d8bcf6+c6d6eb38e2,g14a832a312+9d12ad093c,g2079a07aa2+86d27d4dc4,g2305ad1205+91a32aca49,g295015adf3+88246b6574,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+c34e8be1fa,g487adcacf7+85dcfbcc36,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ea1711114f,g5a732f18d5+53520f316c,g64a986408d+bd2ed33bd6,g858d7b2824+bd2ed33bd6,g8a8a8dda67+585e252eca,g99cad8db69+016a06b37a,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+ef4e3a5875,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+b6d7b42999,gc120e1dc64+f745648b3a,gc28159a63d+0e5473021a,gcf0d15dbbd+c34e8be1fa,gdaeeff99f8+f9a426f77a,ge6526c86ff+508d0e0a30,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+8d59551888,gf1cff7945b+bd2ed33bd6,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
lsst.meas.base.baseMeasurement.BaseMeasurementConfig Class Reference
Inheritance diagram for lsst.meas.base.baseMeasurement.BaseMeasurementConfig:
lsst.pex.config.config.Config lsst.pex.config.config.ConfigMeta lsst.meas.base.forcedMeasurement.ForcedMeasurementConfig lsst.meas.base.sfm.SingleFrameMeasurementConfig lsst.ip.diffim.dipoleMeasurement.DipoleMeasurementConfig

Public Member Functions

 __new__ (cls, *args, ignoreSlotPluginChecks=False, **kwargs)
 
 validate (self)
 

Static Public Attributes

 slots
 
 doReplaceWithNoise
 
 noiseReplacer
 
 undeblendedPrefix
 

Detailed Description

Base configuration for all measurement driver tasks.

Parameters
----------
ignoreSlotPluginChecks : `bool`, optional
    Do not check that all slots have an associated plugin to run when
    validating this config. This is primarily for tests that were written
    before we made Tasks always call `config.validate()` on init.
    DEPRECATED DM-35949: this is a temporary workaround while we better
    define how config/schema validation works for measurement tasks.

Examples
--------
Subclasses should define the 'plugins' and 'undeblended' registries, e.g.

.. code-block:: py

    plugins = PluginBaseClass.registry.makeField(
        multi=True,
        default=[],
        doc="Plugins to be run and their configuration"
    )
    undeblended = PluginBaseClass.registry.makeField(
        multi=True,
        default=[],
        doc="Plugins to run on undeblended image"
    )

where ``PluginBaseClass`` is the appropriate base class of the plugin
(e.g., `SingleFramePlugin` or `ForcedPlugin`).

Definition at line 139 of file baseMeasurement.py.

Member Function Documentation

◆ __new__()

lsst.meas.base.baseMeasurement.BaseMeasurementConfig.__new__ ( cls,
* args,
kw = False,
** kwargs )
Allocate a new `lsst.pex.config.Config` object.

In order to ensure that all Config object are always in a proper state
when handed to users or to derived `~lsst.pex.config.Config` classes,
some attributes are handled at allocation time rather than at
initialization.

This ensures that even if a derived `~lsst.pex.config.Config` class
implements ``__init__``, its author does not need to be concerned about
when or even the base ``Config.__init__`` should be called.

Reimplemented from lsst.pex.config.config.Config.

Definition at line 171 of file baseMeasurement.py.

171 def __new__(cls, *args, ignoreSlotPluginChecks=False, **kwargs):
172 instance = super().__new__(cls, *args, **kwargs)
173 if ignoreSlotPluginChecks:
174 msg = ("ignoreSlotPluginChecks is deprecated and should only be used in tests."
175 " No removal date has been set; see DM-35949.")
176 warnings.warn(msg, category=FutureWarning, stacklevel=2)
177 object.__setattr__(instance, "_ignoreSlotPluginChecks", ignoreSlotPluginChecks)
178 return instance
179

◆ validate()

lsst.meas.base.baseMeasurement.BaseMeasurementConfig.validate ( self)
Validate the Config, raising an exception if invalid.

Raises
------
lsst.pex.config.FieldValidationError
    Raised if verification fails.

Notes
-----
The base class implementation performs type checks on all fields by
calling their `~lsst.pex.config.Field.validate` methods.

Complex single-field validation can be defined by deriving new Field
types. For convenience, some derived `lsst.pex.config.Field`-types
(`~lsst.pex.config.ConfigField` and
`~lsst.pex.config.ConfigChoiceField`) are defined in
``lsst.pex.config`` that handle recursing into subconfigs.

Inter-field relationships should only be checked in derived
`~lsst.pex.config.Config` classes after calling this method, and base
validation is complete.

Reimplemented from lsst.pex.config.config.Config.

Definition at line 198 of file baseMeasurement.py.

198 def validate(self):
199 super().validate()
200 if self._ignoreSlotPluginChecks:
201 return
202 if self.slots.centroid is not None and self.slots.centroid not in self.plugins.names:
203 raise ValueError("source centroid slot algorithm is not being run.")
204 if self.slots.shape is not None and self.slots.shape not in self.plugins.names:
205 raise ValueError("source shape slot algorithm '%s' is not being run." % self.slots.shape)
206 for slot in (self.slots.psfFlux, self.slots.apFlux, self.slots.modelFlux,
207 self.slots.gaussianFlux, self.slots.calibFlux):
208 if slot is not None:
209 for name in self.plugins.names:
210 if len(name) <= len(slot) and name == slot[:len(name)]:
211 break
212 else:
213 raise ValueError("source instFlux slot algorithm '%s' is not being run." % slot)
214
215

Member Data Documentation

◆ doReplaceWithNoise

lsst.meas.base.baseMeasurement.BaseMeasurementConfig.doReplaceWithNoise
static
Initial value:
dtype=bool, default=True, optional=False,
doc='When measuring, replace other detected footprints with noise?')

Definition at line 185 of file baseMeasurement.py.

◆ noiseReplacer

lsst.meas.base.baseMeasurement.BaseMeasurementConfig.noiseReplacer
static
Initial value:
dtype=NoiseReplacerConfig,
doc="configuration that sets how to replace neighboring sources with noise"
)

Definition at line 189 of file baseMeasurement.py.

◆ slots

lsst.meas.base.baseMeasurement.BaseMeasurementConfig.slots
static
Initial value:
dtype=SourceSlotConfig,
doc="Mapping from algorithms to special aliases in Source."
)

Definition at line 180 of file baseMeasurement.py.

◆ undeblendedPrefix

lsst.meas.base.baseMeasurement.BaseMeasurementConfig.undeblendedPrefix
static
Initial value:
dtype=str, default="undeblended_",
doc="Prefix to give undeblended plugins"
)

Definition at line 193 of file baseMeasurement.py.


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