ObservationDimensionPacker¶
- class lsst.daf.butler.instrument.ObservationDimensionPacker(*args, **kwargs)¶
Bases:
DimensionPacker
A
DimensionPacker
for visit+detector or exposure+detector, given an instrument.- Parameters:
- fixed
DataCoordinate
Expanded data ID for the dimensions whose values must remain fixed (to these values) in all calls to
pack
, and are used in the results of calls tounpack
. Subclasses may ignore particular dimensions, and are permitted to require thatfixed.hasRecords()
returnTrue
.- dimensions
DimensionGroup
orDimensionGraph
The dimensions of data IDs packed by this instance.
- .. deprecated:: v26
Deprecated in favor of configurable dimension packers. Will be removed after v26.
- fixed
Attributes Summary
The dimensions of data IDs packed by this instance (
DimensionGraph
).Return The maximum number of nonzero bits in the packed ID.
Graph containing all known dimensions (
DimensionUniverse
).Methods Summary
pack
([dataId, returnMaxBits])Pack the given data ID into a single integer.
unpack
(packedId)Unpack an ID produced by
pack
into a fullDataCoordinate
.Attributes Documentation
- dimensions¶
The dimensions of data IDs packed by this instance (
DimensionGraph
).After v27 this will be a
DimensionGroup
.
- maxBits¶
- universe¶
Graph containing all known dimensions (
DimensionUniverse
).
Methods Documentation
- pack(dataId: DataCoordinate | Mapping[str, Any] | None = None, *, returnMaxBits: bool = False, **kwargs: Any) tuple[int, int] | int ¶
Pack the given data ID into a single integer.
- Parameters:
- dataId
DataId
Data ID to pack. Values for any keys also present in the “fixed” data ID passed at construction must be the same as the values passed at construction, but in general you must still specify those keys.
- returnMaxBits
bool
If
True
, return a tuple of(packed, self.maxBits)
.- **kwargs
Additional keyword arguments are treated like additional key-value pairs in
dataId
.
- dataId
- Returns:
Notes
Should not be overridden by derived class (
_pack
should be overridden instead).
- unpack(packedId: int) DataCoordinate ¶
Unpack an ID produced by
pack
into a fullDataCoordinate
.Must be implemented by all concrete derived classes.
- Parameters:
- packedId
int
The result of a call to
pack
on eitherself
or an identically-constructed packer instance.
- packedId
- Returns:
- dataId
DataCoordinate
Dictionary-like ID that uniquely identifies all covered dimensions.
- dataId