DimensionPacker¶
- class lsst.daf.butler.DimensionPacker(fixed: DataCoordinate, dimensions: DimensionGraph)¶
- Bases: - object- Class for going from - DataCoordinateto packed integer ID and back.- An abstract base class for bidirectional mappings between a - DataCoordinateand a packed integer ID.- Parameters:
- fixedDataCoordinate
- 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 to- unpack.- fixed.hasRecords()must return- True.
- dimensionsDimensionGraph
- The dimensions of data IDs packed by this instance. 
 
- fixed
 - Attributes Summary - 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 - packinto a full- DataCoordinate.- Attributes Documentation - maxBits¶
- Return The maximum number of nonzero bits in the packed ID. - This packed ID will be returned by - pack(- int).- Must be implemented by all concrete derived classes. May return - Noneto indicate that there is no maximum.
 - universe¶
- Graph containing all known dimensions ( - DimensionUniverse).
 - Methods Documentation - pack(dataId: DataCoordinate | Mapping[str, Any], *, returnMaxBits: bool = False, **kwargs: Any) Tuple[int, int] | int¶
- Pack the given data ID into a single integer. - Parameters:
- dataIdDataId
- 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. 
- returnMaxBitsbool
- If - True, return a tuple of- (packed, self.maxBits).
- **kwargs
- Additional keyword arguments forwarded to - DataCoordinate.standardize.
 
- dataId
- Returns:
 - Notes - Should not be overridden by derived class ( - _packshould be overridden instead).
 - abstract unpack(packedId: int) DataCoordinate¶
- Unpack an ID produced by - packinto a full- DataCoordinate.- Must be implemented by all concrete derived classes. - Parameters:
- Returns:
- dataIdDataCoordinate
- Dictionary-like ID that uniquely identifies all covered dimensions. 
 
- dataId