DimensionDataExtractor¶
- class lsst.daf.butler.DimensionDataExtractor(records: dict[str, lsst.daf.butler.dimensions._record_set.DimensionRecordSet] = <factory>)¶
Bases:
object
A helper class for extracting dimension records from expanded data IDs (e.g. for normalized serialization).
Instances of this class must be initialized with empty sets (usually by one of the class method factories) with all of the dimension elements that should be extracted from the data IDs passed to
update_homogeneous
orupdate_heterogeneous
. Dimension elements not included will not be extracted (which may be useful).Methods Summary
from_dimension_group
(dimensions, *[, ...])Construct from a
DimensionGroup
and a set of dimension element names to ignore.from_element_names
(element_names, universe)Construct from an iterable of dimension element names.
update
(data_ids)Extract dimension records from an iterable of data IDs.
Methods Documentation
- classmethod from_dimension_group(dimensions: DimensionGroup, *, ignore: Iterable[str] = (), ignore_cached: bool = False, include_skypix: bool = False) DimensionDataExtractor ¶
Construct from a
DimensionGroup
and a set of dimension element names to ignore.- Parameters:
- dimensions
DimensionGroup
Dimensions that span the set of elements whose elements are to be extracted.
- ignore
Iterable
[str
], optional Names of dimension elements that should not be extracted.
- ignore_cached
bool
, optional If
True
, ignore all dimension elements for whichDimensionElement.is_cached
isTrue
.- include_skypix
bool
, optional If
True
, include skypix dimensions. These are ignored by default because they can always be recomputed from their IDs on-the-fly.
- dimensions
- Returns:
- extractor
DimensionDataExtractor
New extractor.
- extractor
- classmethod from_element_names(element_names: Iterable[str], universe: DimensionUniverse) DimensionDataExtractor ¶
Construct from an iterable of dimension element names.
- Parameters:
- element_names
Iterable
[str
] Names of dimension elements to include.
- universe
DimensionUniverse
Definitions of all dimensions.
- element_names
- Returns:
- extractor
DimensionDataExtractor
New extractor.
- extractor
- update(data_ids: Iterable[DataCoordinate]) None ¶
Extract dimension records from an iterable of data IDs.
- Parameters:
- data_ids
Iterable
[DataCoordinate
] Data IDs to extract dimension records from.
- data_ids