MetadataMetricTask#
- class lsst.verify.tasks.MetadataMetricTask(**kwargs)#
Bases:
AbstractMetadataMetricTaskA base class for tasks that compute metrics from single metadata objects.
Parameters#
Constructor parameters are the same as for
lsst.pipe.base.PipelineTask.Notes#
This class should be customized by overriding
getInputMetadataKeysandmakeMeasurement. You should not need to overriderun.Methods Summary
makeMeasurement(values)Compute the metric given the values of the metadata.
run(metadata)Compute a measurement from science task metadata.
Methods Documentation
- abstract makeMeasurement(values)#
Compute the metric given the values of the metadata.
Parameters#
- values
dict[str, any] A
dictrepresentation of the metadata passed torun. It has the same keys as returned bygetInputMetadataKeys, and maps them to the values extracted from the metadata. Any value may beNoneto represent missing data.
Returns#
- measurement
lsst.verify.MeasurementorNone The measurement corresponding to the input data.
Raises#
- lsst.verify.tasks.MetricComputationError
Raised if an algorithmic or system error prevents calculation of the metric. See
runfor expected behavior.- lsst.pipe.base.NoWorkFound
Raised if the metric is ill-defined or otherwise inapplicable. Typically this means that the pipeline step or option being measured was not run.
- values
- run(metadata)#
Compute a measurement from science task metadata.
Parameters#
- metadata
lsst.pipe.base.TaskMetadata A metadata object for the unit of science processing to use for this metric, or a collection of such objects if this task combines many units of processing into a single metric.
Returns#
- result
lsst.pipe.base.Struct A
Structcontaining the following component:measurement: the value of the metric (lsst.verify.MeasurementorNone)
Raises#
- lsst.verify.tasks.MetricComputationError
Raised if the strings returned by
getInputMetadataKeysmatch more than one key in any metadata object.- lsst.pipe.base.NoWorkFound
Raised if the metric is ill-defined or otherwise inapplicable. Typically this means that the pipeline step or option being measured was not run.
Notes#
This implementation calls
getInputMetadataKeys, then searches for matching keys in each metadata. It then passes the values of these keys (orNoneif no match) tomakeMeasurement, and returns its result to the caller.- metadata