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