ApdbMetricTask#
- class lsst.verify.tasks.ApdbMetricTask(**kwargs)#
Bases:
MetricTaskA base class for tasks that compute metrics from an alert production database.
Parameters#
- **kwargs
Constructor parameters are the same as for
lsst.pipe.base.PipelineTask.
Notes#
This class should be customized by overriding
makeMeasurement. You should not need to overriderun.Methods Summary
makeMeasurement(dbHandle, outputDataId)Compute the metric from database data.
run(dbInfo[, outputDataId])Compute a measurement from a database.
runQuantum(butlerQC, inputRefs, outputRefs)Do Butler I/O to provide in-memory objects for run.
Methods Documentation
- abstract makeMeasurement(dbHandle, outputDataId)#
Compute the metric from database data.
Parameters#
- dbHandle
lsst.dax.apdb.Apdb A database instance.
- outputDataIdany data ID type
The subset of the database to which this measurement applies. May be empty to represent the entire dataset.
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 to the database state. Typically this means that the pipeline step or option being measured was not run.
- dbHandle
- run(dbInfo, outputDataId={})#
Compute a measurement from a database.
Parameters#
- dbInfo
list The datasets (of the type indicated by the config) from which to load the database. If more than one dataset is provided (as may be the case if DB writes are fine-grained), all are assumed identical.
- outputDataId: any data ID type, optional
The output data ID for the metric value. Defaults to the empty ID, representing a value that covers the entire dataset.
Returns#
- result
lsst.pipe.base.Struct Result struct with component:
measurementthe value of the metric (
lsst.verify.MeasurementorNone)
Raises#
- lsst.verify.tasks.MetricComputationError
Raised if an algorithmic or system error prevents calculation of the metric.
- lsst.pipe.base.NoWorkFound
Raised if the metric is ill-defined or otherwise inapplicable to the database state. Typically this means that the pipeline step or option being measured was not run.
Notes#
This implementation calls
dbLoaderto acquire a database handle, then passes it and the value ofoutputDataIdtomakeMeasurement. The result ofmakeMeasurementis returned to the caller.- dbInfo