Struct ChebyshevFitModel

Struct Documentation

struct ChebyshevFitModel

A piecewise-Chebyshev fit of an num_dims-dimensional function of time over [t_start, t_end] (epochs in seconds relative to J2000).

Built by FitChebyshevModel (or, for Euler angles, the analogous FitEulerAngleModel in frame_conversions.cc) and consulted via Eval whenever a SPICE-fitted quantity is requested — e.g. by InitFrameConversionFromSpice for Earth orientation parameters and lunar libration angles, and by GnssConstellation::GetSatelliteStateChebyshevEci for fitted ECI ephemeris.

Public Functions

inline const ChebyshevFitSegment *FindSegment(double t) const

Locate the segment of this model whose validity interval covers epoch t.

Used internally by Eval to pick the correct set of Chebyshev coefficients before calling cheby_eval_ad.

Parameters:

t – Epoch to look up [s, seconds relative to J2000]

Returns:

Pointer to the covering segment, or nullptr if t lies outside [t_start, t_end] or no segments are present (caller must not deref in that case)

inline bool Eval(Real t, VecX *f, VecX *df) const

Evaluate the fitted num_dims-dimensional function (and optionally its exact analytic time derivative) at epoch t.

Called by the frame-conversion routines (e.g. RotPolarMotion, RotSideralMotion/RotSideralMotionDot, MoonCiToPa/MoonPaToCi) once a SPICE-fitted model is active for the requested epoch, in place of the analytic/IERS-table-based computation.

Parameters:
  • t – Epoch to evaluate at [s, seconds relative to J2000]

  • f – Output: fitted function value, resized to num_dims [units of the fitted quantity, e.g. rad for EOP/Euler angles, s for UT1-UTC]

  • df – Optional output: exact analytic time derivative of f w.r.t. t, same units per second; pass nullptr to skip

Returns:

True if t is within [t_start, t_end] and f (and df, if requested) were populated; false otherwise (outputs left unmodified)

Public Members

double t_start = 0.0
double t_end = 0.0
int num_dims = 0
int num_coeffs = 0
std::vector<ChebyshevFitSegment> segments