imap_processing.spice.geometry.get_rotation_matrix#
- imap_processing.spice.geometry.get_rotation_matrix(et: float | ndarray[tuple[int, ...], dtype[_ScalarType_co]], from_frame: SpiceFrame, to_frame: SpiceFrame) ndarray[tuple[int, ...], dtype[_ScalarType_co]]#
Get the rotation matrix/matrices that can be used to transform between frames.
This is a vectorized wrapper around spiceypy.pxform “Return the matrix that transforms position vectors from one specified frame to another at a specified epoch.” https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/pxform_c.html
- Parameters:
et (float or np.ndarray) – Ephemeris time(s) for which to get the rotation matrices.
from_frame (SpiceFrame) – Reference frame to transform from.
to_frame (SpiceFrame) – Reference frame to transform to.
- Returns:
rotation – If et is a float, the returned rotation matrix is of shape (3, 3). If et is a np.ndarray, the returned rotation matrix is of shape (n, 3, 3) where n matches the number of elements in et.
- Return type:
np.ndarray