DimensionDataAttacher¶
- class lsst.daf.butler.DimensionDataAttacher(*, records: Iterable[DimensionRecordSet] = (), deserializers: Iterable[DimensionRecordSetDeserializer] = (), cache: DimensionRecordCache | None = None, dimensions: DimensionGroup | None = None)¶
Bases:
object
A helper class for attaching dimension records to data IDs.
- Parameters:
- records
dict
[str
,DimensionRecordSet
], optional Regular dimension record sets, keyed by dimension element name. Not copied, and may be modified in-place.
- deserializers
dict
[str
,DimensionRecordSetDeserializer
], optional Partially-deserialized dimension records, keyed by dimension element name. Records will be fully deserialized on demand and then cached.
- cache
DimensionRecordCache
, optional A cache of dimension records from a butler instance. If present, this is assumed to have records for elements that are not in
records
anddeserializers
.- dimensions
DimensionGroup
, optional Dimensions for which empty record sets should be added when no other source of records is given. This allows data IDs with these dimensions to have records attached by fetching them via the
query
argument to theattach
method, or by computing regions on the skypix dimensions.
- records
Methods Summary
attach
(dimensions, data_ids[, query])Attach dimension records to data IDs.
Methods Documentation
- attach(dimensions: DimensionGroup, data_ids: Iterable[DataCoordinate], query: Query | None = None) list[DataCoordinate] ¶
Attach dimension records to data IDs.
- Parameters:
- dimensions
DimensionGroup
Dimensions of all given data IDs. All dimension elements must have been referenced in at least one of the constructor arguments.
- data_ids
Iterable
[DataCoordinate
] Data IDs to attach dimension records to (not in place; data coordinates are immutable). Must have full values (i.e. implied as well as required dimensions).
- query
queries.Query
, optional A butler query that can be used to look up missing dimension records. Records fetched via query are cached in the
records
attribute.
- dimensions
- Returns:
- expanded
list
[DataCoordinate
] Data IDs with dimension records attached, in the same order as the original iterable.
- expanded