Orbis.GNSS.Time (Orbis v0.9.1)

Copy Markdown View Source

Epoch conversions shared by the GNSS correction wrappers.

These helpers turn an Elixir NaiveDateTime or a {{year, month, day}, {hour, minute, second}} tuple into the two representations the astrodynamics-gnss crate consumes:

  • a split Julian date {jd_whole, fraction} where jd_whole is the *.5 midnight boundary of the civil day and fraction is the within-day part (the same convention the SP3 reader uses);
  • integer seconds since the J2000 epoch (JD 2451545.0), used by the IONEX slant-delay API so the query lands exactly on the product's own epoch axis with no float-rounded time entering the temporal bracket.

No leap-second shifting is applied: the epoch stays in the time scale the caller supplied it in (typically GPS time for these models).

Summary

Functions

Fractional day-of-year of the epoch, as the float the Niell troposphere seasonal term consumes.

Convert an epoch to integer seconds since the J2000 epoch (JD 2451545.0).

Convert an epoch to the split Julian date {jd_whole, fraction}.

Seconds-of-day in [0, 86400), formed from the epoch's integer clock fields.

Functions

day_of_year(ndt)

@spec day_of_year(NaiveDateTime.t() | tuple()) :: float()

Fractional day-of-year of the epoch, as the float the Niell troposphere seasonal term consumes.

January 1 00:00 is 1.0. The value is the integer civil day-of-year plus the within-day fraction (the continuous day-of-year), matching the crate's fractional SolveInputs.day_of_year convention and the standalone troposphere recipe, so the SPP troposphere and Orbis.GNSS.Troposphere agree for the same epoch.

epoch_to_j2000_seconds(ndt)

@spec epoch_to_j2000_seconds(NaiveDateTime.t() | tuple()) ::
  {:ok, integer()} | {:error, term()}

Convert an epoch to integer seconds since the J2000 epoch (JD 2451545.0).

The seconds-of-day are formed from the integer clock fields, so a whole-second epoch yields an exact integer. Returns {:ok, seconds} or {:error, :non_integer_second_epoch} if the result is not an integer number of seconds.

epoch_to_split_jd(ndt)

@spec epoch_to_split_jd(NaiveDateTime.t() | tuple()) :: {float(), float()}

Convert an epoch to the split Julian date {jd_whole, fraction}.

second_of_day(ndt)

@spec second_of_day(NaiveDateTime.t() | tuple()) :: float()

Seconds-of-day in [0, 86400), formed from the epoch's integer clock fields.

Used by the Klobuchar diurnal term, which takes the GPS second-of-day directly. Forming it from hour, minute, and second keeps it exact (no split-Julian-date round trip), so the broadcast-model result is bit-for-bit identical to the reference.