irfpy.jna.frame0
¶
Frame conversion between JUICE and JNA frame.
Spacecraft frame and JNA frame conversion is
x_SC = -x_JNA
y_SC = z_JNA
z_SC = y_JNA
See Frames for details.
-
irfpy.jna.frame0.
jna2nsc
(vec)[source]¶ JNA to SC.
- Parameters
vec – Vector in JNA frame. (3,) or (3, N) shaped numpy array.
>>> r_jna = np.array([1, 3, 5]) >>> r_nsc = jna2nsc(r_jna) >>> print(r_nsc) [-1 5 3]
Multiple vector conversion is supported. Shape should be (3, N), where N is the number of vectors. The returned is also (3, N) shape.
>>> rs_jna = np.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15]]) >>> print(rs_jna.shape) (3, 5) >>> rs_nsc = jna2nsc(rs_jna) >>> print(rs_nsc.shape) (3, 5) >>> print(rs_nsc[:, 0]) [-1 11 6]
-
irfpy.jna.frame0.
nsc2jna
(vec)[source]¶ SC frame vector, vec, is converted to JNA frame.
- Parameters
vec – Vector in NSC frame. (3,) or (3, N) shaped numpy array.
>>> r_jna = np.array([-1, 2, 8]) >>> r_nsc = jna2nsc(r_jna) >>> print(r_nsc) [1 8 2]
-
irfpy.jna.frame0.
jna2angles
(vec)[source]¶ Return the angles in degrees.
>>> jna2angles([1, 0, 0]) (0.0, 90.0) >>> jna2angles([0, 1, 0]) (0.0, 0.0) >>> jna2angles([0, 0, 1]) (-90.0, 0.0) >>> jna2angles([0, 0, -1]) (90.0, 0.0)
-
irfpy.jna.frame0.
angles2jna
(theta, phi)[source]¶ Angles (degrees) to a np.array.
>>> v = angles2jna(0, 90) >>> print('%.3f %.3f %.3f' % (v[0], v[1], v[2])) 1.000 0.000 -0.000
>>> v = angles2jna(0, 0) >>> print('%.3f %.3f %.3f' % (v[0], v[1], v[2])) 0.000 1.000 -0.000
>>> v = angles2jna(-90, 0) >>> print('%.3f %.3f %.3f' % (v[0], v[1], v[2])) 0.000 0.000 1.000
>>> v = angles2jna(90, 0) >>> print('%.3f %.3f %.3f' % (v[0], v[1], v[2])) 0.000 0.000 -1.000