22 from __future__
import absolute_import, division, print_function
23 from past.builtins
import basestring
24 from builtins
import object
26 from .cameraGeomLib
import FOCAL_PLANE
30 """!An immutable collection of Detectors that can be accessed by name or ID
34 """!Construct a DetectorCollection
36 @param[in] detectorList a sequence of detectors in index order
41 for detector
in detectorList:
42 for corner
in detector.getCorners(FOCAL_PLANE):
43 self._fpBBox.include(corner)
45 raise RuntimeError(
"Detector IDs are not unique")
47 raise RuntimeError(
"Detector names are not unique")
50 """!Support the iter function: return an iterator over all detectors in this collection
52 return iter(self._idDetectorDict.values())
55 """!Support the len function: return the number of detectors
60 """!Support the [key] operator: return the specified detector
62 @param[in] key detector name or ID
64 if isinstance(key, basestring):
70 """!Implement the "in" operator: return true if the specified detector is in the collection
72 @param[in] key detector name or ID
74 if isinstance(key, basestring):
80 """!Get an iterator over detector names
82 return iter(self._nameDetectorDict.keys())
85 """!Get an iterator over detector IDs
87 return iter(self._idDetectorDict.keys())
90 """!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.