RINEX clock (.CLK) reader for satellite clock-bias records.
Precise clock products are distributed as RINEX clock files alongside the SP3
orbit. The SP3 orbit carries satellite clocks too, but only at the SP3 epoch
spacing (15 minutes for IGS final), whereas the companion .CLK file carries
the same clocks at a much finer cadence (30 seconds for IGS final). Linearly
interpolating a 15-minute clock across the gap is a metre-level error on the
faster satellite oscillators; the 30s clock removes almost all of it.
This reader parses the AS (satellite) records of a RINEX clock file
(versions 2 and 3) into a per-satellite, time-ordered series of clock biases in
seconds, and interpolates linearly between the two bracketing records at a
requested epoch:
AS G05 2026 05 13 00 00 0.000000 2 -2.329120317895e-04 4.4959e-11The fields are the record type (AS), the satellite id, the epoch
(year month day hour minute second), the value count, then the clock bias in
seconds and an optional bias sigma. AR (receiver) records are ignored.
Use clock_s/3 to read a satellite's interpolated clock bias (seconds) at an
epoch, matching the convention of Orbis.GNSS.SP3.State.clock_s.
Summary
Functions
Interpolated satellite clock bias in seconds at epoch.
Load a RINEX clock file.
Load a RINEX clock file, raising on error.
Types
Functions
@spec clock_s(t(), String.t(), NaiveDateTime.t()) :: {:ok, float()} | {:error, :no_clock}
Interpolated satellite clock bias in seconds at epoch.
Returns {:ok, bias_s} when the satellite has records bracketing the epoch (or
an exact-match record), {:error, :no_clock} when the satellite is unknown or
the epoch lies outside its record span. Linear interpolation between the two
nearest records; no extrapolation past the first/last record.
Load a RINEX clock file.
Returns {:ok, %Orbis.GNSS.RINEX.Clock{}} or {:error, reason}. The series is
per-satellite, sorted ascending by GPS-seconds time tag, with each entry
{gps_seconds, clock_bias_s}.
Load a RINEX clock file, raising on error.