MetricTask (lsst.verify.gen2tasks)

MetricTask is a base class for generating lsst.verify.Measurement given input data. Each MetricTask class accepts specific type(s) of datasets and produces measurements for a specific metric or family of metrics.

While its API mirrors that of PipelineTask, this version of MetricTask is designed to be used with the Gen 2 framework.

Python API summary

from lsst.verify.gen2tasks.metricTask import MetricTask
classMetricTask(config=None, name=None, parentTask=None, log=None)

A base class for tasks that compute one metric from input datasets...

attributeconfig

Access configuration fields and retargetable subtasks.

See also

See the MetricTask API reference for complete details.

Retargetable subtasks

No subtasks.

Configuration fields

No configuration fields.

In Depth

Subclassing

MetricTask is primarily customized using the run or adaptArgsAndRun methods. Each subclass must also implement the getOutputMetricName method.

The task config should use lsst.pipe.base.InputDatasetConfig to identify input datasets as if it were a PipelineTask. Only the name field is used in a Gen 2 context, but use of InputDatasetConfig is expected to simplify the transition to Gen 3.

Registration

The most common way to run MetricTask is as plugins to MetricsControllerTask. Most MetricTask classes should use the register decorator to assign a plugin name.

Because of implementation limitations, each registered name may appear at most once in MetricsControllerConfig. If you expect to need multiple instances of the same MetricTask class (typically when the same class can compute multiple metrics), it must have the registerMultiple decorator instead.