lsst.pipe.base  21.0.0-17-g8839fe5+8c52784213
Public Member Functions | Public Attributes | List of all members
lsst.pipe.base.argumentParser.DataIdContainer Class Reference

Public Member Functions

def __init__ (self, level=None)
 
def setDatasetType (self, datasetType)
 
def castDataIds (self, butler)
 
def makeDataRefList (self, namespace)
 

Public Attributes

 datasetType
 
 level
 
 idList
 
 refList
 

Detailed Description

Container for data IDs and associated data references.

Parameters
----------
level : `str`
    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``.

Definition at line 75 of file argumentParser.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.base.argumentParser.DataIdContainer.__init__ (   self,
  level = None 
)

Definition at line 97 of file argumentParser.py.

Member Function Documentation

◆ castDataIds()

def lsst.pipe.base.argumentParser.DataIdContainer.castDataIds (   self,
  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
----------
butler : `lsst.daf.persistence.Butler`
    Data butler.

Definition at line 133 of file argumentParser.py.

◆ makeDataRefList()

def lsst.pipe.base.argumentParser.DataIdContainer.makeDataRefList (   self,
  namespace 
)
Compute refList based on idList.

Parameters
----------
namespace : `argparse.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``.

Definition at line 176 of file argumentParser.py.

◆ setDatasetType()

def lsst.pipe.base.argumentParser.DataIdContainer.setDatasetType (   self,
  datasetType 
)
Set actual dataset type, once it is known.

Parameters
----------
datasetType : `str`
    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.

Definition at line 116 of file argumentParser.py.

Member Data Documentation

◆ datasetType

lsst.pipe.base.argumentParser.DataIdContainer.datasetType

Definition at line 98 of file argumentParser.py.

◆ idList

lsst.pipe.base.argumentParser.DataIdContainer.idList

Definition at line 104 of file argumentParser.py.

◆ level

lsst.pipe.base.argumentParser.DataIdContainer.level

Definition at line 101 of file argumentParser.py.

◆ refList

lsst.pipe.base.argumentParser.DataIdContainer.refList

Definition at line 108 of file argumentParser.py.


The documentation for this class was generated from the following file: