MetricConnections

class lsst.verify.tasks.MetricConnections(*, config: PipelineTaskConfig = None)

Bases: lsst.pipe.base.PipelineTaskConnections

An abstract connections class defining a metric output.

This class assumes detector-level metrics, which is the most common case. Subclasses can redeclare measurement and dimensions to override this assumption.

Notes

MetricConnections defines the following dataset templates:
package
Name of the metric’s namespace. By verify_metrics convention, this is the name of the package the metric is most closely associated with.
metric
Name of the metric, excluding any namespace.

Attributes Summary

allConnections
defaultTemplates
dimensions
initInputs
initOutputs
inputs
measurement
outputs
prerequisiteInputs

Methods Summary

adjustQuantum(datasetRefMap, …) Override to make adjustments to lsst.daf.butler.DatasetRef objects in the lsst.daf.butler.core.Quantum during the graph generation stage of the activator.
buildDatasetRefs(quantum) Builds QuantizedConnections corresponding to input Quantum

Attributes Documentation

allConnections = {'measurement': Output(name='metricvalue_{package}_{metric}', storageClass='MetricValue', doc='The metric value computed by this task.', multiple=False, dimensions={'detector', 'visit', 'instrument'}, isCalibration=False)}
defaultTemplates = {'metric': None, 'package': None}
dimensions = {'detector', 'visit', 'instrument'}
initInputs = frozenset()
initOutputs = frozenset()
inputs = frozenset()
measurement
outputs = frozenset({'measurement'})
prerequisiteInputs = frozenset()

Methods Documentation

adjustQuantum(datasetRefMap: lsst.daf.butler.core.named.NamedKeyDict[lsst.daf.butler.core.datasets.type.DatasetType, typing.Set[lsst.daf.butler.core.datasets.ref.DatasetRef]][lsst.daf.butler.core.datasets.type.DatasetType, Set[lsst.daf.butler.core.datasets.ref.DatasetRef]]) → lsst.daf.butler.core.named.NamedKeyDict[lsst.daf.butler.core.datasets.type.DatasetType, typing.Set[lsst.daf.butler.core.datasets.ref.DatasetRef]][lsst.daf.butler.core.datasets.type.DatasetType, Set[lsst.daf.butler.core.datasets.ref.DatasetRef]]

Override to make adjustments to lsst.daf.butler.DatasetRef objects in the lsst.daf.butler.core.Quantum during the graph generation stage of the activator.

The base class implementation simply checks that input connections with multiple set to False have no more than one dataset.

Parameters:
datasetRefMap : NamedKeyDict

Mapping from dataset type to a set of lsst.daf.butler.DatasetRef objects

Returns:
datasetRefMap : NamedKeyDict

Modified mapping of input with possibly adjusted lsst.daf.butler.DatasetRef objects.

Raises:
ScalarError

Raised if any Input or PrerequisiteInput connection has multiple set to False, but multiple datasets.

Exception

Overrides of this function have the option of raising an Exception if a field in the input does not satisfy a need for a corresponding pipelineTask, i.e. no reference catalogs are found.

buildDatasetRefs(quantum: lsst.daf.butler.core.quantum.Quantum) → Tuple[lsst.pipe.base.connections.InputQuantizedConnection, lsst.pipe.base.connections.OutputQuantizedConnection]

Builds QuantizedConnections corresponding to input Quantum

Parameters:
quantum : lsst.daf.butler.Quantum

Quantum object which defines the inputs and outputs for a given unit of processing

Returns:
retVal : tuple of (InputQuantizedConnection,

OutputQuantizedConnection) Namespaces mapping attribute names (identifiers of connections) to butler references defined in the input lsst.daf.butler.Quantum