128 """Compute the radial and tangential pixel scales using the distortion
129 model supplied with the camera.
131 This is designed to be directly comparable with the results of
132 `~CameraModel.computePixelScale`.
137 Detector identifier for the detector_id to use for the calculation.
141 fieldAngle : `numpy.ndarray`
142 Field angles in degrees.
143 radialScale : `numpy.ndarray`
144 Radial direction pixel scales in arcseconds/pixel.
145 tangentialScale : `numpy.ndarray`
146 Tangential direction pixel scales in arcseconds/pixel.
151 iwcToSkyMap = iwcToSkyWcs.getFrameDict().getMapping(
"PIXELS",
"SKY")
152 skyFrame = iwcToSkyWcs.getFrameDict().getFrame(
"SKY")
155 pixSys = self.
camera[detector_id].makeCameraSys(cameraGeom.PIXELS)
156 pixelsToFocal = self.
camera.getTransform(pixSys, cameraGeom.FOCAL_PLANE)
157 focalToField = self.
camera.getTransform(cameraGeom.FOCAL_PLANE, cameraGeom.FIELD_ANGLE)
160 pixelFrame =
ast.Frame(2,
"Domain=PIXELS")
161 focalFrame =
ast.Frame(2,
"Domain=FOCAL")
164 frameDict.addFrame(
"PIXELS", pixelsToFocal.getMapping(), focalFrame)
165 frameDict.addFrame(
"FOCAL", focalToField.getMapping(), iwcFrame)
166 frameDict.addFrame(
"IWC", iwcToSkyMap, skyFrame)
172 """Compute pixel scale in radial and tangential directions as a
173 function of field angle.
178 Detector identifier for the detector of this wcs.
179 wcs : `lsst.afw.geom.SkyWcs`
180 Full focal-plane model to compute pixel scale on.
184 fieldAngle : `numpy.ndarray`
185 Field angles in degrees.
186 radialScale : `numpy.ndarray`
187 Radial direction pixel scales in arcseconds/pixel.
188 tangentialScale : `numpy.ndarray`
189 Tangential direction pixel scales in arcseconds/pixel.
193 Pixel scales are calculated from finite differences only along the +y
194 focal plane direction.
196 focalToSky = wcs.getFrameDict().getMapping(
'FOCAL',
'SKY')
197 mmPerPixel = self.
camera[detector_id].getPixelSize()
199 focalToPixels = wcs.getFrameDict().getMapping(
'FOCAL',
'PIXELS')
200 trans = wcs.getTransform()
201 boresight = trans.applyForward(Point2D(focalToPixels.applyForward([0, 0])))
204 fieldAngle = np.zeros_like(rs)
205 radialScale = np.zeros_like(rs)
206 tangentialScale = np.zeros_like(rs)
209 sp1 =
SpherePoint(*focalToSky.applyForward(Point2D([0, r])), radians)
211 sp2 =
SpherePoint(*focalToSky.applyForward(Point2D([0, r + mmPerPixel.getY()])), radians)
213 sp3 =
SpherePoint(*focalToSky.applyForward(Point2D([mmPerPixel.getX(), r])), radians)
214 fieldAngle[i] = boresight.separation(sp1).asDegrees()
215 radialScale[i] = sp1.separation(sp2).asArcseconds()
216 tangentialScale[i] = sp1.separation(sp3).asArcseconds()
217 return fieldAngle, radialScale, tangentialScale