imap_processing.spice.geometry.frame_transform#

imap_processing.spice.geometry.frame_transform(et: float | ndarray[Any, dtype[_ScalarType_co]], position: ndarray[Any, dtype[_ScalarType_co]], from_frame: SpiceFrame, to_frame: SpiceFrame) ndarray[Any, dtype[_ScalarType_co]]#

Transform an <x, y, z> vector between reference frames (rotation only).

This function is a vectorized equivalent to performing the following SPICE calls for each input time and position vector to perform the transform. The matrix multiplication step is done using numpy.matmul rather than spice.mxv. >>> rotation_matrix = spice.pxform(from_frame, to_frame, et) … result = spice.mxv(rotation_matrix, position)

Parameters:
  • et (float or np.ndarray) – Ephemeris time(s) corresponding to position(s).

  • position (np.ndarray) – <x, y, z> vector or array of vectors in reference frame from_frame. A single position vector may be provided for multiple et query times but only a single position vector can be provided for a single et.

  • from_frame (SpiceFrame) – Reference frame of input vector(s).

  • to_frame (SpiceFrame) – Reference frame of output vector(s).

Returns:

result – 3d Cartesian position vector(s) in reference frame to_frame.

Return type:

np.ndarray