LSST Applications g1cfbe01172+01aa18f939,g20cdd03214+31e6b93548,g28da252d5a+ea8665a95b,g2bbee38e9b+9ec6cc348d,g2bc492864f+9ec6cc348d,g347aa1857d+9ec6cc348d,g3a166c0a6a+9ec6cc348d,g4322eb9e3a+65eff1e020,g461a3dce89+b86e4b8053,g50ff169b8f+f991eae79d,g52b1c1532d+b86e4b8053,g607f77f49a+31e6b93548,g78056777b3+8ae2798781,g858d7b2824+31e6b93548,g8cd86fa7b1+4851e61ca4,g9ddcbc5298+f24b38b85a,ga1e77700b3+3309dba821,gae0086650b+b86e4b8053,gb0e22166c9+6076c0b52b,gbb886bcc26+dccb771098,gbd462c55f0+dc07f8e65d,gc0c51c7ec2+31e6b93548,gc120e1dc64+a417ce3171,gc28159a63d+9ec6cc348d,gc2a6998b7e+f95f64aeae,gcdd4ae20e8+507450c4cd,gcf0d15dbbd+507450c4cd,gd1535ee943+bcf88ba65f,gd598c5cd71+66126f91fb,gdaeeff99f8+006e14e809,gdbce86181e+39d5515b1a,ge3d4d395c2+b12d4d6a95,ge79ae78c31+9ec6cc348d,gf048a9a2f4+d9c36e6b63,gfbcc870c63+ea41c4420b,w.2024.27
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 140 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 172 of file baseMeasurement.py.

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

◆ 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 199 of file baseMeasurement.py.

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

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 186 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 190 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 181 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 194 of file baseMeasurement.py.


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