ObservationDimensionPacker¶
- class lsst.pipe.base.ObservationDimensionPacker(data_id: DataCoordinate, config: ObservationDimensionPackerConfig | None = None, is_exposure: bool | None = None)¶
- Bases: - DimensionPacker- A - DimensionPackerfor visit+detector or exposure+detector.- Parameters:
- data_idlsst.daf.butler.DataCoordinate
- Data ID that identifies at least the - instrumentdimension. Must have dimension records attached unless- config.n_detectorsand- config.n_visitsare both not- None.
- configObservationDimensionPackerConfig, optional
- Configuration for this dimension packer. 
- is_exposurebool, optional
- If - False, construct a packer for visit+detector data IDs. If- True, construct a packer for exposure+detector data IDs. If- None, this is determined based on whether- visitor- exposureis present in- data_id, with- visitchecked first and hence used if both are present.
 
- data_id
 - Notes - The standard pattern for constructing instances of the class is to use - Instrument.make_dimension_packer; see that method for details.- This packer assumes all visit/exposure and detector IDs are sequential or otherwise densely packed between zero and their upper bound, such that - n_detectors*- n_observationsleaves plenty of bits remaining for any other IDs that need to be included in the same integer (such as a counter for Sources detected on an image with this data ID). Instruments whose data ID values are not densely packed, should provide their own- DimensionPackerthat takes advantage of the structure of its IDs to compress them into fewer bits.- 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 - packinto a full- DataCoordinate.- 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:
- 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).
 - unpack(packedId: int) DataCoordinate¶
- Unpack an ID produced by - packinto a full- DataCoordinate.- Must be implemented by all concrete derived classes. - Parameters:
- packedIdint
- The result of a call to - packon either- selfor an identically-constructed packer instance.
 
- packedId
- Returns:
- dataIdDataCoordinate
- Dictionary-like ID that uniquely identifies all covered dimensions. 
 
- dataId