1313
1414
1515def rotate (
16- point : NDArray [np .float32 ],
17- end_point1 : NDArray [np .float32 ],
18- end_point2 : NDArray [np .float32 ],
19- theta : np .float32 ,
20- ) -> NDArray [np .float32 ]:
16+ point : NDArray [np .float64 ],
17+ end_point1 : NDArray [np .float64 ],
18+ end_point2 : NDArray [np .float64 ],
19+ theta : np .float64 ,
20+ ) -> NDArray [np .float64 ]:
2121 """
2222 Rotate a point about an axis
2323
2424 Parameters
2525 ----------
26- point : NDArray[np.float32 ]
26+ point : NDArray[np.float64 ]
2727 The point to rotate
28- end_point1 : NDArray[np.float32 ]
28+ end_point1 : NDArray[np.float64 ]
2929 A point on the axis of rotation
30- end_point2 : NDArray[np.float32 ]
30+ end_point2 : NDArray[np.float64 ]
3131 Another point on the axis of rotation
32- theta: NDArray[np.float32 ]
32+ theta: NDArray[np.float64 ]
3333 Angle in radians to rotate by
3434
3535 Returns
3636 -------
37- point : NDArray[np.float32 ]
37+ point : NDArray[np.float64 ]
3838 The rotated point
3939 """
4040 origin = np .mean ((end_point1 , end_point2 ))
@@ -46,34 +46,34 @@ def rotate(
4646
4747
4848def rotate_panel (
49- points : NDArray [np .float32 ],
50- adjustors : NDArray [np .float32 ],
51- thetha_0 : np .float32 ,
52- thetha_1 : np .float32 ,
53- ) -> Tuple [NDArray [np .float32 ], NDArray [np .float32 ]]:
49+ points : NDArray [np .float64 ],
50+ adjustors : NDArray [np .float64 ],
51+ thetha_0 : np .float64 ,
52+ thetha_1 : np .float64 ,
53+ ) -> Tuple [NDArray [np .float64 ], NDArray [np .float64 ]]:
5454 """
5555 Rotate panel about axes created by adjustors.
5656
5757 Parameters
5858 ----------
59- points : NDArray[np.float32 ]
59+ points : NDArray[np.float64 ]
6060 Points on panel to rotate.
61- adjustors : NDArray[np.float32 ]
61+ adjustors : NDArray[np.float64 ]
6262 Adjustor positions.
63- thetha_0 : np.float32
63+ thetha_0 : np.float64
6464 Angle to rotate about first adjustor axis
65- thetha_1 : np.float32 .
65+ thetha_1 : np.float64 .
6666 Angle to rotate about second adjustor axis
6767
6868 Returns
6969 -------
70- rot_points : NDArray[np.float32 ]
70+ rot_points : NDArray[np.float64 ]
7171 The rotated points.
72- rot_adjustors : NDArray[np.float32 ]
72+ rot_adjustors : NDArray[np.float64 ]
7373 The rotated adjustors.
7474 """
75- rot_points = np .zeros (points .shape , np .float32 )
76- rot_adjustors = np .zeros (adjustors .shape , np .float32 )
75+ rot_points = np .zeros (points .shape , np .float64 )
76+ rot_adjustors = np .zeros (adjustors .shape , np .float64 )
7777
7878 n_points = len (points )
7979 n_adjustors = len (adjustors )
@@ -90,51 +90,51 @@ def rotate_panel(
9090
9191
9292def translate_panel (
93- points : NDArray [np .float32 ],
94- adjustors : NDArray [np .float32 ],
95- dx : np .float32 ,
96- dy : np .float32 ,
97- dz : np .float32 ,
98- ) -> Tuple [NDArray [np .float32 ], NDArray [np .float32 ]]:
93+ points : NDArray [np .float64 ],
94+ adjustors : NDArray [np .float64 ],
95+ dx : np .float64 ,
96+ dy : np .float64 ,
97+ dz : np .float64 ,
98+ ) -> Tuple [NDArray [np .float64 ], NDArray [np .float64 ]]:
9999 """
100100 Translate a panel.
101101
102102 Parameters
103103 ----------
104- points : NDArray[np.float32 ]
104+ points : NDArray[np.float64 ]
105105 The points on panel to translate.
106- adjustors : NDArray[np.float32 ]
106+ adjustors : NDArray[np.float64 ]
107107 Adjustor positions.
108- dx : np.float32
108+ dx : np.float64
109109 Translation in x.
110- dy : np.float32
110+ dy : np.float64
111111 Translation in y.
112- dz : np.float32
112+ dz : np.float64
113113 Translation in z.
114114
115115 Returns
116116 -------
117- points : NDArray[np.float32 ]
117+ points : NDArray[np.float64 ]
118118 The translated points.
119- adjustors : NDArray[np.float32 ]
119+ adjustors : NDArray[np.float64 ]
120120 The translated adjustors.
121121 """
122122 translation = np .array ((dx , dy , dz ))
123123 return points + translation , adjustors + translation
124124
125125
126126def adjustment_fit_func (
127- pars : NDArray [np .float32 ],
128- can_points : NDArray [np .float32 ],
129- points : NDArray [np .float32 ],
130- adjustors : NDArray [np .float32 ],
131- ) -> np .float32 :
127+ pars : NDArray [np .float64 ],
128+ can_points : NDArray [np .float64 ],
129+ points : NDArray [np .float64 ],
130+ adjustors : NDArray [np .float64 ],
131+ ) -> np .float64 :
132132 r"""
133133 Function to minimize when calculating adjustments.
134134
135135 Parameters
136136 ----------
137- pars : NDArray[np.float32 ]
137+ pars : NDArray[np.float64 ]
138138 The parameters to fit for:
139139
140140 * dx: Translation in x
@@ -143,16 +143,16 @@ def adjustment_fit_func(
143143 * thetha_0: Angle to rotate about first adjustor axis
144144 * thetha_1: Angle to rotate about second adjustor axis
145145 * z_t: Additional translation to tension the center point
146- can_points : NDArray[np.float32 ]
146+ can_points : NDArray[np.float64 ]
147147 The cannonical positions of the points to align.
148- points : NDArray[np.float32 ]
148+ points : NDArray[np.float64 ]
149149 The measured positions of the points to align.
150- adjustors : NDArray[np.float32 ]
150+ adjustors : NDArray[np.float64 ]
151151 The measured positions of the adjustors.
152152
153153 Returns
154154 -------
155- norm : np.float32
155+ norm : np.float64
156156 The norm of $cannonical_positions - transformed_positions$.
157157 """
158158 dx , dy , dz , thetha_0 , thetha_1 , z_t = pars
@@ -163,43 +163,43 @@ def adjustment_fit_func(
163163
164164
165165def calc_adjustments (
166- can_points : NDArray [np .float32 ],
167- points : NDArray [np .float32 ],
168- adjustors : NDArray [np .float32 ],
166+ can_points : NDArray [np .float64 ],
167+ points : NDArray [np .float64 ],
168+ adjustors : NDArray [np .float64 ],
169169 ** kwargs ,
170170) -> Tuple [
171- np .float32 ,
172- np .float32 ,
173- NDArray [np .float32 ],
174- np .float32 ,
175- np .float32 ,
176- NDArray [np .float32 ],
171+ np .float64 ,
172+ np .float64 ,
173+ NDArray [np .float64 ],
174+ np .float64 ,
175+ np .float64 ,
176+ NDArray [np .float64 ],
177177]:
178178 """
179179 Calculate adjustments needed to align panel.
180180
181181 Parameters
182182 ----------
183- can_points : NDArray[np.float32 ]
183+ can_points : NDArray[np.float64 ]
184184 The cannonical position of the points to align.
185- points : NDArray[np.float32 ]
185+ points : NDArray[np.float64 ]
186186 The measured positions of the points to align.
187- adjustors : NDArray[np.float32 ]
187+ adjustors : NDArray[np.float64 ]
188188 The measured positions of the adjustors.
189189 **kwargs
190190 Arguments to be passed to `scipy.optimize.minimize`.
191191
192- dx : np.float32
192+ dx : np.float64
193193 The required translation of panel in x.
194- dy : np.float32
194+ dy : np.float64
195195 The required translation of panel in y.
196- d_adj : NDArray[np.float32 ]
196+ d_adj : NDArray[np.float64 ]
197197 The amount to move each adjustor.
198- dx_err : np.float32
198+ dx_err : np.float64
199199 The error in the fit for `dx`.
200- dy_err : np.float32
200+ dy_err : np.float64
201201 The error in the fit for `dy`.
202- d_adj_err : NDArray[np.float32 ]
202+ d_adj_err : NDArray[np.float64 ]
203203 The error in the fit for `d_adj`.
204204 """
205205 res = opt .minimize (
0 commit comments