24 from lsst.daf.butler
import CollectionType
28 """Create a way to bless existing calibration products.
30 The inputs are assumed to have been constructed via cp_pipe, and
31 already exist in the butler.
35 registry : `lsst.daf.butler.Registry`
36 Registry pointing at the butler repository to operate on.
37 inputCollection : `str`
38 Data collection to pull calibrations from. Usually an existing
39 `~CollectionType.RUN` or `~CollectionType.CHAINED` collection, and may
40 _not_ be a `~CollectionType.CALIBRATION` collection or a nonexistent
42 outputCollection : `str`
43 Data collection to store final calibrations. If it already exists, it
44 must be a `~CollectionType.CALIBRATION` collection. If not, a new
45 `~CollectionType.CALIBRATION` collection with this name will be
47 lastRunOnly : `bool`, optional
48 If `True` (default) and ``inputCollection`` is a
49 `~CollectionType.CHAINED` collection, only search its first child
50 collection (which usually corresponds to the last processing run),
51 instead of all child collections in the chain. This behavior ensures
52 that datasets in a collection used as input to that processing run
53 are never included in the certification.
55 Additional arguments forwarded to `lsst.pipe.base.Task.__init__`.
57 _DefaultName =
'CertifyCalibration'
58 ConfigClass = pexConfig.Config
60 def __init__(self, *, registry, inputCollection, outputCollection, lastRunOnly=True, **kwargs):
65 inputCollection, _ = next(iter(self.
registry.getCollectionChain(inputCollection)))
72 def run(self, datasetTypeName, timespan):
73 """Certify all of the datasets of the given type in the input
78 datasetTypeName : `str`
79 Name of the dataset type to certify.
80 timespan : `lsst.daf.butler.Timespan`
81 Timespan for the validity range.
85 raise RuntimeError(f
"No inputs found for dataset {datasetTypeName} in {self.inputCollection}.")