AbstractMetadataMetricTask#
- class lsst.verify.tasks.AbstractMetadataMetricTask(**kwargs)#
Bases:
MetricTaskA base class for tasks that compute metrics from metadata values.
This class contains code that is agnostic to whether the input is one metadata object or many.
Parameters#
Constructor parameters are the same as for
lsst.pipe.base.PipelineTask.Notes#
This class should be customized by overriding
getInputMetadataKeysandrun.Methods Summary
extractMetadata(metadata, metadataKeys)Read multiple keys from a metadata object.
getInputMetadataKeys(config)Return the metadata keys read by this task.
Methods Documentation
- static extractMetadata(metadata, metadataKeys)#
Read multiple keys from a metadata object.
Parameters#
- metadata
lsst.pipe.base.TaskMetadata A metadata object.
- metadataKeys
dict[str,str] Keys are arbitrary labels, values are metadata keys (or their substrings) in the format of
lsst.pipe.base.Task.getFullMetadata().
Returns#
- metadataValues
dict[str, any] Keys are the same as for
metadataKeys, values are the value of each metadata key, orNoneif no matching key was found.
Raises#
- lsst.verify.tasks.MetricComputationError
Raised if any metadata key string has more than one match in
metadata.
- metadata
- abstract classmethod getInputMetadataKeys(config)#
Return the metadata keys read by this task.
Parameters#
- config
cls.ConfigClass Configuration for this task.
Returns#
- keys
dict[str,str] The keys are the (arbitrary) names of values to use in task code, the values are the metadata keys to be looked up (see the
metadataKeysparameter toextractMetadata). Metadata keys are assumed to include task prefixes in the format oflsst.pipe.base.Task.getFullMetadata(). This method may return a substring of the desired (full) key, but the string must match a unique metadata key.
- config