Skip to main content

clock_reference_offset

Function clock_reference_offset 

Source
pub fn clock_reference_offset(
    reference: &Sp3,
    other: &Sp3,
    min_common: usize,
) -> Vec<ClockReferenceOffset>
Expand description

Estimate the per-epoch reference-clock offset of other relative to reference.

For each epoch present in both products, the offset is the median over the satellites both report (each with a finite clock) of other_clock - reference_clock. The median makes the estimate robust to a single satellite whose clock one center has wrong - but only with enough satellites, so min_common is the minimum number of common clocked satellites required to emit an offset for an epoch (a sound robust median wants at least three, so one outlier can be outvoted). Epochs with fewer common clocks are omitted rather than reported as a fragile one- or two-satellite estimate.

Epochs are matched by their J2000 second floored to a whole second (the same node-axis convention the interpolator uses). Non-finite clock differences are skipped. Epochs present in only one product, or below min_common, are omitted from the result.

The floored-whole-second key assumes the input cadence is at least one second, which holds for every standard SP3 product (15 min, 5 min, 1 min, … down to 1 s). Two distinct epochs less than a second apart would collapse onto the same key and be matched as one; the same applies to the floored key in MergeReport::per_epoch_agreement. This is kept deliberately aligned with the interpolator’s node axis rather than refined to sub-second resolution, so that matching here and interpolation downstream use one consistent grid.