Function lupnt::spice::GetFrameConversionMat

Function Documentation

Mat6d lupnt::spice::GetFrameConversionMat(Real t_tdb, const std::string &from_frame, const std::string &to_frame)

Get the Frame Conversion Mat object.

Get the 6x6 state (position+velocity) rotation matrix from from_frame to to_frame at epoch t_tdb, via SPICE’s sxform_c.

This is the core building block of spice::ConvertFrameSpice (frame_converter_spice.cc), used e.g. to rotate ECEF <-> GCRF ("ITRF93" <-> "J2000") and Moon-body-fixed <-> Moon-inertial ("IAU_MOON" <-> "J2000") state vectors using SPICE’s high-accuracy orientation kernels (see LoadSpiceKernel). Applying the returned matrix to a Vec6 position+velocity state transforms it between frames, including the frame’s angular-velocity (Coriolis) contribution to velocity.

Parameters:
  • t_tdb

  • from_frame

  • to_frame

  • t_tdb – Epoch [s, TDB seconds since J2000]

  • from_frame – SPICE name of the source frame (e.g. "ITRF93")

  • to_frame – SPICE name of the target frame (e.g. "J2000")

Returns:

VecXd

Returns:

6x6 state-transformation matrix M such that rv_to = M * rv_from