Function lupnt::GetTaiUtcDifference

Function Documentation

double lupnt::GetTaiUtcDifference(double mjd)

Get the TAI-UTC leap-second offset at a given epoch.

Used by time-conversion routines (e.g. UtcToTai/TaiToUtc in conversions/time_conversions.cc) to convert between UTC and TAI, which underlies all higher time-scale conversions (TT, TDB, TCB, GPS time) used throughout the simulator. Lazily loads the bundled leap-second table (GetFilePath(TAI_UTC_FILENAME)) on first use. For epochs before the table’s first entry, returns 0; for epochs at or after the last entry, extrapolates using that entry’s linear drift rate; otherwise evaluates the piecewise-linear/step formula of the matching table entry.

Parameters:

mjd – Epoch at which to evaluate the offset [MJD, UTC]

Returns:

TAI - UTC [s]