23 __all__ = [
"ExposureIdInfo"]
27 """Exposure ID and number of bits used. 34 maximum number of bits allowed for exposure IDs 36 maximum number of bits available for values that combine exposure ID 37 with other information, such as source ID 39 maximum number of bits available for non-exposure info (maxBits - expBits) 41 One common use is creating an ID factory for making a source table. 42 For example, given a data butler `butler` and a data ID `dataId`:: 44 from lsst.afw.table import IdFactory, SourceTable 45 exposureIdInfo = butler.get("expIdInfo", dataId) 46 sourceIdFactory = IdFactory.makeSource(exposureIdInfo.expId, exposureIdInfo.unusedBits) 47 schema = SourceTable.makeMinimalSchema() 48 #...add fields to schema as desired, then... 49 sourceTable = SourceTable.make(self.schema, sourceIdFactory) 51 At least one bit must be reserved, even if there is no exposure ID, for reasons 52 that are not entirely clear (this is DM-6664). 55 def __init__(self, expId=0, expBits=1, maxBits=64):
56 """Construct an ExposureIdInfo 58 See the class doc string for an explanation of the arguments. 61 expBits = int(expBits)
62 maxBits = int(maxBits)
64 if expId.bit_length() > expBits:
65 raise RuntimeError(
"expId=%s uses %s bits > expBits=%s" % (expId, expId.bit_length(), expBits))
67 raise RuntimeError(
"expBits=%s > maxBits=%s" % (expBits, maxBits))
def __init__(self, expId=0, expBits=1, maxBits=64)