22 from __future__
import absolute_import, division
24 from .cameraGeomLib
import FOCAL_PLANE
27 """!An immutable collection of Detectors that can be accessed by name or ID
30 """!Construct a DetectorCollection
32 @param[in] detectorList a sequence of detectors in index order
37 for detector
in detectorList:
38 for corner
in detector.getCorners(FOCAL_PLANE):
39 self._fpBBox.include(corner)
41 raise RuntimeError(
"Detector IDs are not unique")
43 raise RuntimeError(
"Detector names are not unique")
46 """!Support the iter function: return an iterator over all detectors in this collection
48 return self._idDetectorDict.itervalues()
51 """!Support the len function: return the number of detectors
56 """!Support the [key] operator: return the specified detector
58 @param[in] key detector name or ID
60 if isinstance(key, basestring):
66 """!Implement the "in" operator: return true if the specified detector is in the collection
68 @param[in] key detector name or ID
70 if isinstance(key, basestring):
76 """!Get an iterator over detector names
78 return self._nameDetectorDict.iterkeys()
81 """!Get an iterator over detector IDs
83 return self._idDetectorDict.iterkeys()
86 """!Return a focal plane bounding box that encompasses all detectors
def __contains__
Implement the "in" operator: return true if the specified detector is in the collection.
def __iter__
Support the iter function: return an iterator over all detectors in this collection.
def getFpBBox
Return a focal plane bounding box that encompasses all detectors.
def getNameIter
Get an iterator over detector names.
def __init__
Construct a DetectorCollection.
def __getitem__
Support the [key] operator: return the specified detector.
def __len__
Support the len function: return the number of detectors.
A floating-point coordinate rectangle geometry.
def getIdIter
Get an iterator over detector IDs.
An immutable collection of Detectors that can be accessed by name or ID.