DataIdContainer

class lsst.pipe.base.DataIdContainer(level=None)

Bases: object

Container for data IDs and associated data references.

Parameters:
levelstr

The lowest hierarchy level to descend to for this dataset type, for example "amp" for "raw" or "ccd" for "calexp". Use "" to use the mapper’s default for the dataset type. This class does not support None, but if it did, None would mean the level should not be restricted.

Notes

Override this class for data IDs that require special handling to be converted to data references, and specify the override class as ContainerClass for add_id_argument.

If you don’t want the argument parser to compute data references, specify doMakeDataRefList=False in add_id_argument.

Methods Summary

castDataIds(butler)

Validate data IDs and cast them to the correct type (modify idList in place).

makeDataRefList(namespace)

Compute refList based on idList.

setDatasetType(datasetType)

Set actual dataset type, once it is known.

Methods Documentation

castDataIds(butler)

Validate data IDs and cast them to the correct type (modify idList in place).

This code casts the values in the data IDs dicts in dataIdList to the type required by the butler. Data IDs are read from the command line as str, but the butler requires some values to be other types. For example “visit” values should be int.

Parameters:
butlerlsst.daf.persistence.Butler

Data butler.

makeDataRefList(namespace)

Compute refList based on idList.

Parameters:
namespaceargparse.Namespace

Results of parsing command-line. The butler and log elements must be set.

Notes

Not called if add_id_argument was called with doMakeDataRefList=False.

setDatasetType(datasetType)

Set actual dataset type, once it is known.

Parameters:
datasetTypestr

Dataset type.

Notes

The reason datasetType is not a constructor argument is that some subclasses do not know the dataset type until the command is parsed. Thus, to reduce special cases in the code, datasetType is always set after the command is parsed.