62 Make a dictionary of WCSs at the reference boresight position.
67 Orientation in degrees. This angle is the position
68 angle of the focal plane +Y with respect to north.
73 Dictionary of WCS, with the detector id as the key.
75 _orientation = orientation*geom.degrees
77 visitInfo = afwImage.VisitInfo(boresightRaDec=self.
boresight,
78 boresightRotAngle=_orientation,
79 rotType=afwImage.RotType.SKY)
83 for detector
in self.
camera:
85 if not detector.getType() == afwCameraGeom.DetectorType.SCIENCE:
88 detectorId = detector.getId()
89 wcsDict[detectorId] = createInitialSkyWcs(visitInfo, detector, self.
flipX)
93 def __call__(self, orientation, nstep=100, use_cache=True):
95 Make a focal plane projection mapping for use with fgcm.
99 orientation : `float` or `int`
100 Camera orientation in degrees. This angle is the position
101 angle of the focal plane +Y with respect to north.
103 Number of steps in x/y per detector for the mapping.
104 use_cache : `bool`, optional
105 Use integerized cached lookup.
109 projectionMapping : `np.ndarray`
110 A projection mapping object with x, y, x_size, y_size,
111 delta_ra_cent, delta_dec_cent, delta_ra, delta_dec for
114 if not np.isfinite(orientation):
115 warnings.warn(
'Encountered non-finite orientation; using default.')
118 _orientation = orientation % 360
121 _orientation = int(_orientation)
151 Compute the focal plane projection.
155 orientation : `float` or `int`
156 Camera orientation in degrees. This angle is the position
157 angle of the focal plane +Y with respect to north.
159 Number of steps in x/y per detector for the mapping.
163 projectionMapping : `np.ndarray`
164 A projection mapping object with x, y, x_size, y_size,
165 delta_ra_cent, delta_dec_cent, delta_ra, delta_dec for
171 deltaMapper = np.zeros(
175 (
'x',
'f8', nstep**2),
176 (
'y',
'f8', nstep**2),
179 (
'delta_ra_cent',
'f8'),
180 (
'delta_dec_cent',
'f8'),
181 (
'delta_ra',
'f8', nstep**2),
182 (
'delta_dec',
'f8', nstep**2)
186 for detector
in self.
camera:
188 if not detector.getType() == afwCameraGeom.DetectorType.SCIENCE:
191 detectorId = detector.getId()
193 deltaMapper[
'id'][detectorId] = detectorId
195 xSize = detector.getBBox().getMaxX()
196 ySize = detector.getBBox().getMaxY()
198 xValues = np.linspace(0.0, xSize, nstep)
199 yValues = np.linspace(0.0, ySize, nstep)
201 deltaMapper[
'x'][detectorId, :] = np.repeat(xValues, yValues.size)
202 deltaMapper[
'y'][detectorId, :] = np.tile(yValues, xValues.size)
203 deltaMapper[
'x_size'][detectorId] = xSize
204 deltaMapper[
'y_size'][detectorId] = ySize
206 radec = wcsDict[detector.getId()].pixelToSkyArray(deltaMapper[
'x'][detectorId, :],
207 deltaMapper[
'y'][detectorId, :],
210 deltaMapper[
'delta_ra'][detectorId, :] = radec[0] - self.
boresight.getRa().asDegrees()
211 deltaMapper[
'delta_dec'][detectorId, :] = radec[1] - self.
boresight.getDec().asDegrees()
213 detCenter = wcsDict[detector.getId()].pixelToSky(detector.getCenter(afwCameraGeom.PIXELS))
214 deltaMapper[
'delta_ra_cent'][detectorId] = (detCenter.getRa()
216 deltaMapper[
'delta_dec_cent'][detectorId] = (detCenter.getDec()