22 from .cameraGeomLib
import FOCAL_PLANE, PIXELS
23 from .detectorCollection
import DetectorCollection
24 from .pupil
import PupilFactory
29 """!A collection of Detectors plus additional coordinate system support 31 Camera.transform transforms points from one camera coordinate system to another. 33 Camera.getTransform returns a transform between camera coordinate systems. 35 Camera.findDetectors finds all detectors overlapping a specified point. 38 def __init__(self, name, detectorList, transformMap, pupilFactoryClass=PupilFactory):
39 """!Construct a Camera 41 @param[in] name name of camera 42 @param[in] detectorList a sequence of detectors in index order 43 @param[in] transformMap a TransformMap that at least supports 44 FOCAL_PLANE and FIELD_ANGLE coordinates 45 @param[in] pupilFactoryClass a PupilFactory class for this camera 46 [default: afw.cameraGeom.PupilFactory] 52 super(Camera, self).
__init__(detectorList)
55 """!Return the camera name 60 """!Construct a PupilFactory. 62 @param[in] visitInfo VisitInfo object for a particular exposure. 63 @param[in] pupilSize Size in meters of constructed Pupil array. 64 Note that this may be larger than the actual 65 diameter of the illuminated pupil to 66 accommodate zero-padding. 67 @param[in] npix Constructed Pupils will be npix x npix. 68 @param[in] kwargs Other keyword arguments for the pupil factory 76 def _getTransformFromOneTransformMap(self, fromSys, toSys):
77 """!Get a transform from one TransformMap 79 `fromSys` and `toSys` must both be present in the same transform map, 80 but that transform map may be from any detector or this camera object. 82 @param[in] fromSys Camera coordinate system of `position` 84 @param[in] toSys Camera coordinate system of returned point(s) 86 @return an lsst.afw.geom.TransformPoint2ToPoint2 that transforms from 87 `fromSys` to `toSys` in the forward direction 89 @throws lsst.pex.exceptions.InvalidParameter if no transform is 90 available. This includes the case that fromSys specifies a known 91 detector and toSys specifies any other detector (known or unknown) 92 @throws KeyError if an unknown detector is specified 94 if fromSys.hasDetectorName():
95 det = self[fromSys.getDetectorName()]
96 return det.getTransformMap().
getTransform(fromSys, toSys)
97 elif toSys.hasDetectorName():
98 det = self[toSys.getDetectorName()]
99 return det.getTransformMap().
getTransform(fromSys, toSys)
104 """!Find the detectors that cover a point in any camera system 106 @param[in] point position to use in lookup (lsst.afw.geom.Point2D) 107 @param[in] cameraSys camera coordinate system of `point` 108 @return a list of zero or more Detectors that overlap the specified point 112 nativePoint = transform.applyForward(point)
115 for detector
in self:
117 pointPixels = nativeToPixels.applyForward(nativePoint)
119 detectorList.append(detector)
123 """!Find the detectors that cover a list of points in any camera system 125 @param[in] pointList a list of points (lsst.afw.geom.Point2D) 126 @param[in] cameraSys the camera coordinate system of the points in `pointList` 127 @return a list of lists; each list contains the names of all detectors 128 which contain the corresponding point 133 nativePointList = transform.applyForward(pointList)
136 for i
in range(len(pointList)):
137 detectorList.append([])
139 for detector
in self:
140 pixelSys = detector.makeCameraSys(PIXELS)
142 detectorPointList = transform.applyForward(nativePointList)
144 for i, pt
in enumerate(detectorPointList):
146 detectorList[i].append(detector)
151 """!Get a transform from one CameraSys to another 153 @param[in] fromSys From CameraSys 154 @param[in] toSys To CameraSys 155 @return an lsst.afw.geom.TransformPoint2ToPoint2 that transforms from 156 `fromSys` to `toSys` in the forward direction 158 @throws lsst.pex.exceptions.InvalidParameter if no transform is 160 @throws KeyError if an unknown detector is specified 165 return fromSysToNative.then(nativeToToSys)
168 """!Obtain the transform registry. 170 @return a TransformMap 172 @note: TransformRegistries are immutable, so this should be safe. 177 """!Transform a point or list of points from one camera coordinate system 180 @param[in] points an lsst.afw.geom.Point2D or list of Point2D 181 @param[in] fromSys Transform from this CameraSys 182 @param[in] toSys Transform to this CameraSys 183 @return `points` transformed to `toSys` (an lsst.afw.geom.Point2D 187 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.
A floating-point coordinate rectangle geometry.
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.