s2d2.attitude_tools

Module Contents

Functions

ordered_merge(t_0, t_1, x_0, x_1)

merge two arrays that describe an (overlapping) time-series

rot_mat(θ)

build a 2x2 rotation matrix

euler_rot_x(ψ)

create three dimensional rotation matrix, along X-axis

euler_rot_y(θ)

create three dimensional rotation matrix, along Y-axis

euler_rot_z(φ)

create three dimensional rotation matrix, along Z-axis

rot_2_euler(R)

convert to euler angels, rotating order is via Z->Y->X, see also

quat_2_euler(q1, q2, q3, q4)

convert to euler angels, rotating order is via Z->Y->X, see also

get_rotation_angle(R)

get the amount of rotation, along a fixed axis (i.e.: vector), see also

get_rotation_vector(R)

get the vector where rotation is applied around, see also [Ku02].

rodrigues_est(XYZ_1, XYZ_2)

estimate the rotation between two coupled coordinate lists, based on

rodrigues_mat(a, b, c)

ecef2ocs(xyz, uvw)

Rotate from an Earth fixed frame towards an orbital coordinate frame,

deconvolve_jitter(f, dt)

asd(f_a, f_c, beta, F)

s2d2.attitude_tools.ordered_merge(t_0, t_1, x_0, x_1)[source]

merge two arrays that describe an (overlapping) time-series

Parameters:
  • t_0 (numpy.ndarray, size=(m,), dtype={float, numpy.datetime64}) – array with time instances

  • t_1 (numpy.ndarray, size=(k,), dtype={float, numpy.datetime64}) – array with time instances

  • x_0 (numpy.ndarray, size=(m,n)) – array with data instances at timestamp given by “t_0”

  • x_1 (numpy.ndarray, size=(k,n)) – array with data instances at timestamp given by “t_1”

Returns:

  • t (numpy.ndarray, size=(p,), dtype={float, numpy.datetime64}) – array with ordered time instances

  • x (numpy.ndarray, size=(p,l)) – array with ordered data instances

s2d2.attitude_tools.rot_mat(θ)[source]

build a 2x2 rotation matrix

Parameters:

θ (float) – angle in degrees

Returns:

R – 2D rotation matrix

Return type:

np.array, size=(2,2)

Notes

Matrix is composed through,

\[\mathbf{R}[1,:] = [+\cos(\omega), -\sin(\omega)]\]
\[\mathbf{R}[2,:] = [+\sin(\omega), +\cos(\omega)]\]

The angle(s) are declared in the following coordinate frame:

     ^ North & y
     |
- <--|--> +
     |
     +----> East & x
s2d2.attitude_tools.euler_rot_x(ψ)[source]

create three dimensional rotation matrix, along X-axis

Parameters:

ψ (float, unit=degrees) – amount of rotation

Returns:

R_x – rotation matrix along the X-axis (1st dimension)

Return type:

numpy.ndarray

s2d2.attitude_tools.euler_rot_y(θ)[source]

create three dimensional rotation matrix, along Y-axis

Parameters:

θ (float, unit=degrees) – amount of rotation

Returns:

R_y – rotation matrix along the X-axis (2nd dimension)

Return type:

numpy.ndarray

s2d2.attitude_tools.euler_rot_z(φ)[source]

create three dimensional rotation matrix, along Z-axis

Parameters:

φ (float, unit=degrees) – amount of rotation

Returns:

R_x – rotation matrix along the X-axis (3rd dimension)

Return type:

numpy.ndarray

s2d2.attitude_tools.rot_2_euler(R)[source]

convert to euler angels, rotating order is via Z->Y->X, see also [Ki13]

Parameters:

R (numpy.ndarray, size=(3,3)) – rotation matrix, direction cosine matrix

Returns:

φ, θ, ψ – rotation angles

Return type:

float, unit=degrees

Notes

These angles go also by other definitions, namely

phi : roll, rotation about the X-axis θ : pitch, rotation about the Y-axis ψ : yaw, rotaion about the Z-axis

References

[Ki13]

Kim, “Rigid body dynamics for beginners”, 2013.

s2d2.attitude_tools.quat_2_euler(q1, q2, q3, q4)[source]

convert to euler angels, rotating order is via Z->Y->X, see also [Ki13]

Parameters:
  • q1 ({float, numpy.ndarray}) – quaternions

  • q2 ({float, numpy.ndarray}) – quaternions

  • q3 ({float, numpy.ndarray}) – quaternions

  • q4 ({float, numpy.ndarray}) – quaternions

Returns:

φ, θ, ψ – rotation angles

Return type:

{float, numpy.ndarray}, unit=degrees

Notes

These angles go also by other definitions, namely

phi : roll, rotation about the X-axis θ : pitch, rotation about the Y-axis ψ : yaw, rotaion about the Z-axis

References

[Ki13]

Kim, “Rigid body dynamics for beginners”, 2013.

s2d2.attitude_tools.get_rotation_angle(R)[source]

get the amount of rotation, along a fixed axis (i.e.: vector), see also [Ku02].

Parameters:

R (numpy.ndarray, size=(3,3)) – rotation matrix

Returns:

φ – amount of rotation, along a fixed axis

Return type:

float, unit=degrees

References

[Ku02]

Kuipers, “Quaternions and rotation sequences”, 2002.

s2d2.attitude_tools.get_rotation_vector(R)[source]

get the vector where rotation is applied around, see also [Ku02].

Parameters:

R (numpy.ndarray, size=(3,3)) – rotation matrix

Returns:

v – vector along which is rotated in 3D space

Return type:

numpy.ndarray, size=(3,)

References

[Ku02]

Kuipers, “Quaternions and rotation sequences”, 2002.

s2d2.attitude_tools.rodrigues_est(XYZ_1, XYZ_2)[source]

estimate the rotation between two coupled coordinate lists, based on [Ro40].

Parameters:
  • XYZ_1 (numpy.ndarray, size=(k,3)) – array with points in coordinate frame 1

  • XYZ_2 (numpy.ndarray, size=(k,3)) – array with points in coordinate frame 1

Returns:

a,b,c – components of the rejection vector

Return type:

float

See also

rodrigues_mat

References

[Ro40]

Rodrigues, “Des lois géométriques qui régissent les déplacements d’un système solide dans l’espace, et de la variation des coordonnées provenant de ces déplacements considérés indépendants des causes qui peuvent les produire”, Journal de mathématiques pures et appliquées. vol.5 pp.380–440, 1840.

s2d2.attitude_tools.rodrigues_mat(a, b, c)[source]
s2d2.attitude_tools.ecef2ocs(xyz, uvw)[source]

Rotate from an Earth fixed frame towards an orbital coordinate frame, see also [Ye20].

Parameters:
Returns:

R – rotation matrix

Return type:

numpy.ndarray, size=(3,3)

See also

rot_2_euler

References

[Ye20]

Ye et al., “Resolving time-varying attitude jitter of an optical remote sensing satellite based on a time-frequency analysis” Optics express, vol.28(11) pp.15805–15823, 2020.

s2d2.attitude_tools.deconvolve_jitter(f, dt)[source]
s2d2.attitude_tools.asd(f_a, f_c, beta, F)[source]