24 from .cameraGeomLib
import FOCAL_PLANE, PIXELS
25 from .detectorCollection
import DetectorCollection
26 from .pupil
import PupilFactory
30 """!A collection of Detectors plus additional coordinate system support 32 Camera.transform transforms points from one camera coordinate system to another. 34 Camera.getTransform returns a transform between camera coordinate systems. 36 Camera.findDetectors finds all detectors overlapping a specified point. 39 def __init__(self, name, detectorList, transformMap, pupilFactoryClass=PupilFactory):
40 """!Construct a Camera 42 @param[in] name name of camera 43 @param[in] detectorList a sequence of detectors in index order 44 @param[in] transformMap a TransformMap that at least supports 45 FOCAL_PLANE and FIELD_ANGLE coordinates 46 @param[in] pupilFactoryClass a PupilFactory class for this camera 47 [default: afw.cameraGeom.PupilFactory] 53 super(Camera, self).
__init__(detectorList)
56 """!Return the camera name 61 """!Construct a PupilFactory. 63 @param[in] visitInfo VisitInfo object for a particular exposure. 64 @param[in] pupilSize Size in meters of constructed Pupil array. 65 Note that this may be larger than the actual 66 diameter of the illuminated pupil to 67 accommodate zero-padding. 68 @param[in] npix Constructed Pupils will be npix x npix. 69 @param[in] kwargs Other keyword arguments for the pupil factory 77 def _getTransformFromOneTransformMap(self, fromSys, toSys):
78 """!Get a transform from one TransformMap 80 `fromSys` and `toSys` must both be present in the same transform map, 81 but that transform map may be from any detector or this camera object. 83 @param[in] fromSys Camera coordinate system of `position` 85 @param[in] toSys Camera coordinate system of returned point(s) 87 @return an lsst.afw.geom.TransformPoint2ToPoint2 that transforms from 88 `fromSys` to `toSys` in the forward direction 90 @throws lsst.pex.exceptions.InvalidParameterError if no transform is 91 available. This includes the case that fromSys specifies a known 92 detector and toSys specifies any other detector (known or unknown) 93 @throws KeyError if an unknown detector is specified 95 if fromSys.hasDetectorName():
96 det = self[fromSys.getDetectorName()]
97 return det.getTransformMap().
getTransform(fromSys, toSys)
98 elif toSys.hasDetectorName():
99 det = self[toSys.getDetectorName()]
100 return det.getTransformMap().
getTransform(fromSys, toSys)
105 """!Find the detectors that cover a point in any camera system 107 @param[in] point position to use in lookup (lsst.geom.Point2D) 108 @param[in] cameraSys camera coordinate system of `point` 109 @return a list of zero or more Detectors that overlap the specified point 113 nativePoint = transform.applyForward(point)
116 for detector
in self:
118 pointPixels = nativeToPixels.applyForward(nativePoint)
120 detectorList.append(detector)
124 """!Find the detectors that cover a list of points in any camera system 126 @param[in] pointList a list of points (lsst.geom.Point2D) 127 @param[in] cameraSys the camera coordinate system of the points in `pointList` 128 @return a list of lists; each list contains the names of all detectors 129 which contain the corresponding point 134 nativePointList = transform.applyForward(pointList)
137 for i
in range(len(pointList)):
138 detectorList.append([])
140 for detector
in self:
141 pixelSys = detector.makeCameraSys(PIXELS)
143 detectorPointList = transform.applyForward(nativePointList)
145 for i, pt
in enumerate(detectorPointList):
147 detectorList[i].append(detector)
152 """!Get a transform from one CameraSys to another 154 @param[in] fromSys From CameraSys 155 @param[in] toSys To CameraSys 156 @return an lsst.afw.geom.TransformPoint2ToPoint2 that transforms from 157 `fromSys` to `toSys` in the forward direction 159 @throws lsst.pex.exceptions.InvalidParameterError if no transform is 161 @throws KeyError if an unknown detector is specified 168 except InvalidParameterError:
175 return fromSysToNative.then(nativeToToSys)
178 """!Obtain the transform registry. 180 @return a TransformMap 182 @note: TransformRegistries are immutable, so this should be safe. 187 """!Transform a point or list of points from one camera coordinate system 190 @param[in] points an lsst.geom.Point2D or list of Point2D 191 @param[in] fromSys Transform from this CameraSys 192 @param[in] toSys Transform to this CameraSys 193 @return `points` transformed to `toSys` (an lsst.geom.Point2D 197 return transform.applyForward(points)
def __init__(self, name, detectorList, transformMap, pupilFactoryClass=PupilFactory)
Construct a Camera.
def getTransformMap(self)
Obtain the transform registry.
def getName(self)
Return the camera name.
def getPupilFactory(self, visitInfo, pupilSize, npix, kwargs)
Construct a PupilFactory.
def findDetectors(self, point, cameraSys)
Find the detectors that cover a point in any camera system.
def getTransform(self, fromSys, toSys)
Get a transform from one CameraSys to another.
def _getTransformFromOneTransformMap(self, fromSys, toSys)
Get a transform from one TransformMap.
def transform(self, points, fromSys, toSys)
Transform a point or list of points from one camera coordinate system to another. ...
def telescopeDiameter(self)
A collection of Detectors plus additional coordinate system support.
def findDetectorsList(self, pointList, cameraSys)
Find the detectors that cover a list of points in any camera system.
An immutable collection of Detectors that can be accessed by name or ID.