1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """Module for the handling of Frame Order."""
24
25
26 import dep_check
27
28
29 from math import cos, pi, sin
30 if dep_check.scipy_module:
31 from scipy.integrate import quad
32
33
34 from lib.geometry.pec import pec
35 from lib.frame_order.matrix_ops import rotate_daeg
36 from lib.frame_order.pseudo_ellipse import tmax_pseudo_ellipse
37
38
40 """Generate the 2nd degree Frame Order matrix for the free rotor pseudo-ellipse.
41
42 @param matrix: The Frame Order matrix, 2nd degree to be populated.
43 @type matrix: numpy 9D, rank-2 array
44 @param Rx2_eigen: The Kronecker product of the eigenframe rotation matrix with itself.
45 @type Rx2_eigen: numpy 9D, rank-2 array
46 @param theta_x: The cone opening angle along x.
47 @type theta_x: float
48 @param theta_y: The cone opening angle along y.
49 @type theta_y: float
50 """
51
52
53 fact = 1.0 / (6.0 * pec(theta_x, theta_y))
54
55
56 matrix[0, 0] = fact * (4.0*pi - quad(part_int_daeg2_pseudo_ellipse_free_rotor_00, -pi, pi, args=(theta_x, theta_y), full_output=1)[0])
57 matrix[1, 1] = matrix[3, 3] = fact * 3.0/2.0 * quad(part_int_daeg2_pseudo_ellipse_free_rotor_11, -pi, pi, args=(theta_x, theta_y), full_output=1)[0]
58 matrix[4, 4] = fact * (4.0*pi - quad(part_int_daeg2_pseudo_ellipse_free_rotor_44, -pi, pi, args=(theta_x, theta_y), full_output=1)[0])
59 matrix[8, 8] = fact * (4.0*pi - 2.0*quad(part_int_daeg2_pseudo_ellipse_free_rotor_88, -pi, pi, args=(theta_x, theta_y), full_output=1)[0])
60
61
62 matrix[0, 4] = matrix[0, 0]
63 matrix[4, 0] = matrix[4, 4]
64 matrix[0, 8] = fact * (4.0*pi + quad(part_int_daeg2_pseudo_ellipse_free_rotor_08, -pi, pi, args=(theta_x, theta_y), full_output=1)[0])
65 matrix[8, 0] = fact * (4.0*pi + quad(part_int_daeg2_pseudo_ellipse_free_rotor_80, -pi, pi, args=(theta_x, theta_y), full_output=1)[0])
66 matrix[4, 8] = fact * (4.0*pi + quad(part_int_daeg2_pseudo_ellipse_free_rotor_48, -pi, pi, args=(theta_x, theta_y), full_output=1)[0])
67 matrix[8, 4] = matrix[8, 0]
68
69
70 matrix[1, 3] = matrix[3, 1] = -matrix[1, 1]
71
72
73 return rotate_daeg(matrix, Rx2_eigen)
74
75
77 """The theta-sigma partial integral of the 2nd degree Frame Order matrix for the free rotor pseudo-ellipse.
78
79 @param phi: The azimuthal tilt-torsion angle.
80 @type phi: float
81 @param x: The cone opening angle along x.
82 @type x: float
83 @param y: The cone opening angle along y.
84 @type y: float
85 @return: The theta-sigma partial integral.
86 @rtype: float
87 """
88
89
90 tmax = tmax_pseudo_ellipse(phi, x, y)
91
92
93 return cos(phi)**2*cos(tmax)**3 + 3.0*sin(phi)**2*cos(tmax)
94
95
97 """The theta-sigma partial integral of the 2nd degree Frame Order matrix for the free rotor pseudo-ellipse.
98
99 @param phi: The azimuthal tilt-torsion angle.
100 @type phi: float
101 @param x: The cone opening angle along x.
102 @type x: float
103 @param y: The cone opening angle along y.
104 @type y: float
105 @return: The theta-sigma partial integral.
106 @rtype: float
107 """
108
109
110 tmax = tmax_pseudo_ellipse(phi, x, y)
111
112
113 return cos(phi)**2*(2.0*cos(tmax)**3 - 6.0*cos(tmax))
114
115
117 """The theta-sigma partial integral of the 2nd degree Frame Order matrix for the free rotor pseudo-ellipse.
118
119 @param phi: The azimuthal tilt-torsion angle.
120 @type phi: float
121 @param x: The cone opening angle along x.
122 @type x: float
123 @param y: The cone opening angle along y.
124 @type y: float
125 @return: The theta-sigma partial integral.
126 @rtype: float
127 """
128
129
130 tmax = tmax_pseudo_ellipse(phi, x, y)
131
132
133 return sin(tmax)**2
134
135
137 """The theta-sigma partial integral of the 2nd degree Frame Order matrix for the free rotor pseudo-ellipse.
138
139 @param phi: The azimuthal tilt-torsion angle.
140 @type phi: float
141 @param x: The cone opening angle along x.
142 @type x: float
143 @param y: The cone opening angle along y.
144 @type y: float
145 @return: The theta-sigma partial integral.
146 @rtype: float
147 """
148
149
150 tmax = tmax_pseudo_ellipse(phi, x, y)
151
152
153 return sin(phi)**2*cos(tmax)**3 + 3*cos(phi)**2*cos(tmax)
154
155
157 """The theta-sigma partial integral of the 2nd degree Frame Order matrix for the free rotor pseudo-ellipse.
158
159 @param phi: The azimuthal tilt-torsion angle.
160 @type phi: float
161 @param x: The cone opening angle along x.
162 @type x: float
163 @param y: The cone opening angle along y.
164 @type y: float
165 @return: The theta-sigma partial integral.
166 @rtype: float
167 """
168
169
170 tmax = tmax_pseudo_ellipse(phi, x, y)
171
172
173 return sin(phi)**2*(2.0*cos(tmax)**3 - 6.0*cos(tmax))
174
175
177 """The theta-sigma partial integral of the 2nd degree Frame Order matrix for the free rotor pseudo-ellipse.
178
179 @param phi: The azimuthal tilt-torsion angle.
180 @type phi: float
181 @param x: The cone opening angle along x.
182 @type x: float
183 @param y: The cone opening angle along y.
184 @type y: float
185 @return: The theta-sigma partial integral.
186 @rtype: float
187 """
188
189
190 tmax = tmax_pseudo_ellipse(phi, x, y)
191
192
193 return cos(tmax)**3 - 3.0*cos(tmax)
194
195
197 """The theta-sigma partial integral of the 2nd degree Frame Order matrix for the free rotor pseudo-ellipse.
198
199 @param phi: The azimuthal tilt-torsion angle.
200 @type phi: float
201 @param x: The cone opening angle along x.
202 @type x: float
203 @param y: The cone opening angle along y.
204 @type y: float
205 @return: The theta-sigma partial integral.
206 @rtype: float
207 """
208
209
210 tmax = tmax_pseudo_ellipse(phi, x, y)
211
212
213 return cos(tmax)**3
214