ApdbMetricTask

ApdbMetricTask is a base class for generating Measurements from an Alert Production Database. The class handles loading an appropriately configured database, while subclasses are responsible for creating the Measurement using the database API.

Processing summary

ApdbMetricTask runs this sequence of operations:

  1. Load the dataset indicated by dbInfo (default: one or more apdb_marker datasets).

  2. Generate an Apdb object by calling the dbLoader subtask (default: DirectApdbLoader).

  3. Process the database by passing it to the customizable makeMeasurement method, and return the Measurement.

Python API summary

from lsst.verify.tasks.apdbMetricTask import ApdbMetricTask
classApdbMetricTask(**kwargs)

A base class for tasks that compute metrics from an alert production database...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(dbInfo, outputDataId={})

Compute a measurement from a database...

See also

See the ApdbMetricTask API reference for complete details.

Butler datasets

Input datasets

dbInfo

The Butler dataset from which the database connection can be initialized. The type must match the input required by the dbLoader subtask (default: apdb_marker).

Output datasets

measurement

The value of the metric. The dataset type should not be configured directly, but should be set changing the package and metric template variables to the metric’s namespace (package, by convention) and in-package name, respectively. Subclasses that only support one metric should set these variables automatically.

Retargetable subtasks

dbLoader

Default

lsst.verify.tasks.apdbMetricTask.DirectApdbLoader

Field type

ConfigurableField

Task for loading a database from dbInfo. Its run method must take one object of the dataset type indicated by dbInfo and return a Struct with an ‘apdb’ member. Ignored if doReadMarker is unset. Deprecated: This field has been replaced by apdb_config_url; set doReadMarker=False to use it. Will be removed after v28.

Configuration fields

apdb_config_url

Default
None
Field type

str Field

A config file specifying the APDB and its connection parameters, typically written by the apdb-cli command-line utility.

connections

Data type

lsst.pipe.base.config.ApdbMetricConfigConnections

Field type

ConfigField

Configurations describing the connections of the PipelineTask to datatypes

doReadMarker

Default
True
Field type

bool Field

Use the dbInfo input to set up the APDB, instead of the new config (apdb_config_url). This field is provided for backward-compatibility ONLY and will be removed without notice after v28.

saveLogOutput

Default
True
Field type

bool Field

Flag to enable/disable saving of log output for a task, enabled by default.