Orbis.SP3 (Orbis v0.8.0)

Copy Markdown View Source

SP3-c / SP3-d precise-ephemeris products (IGS precise orbits + clocks).

This is the Elixir surface over the astrodynamics-gnss SP3 parser and scipy.interpolate-matched position/clock interpolation. It is not the JPL-SPK reader (Orbis.Ephemeris): SP3 carries GNSS satellite states in the ITRF/IGS ECEF frame, in meters, tagged by a GNSS satellite id like "G01".

A file is parsed once into a resource handle held by the BEAM; evaluation operates on that handle and never re-reads the file.

Example

{:ok, sp3} = Orbis.SP3.load("/path/to/igs.sp3")
{:ok, state} =
  Orbis.SP3.position(sp3, "G01", ~N[2020-06-24 00:00:00])

state.x_m       # ITRF/IGS ECEF X, meters
state.clock_s   # satellite clock offset, seconds (or nil if no estimate)

Epochs

The query epoch is interpreted in the file's own time scale (read from the SP3 header — typically GPST). Pass a NaiveDateTime or a {{year, month, day}, {hour, minute, second}} tuple; it is converted to the split Julian date with the same midnight-boundary convention the parser uses (no leap-second shifting — the epoch stays in the file's scale).

Summary

Functions

Load and parse an SP3-c / SP3-d file into a product handle.

Like load/1 but raises on failure.

Parse an in-memory SP3 byte buffer (already decompressed) into a handle.

Interpolate the state of satellite sat_id at epoch.

Return the SP3/RINEX satellite identifiers declared by the product header.

Types

t()

@type t() :: %Orbis.SP3{handle: reference(), time_scale: String.t()}

Functions

load(path)

@spec load(String.t()) :: {:ok, t()} | {:error, term()}

Load and parse an SP3-c / SP3-d file into a product handle.

Returns {:ok, %Orbis.SP3{}} or {:error, reason}. The file is read and parsed exactly once; the parsed product is held as a resource handle.

load!(path)

@spec load!(String.t()) :: t()

Like load/1 but raises on failure.

parse(bytes)

@spec parse(binary()) :: {:ok, t()} | {:error, term()}

Parse an in-memory SP3 byte buffer (already decompressed) into a handle.

position(sp3, sat_id, epoch)

@spec position(t(), String.t(), NaiveDateTime.t() | tuple()) ::
  {:ok, Orbis.SP3.State.t()} | {:error, term()}

Interpolate the state of satellite sat_id at epoch.

sat_id is the canonical SP3/RINEX token, e.g. "G01" (GPS PRN 1), "E12", "C30". epoch is a NaiveDateTime or a {{year, month, day}, {hour, minute, second}} tuple, interpreted in the file's own time scale.

Returns {:ok, %Orbis.SP3.State{}} or {:error, reason}.

satellite_ids(sp3)

@spec satellite_ids(t()) :: [String.t()]

Return the SP3/RINEX satellite identifiers declared by the product header.

These are canonical three-character tokens such as "G01", "E12", or "C30". The list is read from the already-loaded SP3 handle; no file I/O or interpolation is performed.

Examples

{:ok, sp3} = Orbis.SP3.parse(sp3_bytes)
ids = Orbis.SP3.satellite_ids(sp3)
"G01" in ids