MeasurementBase

class lsst.validate.drp.base.MeasurementBase[source]

Bases: lsst.validate.drp.base.JsonSerializationMixin, lsst.validate.drp.base.DatumAttributeMixin

Baseclass for Measurement classes.

Attributes

metric An instance derived from MetricBase.
units Astropy-compatible units string.
label Lable (str) suitable for plot axes; without units.
json a dict that can be serialized as semantic SQuaSH json.
specName (str) A str identifying the specification level (e.g., design, minimum stretch) that this measurement represents. None if this measurement applies to all specification levels.
bandpass (str) A str identifying the bandpass of observatons this measurement was made from. Defaults to None if a measurement is not bandpass-dependent. bandpass should be specificed if needed to resolve a bandpass-specific specification.
parameters (dict) A dict containing all input parameters used by this measurement. Parameters are lsst.validate.drp.base.Datum instances. Parameter values can also be accessed and updated as instance attributes named after the parameter.
extras (dict) A dict containing all measurement by-products (extras) that have been registered for serialization. Extras are lsst.validate.drp.base.Datum instances. Values of extras can also be accessed and updated as instance attributes named after the extra.

Attributes Summary

astropy_units Astropy unit object.
blobs dict of blobs attached to this measurement instance.
datum Representation of this measurement as a lsst.validate.drp.base.Datum.
identifier
json a dict that can be serialized as semantic SQuaSH json.
label Lable (str) suitable for plot axes; without units.
latex_units Units as a LateX string, wrapped in $.
metric An instance derived from MetricBase.
units Astropy-compatible units string.
value Metric measurement value.

Methods Summary

checkSpec(name) Check this measurement against a specification level name, of the metric.
registerExtra(extraKey[, value, units, ...]) Register a measurement extra—a by-product of a metric measurement.
registerParameter(paramKey[, value, units, ...]) Register a measurement input parameter attribute.

Attributes Documentation

astropy_units

Astropy unit object.

blobs

dict of blobs attached to this measurement instance.

datum

Representation of this measurement as a lsst.validate.drp.base.Datum.

identifier
json

a dict that can be serialized as semantic SQuaSH json.

label

Lable (str) suitable for plot axes; without units.

latex_units

Units as a LateX string, wrapped in $.

metric

An instance derived from MetricBase.

units

Astropy-compatible units string. (str).

value

Metric measurement value.

Methods Documentation

checkSpec(name)[source]

Check this measurement against a specification level name, of the metric.

Internally this method retrieves the Specification object, filtering first by the name, but also by this object’s bandpass attribute if specifications are bandpass-dependent.

registerExtra(extraKey, value=None, units=None, label=None, description=None, datum=None)[source]

Register a measurement extra—a by-product of a metric measurement.

The value of the extra can either be set at registration time (see value argument), or later by setting the object’s attribute named extraKey.

The value of an extra can always be accessed through the object’s attribute named exrtaKey.

Extras are stored as Datum objects, which can be accessed through the parameters attribute dict.

Parameters:

extraKey : str

Name of the extra; used as the key in the extras attribute of this object.

value : obj

Value of the extra, either as a regular object, or already represented as a Datum.

units : str, optional

The astropy-compatible unit string. See http://docs.astropy.org/en/stable/units/.

label : str, optional

Label suitable for plot axes (without units). By default the extraKey is used as the label. Setting this label argument overrides both of these.

description : str, optional

Extended description.

datum : Datum, optional

If a Datum is provided, its value, units, label and description will be used unless overriden by other arguments to registerExtra.

registerParameter(paramKey, value=None, units=None, label=None, description=None, datum=None)[source]

Register a measurement input parameter attribute.

The value of the parameter can either be set at registration time (see value argument), or later by setting the object’s attribute named paramKey.

The value of a parameter can always be accessed through the object’s attribute named paramKey.

Parameters are stored as Datum objects, which can be accessed through the parameters attribute dict.

Parameters:

paramKey : str

Name of the parameter; used as the key in the parameters attribute of this object.

value : obj

Value of the parameter.

units : str, optional

An astropy-compatible unit string. See http://docs.astropy.org/en/stable/units/.

label : str, optional

Label suitable for plot axes (without units). By default the paramKey is used as the label. Setting this label argument overrides this default.

description : str, optional

Extended description.

datum : Datum, optional

If a Datum is provided, its value, units and label will be used unless overriden by other arguments to registerParameter.