imap_processing.spice.geometry.frame_transform#

imap_processing.spice.geometry.frame_transform(et: float | ndarray[tuple[int, ...], dtype[_ScalarType_co]], position: ndarray[tuple[int, ...], dtype[_ScalarType_co]], from_frame: SpiceFrame, to_frame: SpiceFrame, allow_spice_noframeconnect: bool = False) ndarray[tuple[int, ...], 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 spiceypy.mxv. >>> rotation_matrix = spiceypy.pxform(from_frame, to_frame, et) … result = spiceypy.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. There are several possible shapes for the input position and et: 1. A single position vector may be provided for multiple et query times 2. A single et may be provided for multiple position vectors, 3. The same number of et and position vectors may be provided. But it is not allowed to have n position vectors and m et, where n != m.

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

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

  • allow_spice_noframeconnect (bool) – If True, does not throw SPICE NOFRAMECONNECT error and returns a NaN vector for those et`s where there is insufficient information available to transform from `from_frame to to_frame. Defaults to False.

Returns:

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

Return type:

np.ndarray