LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector Class Reference
Inheritance diagram for lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector:

Public Member Functions

 __init__ (self, camera, defaultOrientation)
 
 __call__ (self, orientation, nstep=100, use_cache=True)
 

Public Attributes

 camera
 
 boresight
 
 flipX
 
 defaultOrientation
 

Protected Member Functions

 _makeWcsDict (self, orientation)
 
 _compute_cached_projection (self, orientation, nstep=50)
 
 _compute_projection (self, orientation, nstep=50)
 

Detailed Description

Class to project the focal plane onto the sky.

Parameters
----------
camera : `lsst.afw.cameraGeom.Camera`
    Camera from the butler.
defaultOrientation : `int`
    Default camera orientation in degrees.  This angle is the position
    angle of the focal plane +Y with respect to north.

Definition at line 37 of file focalPlaneProjector.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector.__init__ ( self,
camera,
defaultOrientation )

Definition at line 49 of file focalPlaneProjector.py.

49 def __init__(self, camera, defaultOrientation):
50 self.camera = camera
51
52 # Put the reference boresight at the equator to avoid cos(dec) problems.
53 self.boresight = geom.SpherePoint(180.0*geom.degrees, 0.0*geom.degrees)
54 self.flipX = False
55 self.defaultOrientation = int(defaultOrientation) % 360
56
Point in an unspecified spherical coordinate system.
Definition SpherePoint.h:57

Member Function Documentation

◆ __call__()

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector.__call__ ( self,
orientation,
nstep = 100,
use_cache = True )
Make a focal plane projection mapping for use with fgcm.

Parameters
----------
orientation : `float` or `int`
    Camera orientation in degrees.  This angle is the position
    angle of the focal plane +Y with respect to north.
nstep : `int`
    Number of steps in x/y per detector for the mapping.
use_cache : `bool`, optional
    Use integerized cached lookup.

Returns
-------
projectionMapping : `np.ndarray`
    A projection mapping object with x, y, x_size, y_size,
    delta_ra_cent, delta_dec_cent, delta_ra, delta_dec for
    each detector id.

Definition at line 86 of file focalPlaneProjector.py.

86 def __call__(self, orientation, nstep=100, use_cache=True):
87 """
88 Make a focal plane projection mapping for use with fgcm.
89
90 Parameters
91 ----------
92 orientation : `float` or `int`
93 Camera orientation in degrees. This angle is the position
94 angle of the focal plane +Y with respect to north.
95 nstep : `int`
96 Number of steps in x/y per detector for the mapping.
97 use_cache : `bool`, optional
98 Use integerized cached lookup.
99
100 Returns
101 -------
102 projectionMapping : `np.ndarray`
103 A projection mapping object with x, y, x_size, y_size,
104 delta_ra_cent, delta_dec_cent, delta_ra, delta_dec for
105 each detector id.
106 """
107 if not np.isfinite(orientation):
108 warnings.warn('Encountered non-finite orientation; using default.')
109 _orientation = self.defaultOrientation
110 else:
111 _orientation = orientation % 360
112
113 if use_cache:
114 _orientation = int(_orientation)
115
116 return self._compute_cached_projection(int(_orientation), nstep=nstep)
117 else:
118 return self._compute_projection(_orientation, nstep=nstep)
119

◆ _compute_cached_projection()

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector._compute_cached_projection ( self,
orientation,
nstep = 50 )
protected
Compute the focal plane projection, with caching.

Parameters
----------
orientation : `int`
    Camera orientation in degrees. This angle is the position
    angle of the focal plane +Y with respect to north.
nstep : `int`
    Number of steps in x/y per detector for the mapping.

Returns
-------
projectionMapping : `np.ndarray`
    A projection mapping object with x, y, x_size, y_size,
    delta_ra_cent, delta_dec_cent, delta_ra, delta_dec for
    each detector id.

Definition at line 121 of file focalPlaneProjector.py.

121 def _compute_cached_projection(self, orientation, nstep=50):
122 """
123 Compute the focal plane projection, with caching.
124
125 Parameters
126 ----------
127 orientation : `int`
128 Camera orientation in degrees. This angle is the position
129 angle of the focal plane +Y with respect to north.
130 nstep : `int`
131 Number of steps in x/y per detector for the mapping.
132
133 Returns
134 -------
135 projectionMapping : `np.ndarray`
136 A projection mapping object with x, y, x_size, y_size,
137 delta_ra_cent, delta_dec_cent, delta_ra, delta_dec for
138 each detector id.
139 """
140 return self._compute_projection(orientation, nstep=nstep)
141

◆ _compute_projection()

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector._compute_projection ( self,
orientation,
nstep = 50 )
protected
Compute the focal plane projection.

Parameters
----------
orientation : `float` or `int`
    Camera orientation in degrees. This angle is the position
    angle of the focal plane +Y with respect to north.
nstep : `int`
    Number of steps in x/y per detector for the mapping.

Returns
-------
projectionMapping : `np.ndarray`
    A projection mapping object with x, y, x_size, y_size,
    delta_ra_cent, delta_dec_cent, delta_ra, delta_dec for
    each detector id.

Definition at line 142 of file focalPlaneProjector.py.

142 def _compute_projection(self, orientation, nstep=50):
143 """
144 Compute the focal plane projection.
145
146 Parameters
147 ----------
148 orientation : `float` or `int`
149 Camera orientation in degrees. This angle is the position
150 angle of the focal plane +Y with respect to north.
151 nstep : `int`
152 Number of steps in x/y per detector for the mapping.
153
154 Returns
155 -------
156 projectionMapping : `np.ndarray`
157 A projection mapping object with x, y, x_size, y_size,
158 delta_ra_cent, delta_dec_cent, delta_ra, delta_dec for
159 each detector id.
160 """
161 wcsDict = self._makeWcsDict(orientation)
162
163 # Need something for the max detector ...
164 deltaMapper = np.zeros(len(self.camera), dtype=[('id', 'i4'),
165 ('x', 'f8', nstep**2),
166 ('y', 'f8', nstep**2),
167 ('x_size', 'i4'),
168 ('y_size', 'i4'),
169 ('delta_ra_cent', 'f8'),
170 ('delta_dec_cent', 'f8'),
171 ('delta_ra', 'f8', nstep**2),
172 ('delta_dec', 'f8', nstep**2)])
173
174 for detector in self.camera:
175 detectorId = detector.getId()
176
177 deltaMapper['id'][detectorId] = detectorId
178
179 xSize = detector.getBBox().getMaxX()
180 ySize = detector.getBBox().getMaxY()
181
182 xValues = np.linspace(0.0, xSize, nstep)
183 yValues = np.linspace(0.0, ySize, nstep)
184
185 deltaMapper['x'][detectorId, :] = np.repeat(xValues, yValues.size)
186 deltaMapper['y'][detectorId, :] = np.tile(yValues, xValues.size)
187 deltaMapper['x_size'][detectorId] = xSize
188 deltaMapper['y_size'][detectorId] = ySize
189
190 radec = wcsDict[detector.getId()].pixelToSkyArray(deltaMapper['x'][detectorId, :],
191 deltaMapper['y'][detectorId, :],
192 degrees=True)
193
194 deltaMapper['delta_ra'][detectorId, :] = radec[0] - self.boresight.getRa().asDegrees()
195 deltaMapper['delta_dec'][detectorId, :] = radec[1] - self.boresight.getDec().asDegrees()
196
197 detCenter = wcsDict[detector.getId()].pixelToSky(detector.getCenter(afwCameraGeom.PIXELS))
198 deltaMapper['delta_ra_cent'][detectorId] = (detCenter.getRa()
199 - self.boresight.getRa()).asDegrees()
200 deltaMapper['delta_dec_cent'][detectorId] = (detCenter.getDec()
201 - self.boresight.getDec()).asDegrees()
202
203 return deltaMapper

◆ _makeWcsDict()

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector._makeWcsDict ( self,
orientation )
protected
Make a dictionary of WCSs at the reference boresight position.

Parameters
----------
orientation : `int`
    Orientation in degrees.  This angle is the position
    angle of the focal plane +Y with respect to north.

Returns
-------
wcsDict : `dict`
    Dictionary of WCS, with the detector id as the key.

Definition at line 57 of file focalPlaneProjector.py.

57 def _makeWcsDict(self, orientation):
58 """
59 Make a dictionary of WCSs at the reference boresight position.
60
61 Parameters
62 ----------
63 orientation : `int`
64 Orientation in degrees. This angle is the position
65 angle of the focal plane +Y with respect to north.
66
67 Returns
68 -------
69 wcsDict : `dict`
70 Dictionary of WCS, with the detector id as the key.
71 """
72 _orientation = orientation*geom.degrees
73
74 visitInfo = afwImage.VisitInfo(boresightRaDec=self.boresight,
75 boresightRotAngle=_orientation,
76 rotType=afwImage.RotType.SKY)
77
78 wcsDict = {}
79
80 for detector in self.camera:
81 detectorId = detector.getId()
82 wcsDict[detectorId] = createInitialSkyWcs(visitInfo, detector, self.flipX)
83
84 return wcsDict
85
Information about a single exposure of an imaging camera.
Definition VisitInfo.h:68

Member Data Documentation

◆ boresight

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector.boresight

Definition at line 53 of file focalPlaneProjector.py.

◆ camera

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector.camera

Definition at line 50 of file focalPlaneProjector.py.

◆ defaultOrientation

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector.defaultOrientation

Definition at line 55 of file focalPlaneProjector.py.

◆ flipX

lsst.fgcmcal.focalPlaneProjector.FocalPlaneProjector.flipX

Definition at line 54 of file focalPlaneProjector.py.


The documentation for this class was generated from the following file: