Function lupnt::FitChebyshevModel¶
Defined in File cheby_fit.h
Function Documentation¶
-
inline ChebyshevFitModel lupnt::FitChebyshevModel(const std::function<VecXd(double)> &sample, double t_start, double t_end, int num_dims, double segment_length, int num_coeffs)¶
Fit a piecewise Chebyshev polynomial model to a sampled
num_dims-dimensional function of time.Samples
sample(t)at thenum_coeffsChebyshev-Gauss nodes of [t_start, t_end], split into approximatelysegment_length-long equal segments, and fits a degree-(num_coeffs-1) Chebyshev polynomial to each segment via the standard discrete Chebyshev transform (DCT-II) — i.e. the unique polynomial interpolant ofsampleat the Chebyshev-Gauss nodes, expressed in the T_n basis with the constant term first.Used by
InitFrameConversionFromSpiceto fit SPICE-derived Earth orientation parameters (viaComputeEopFromSpice) over a time window, and byGnssConstellation’s internalFitStateHistoryChebyshevhelper to fit a satellite’s ECI state history for fast ephemeris lookups (seeGnssConstellation::GetSatelliteStateChebyshevEci).- Parameters:
sample – Function returning the
num_dims-dimensional sample vector at a given epoch [s, seconds relative to J2000]t_start – Start of the fit window [s, seconds relative to J2000]
t_end – End of the fit window [s, seconds relative to J2000]
num_dims – Dimensionality of
sample’s outputsegment_length – Target length of each Chebyshev fit segment [s]
num_coeffs – Number of Chebyshev coefficients (polynomial degree + 1) per dimension and segment
- Returns:
Fitted piecewise model, evaluable via
ChebyshevFitModel::Eval