Orbis.GNSS.Antex (Orbis v0.29.1)

Copy Markdown View Source

Parser and lookup helpers for ANTEX 1.4 receiver and satellite antenna blocks.

The module parses the relevant parts of ANTEX text into Elixir structs and exposes minimal helpers for Phase 3a:

  • load/1, load!/1 — read and parse an ANTEX file.
  • antenna/2 — resolve an antenna by the TYPE / SERIAL key.
  • pco/2 — retrieve frequency PCO values in meters.
  • pcv/4 — interpolate phase-center variation in meters.

Interpolation is linear in zenith and, when azimuth data exists, linear in azimuth with wrap handling at 0/360°.

Summary

Functions

Return an antenna by its TYPE / SERIAL key.

Load and parse an ANTEX file from path.

Like load/1 but raises on failure.

Parse ANTEX text already in memory.

Frequency-dependent PCO (north/east/up in meters).

Frequency-dependent phase-center variation in meters.

Return the satellite antenna block for PRN prn (e.g. "G05") valid at the given epoch, or nil if none.

Types

parse_error()

@type parse_error() :: {:error, term()}

t()

@type t() :: %Orbis.GNSS.Antex{
  antennas: %{optional(String.t()) => Orbis.GNSS.Antex.Antenna.t()}
}

Functions

antenna(antex, id)

@spec antenna(t(), String.t()) :: Orbis.GNSS.Antex.Antenna.t() | nil

Return an antenna by its TYPE / SERIAL key.

load(path)

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

Load and parse an ANTEX file from path.

load!(path)

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

Like load/1 but raises on failure.

parse(text)

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

Parse ANTEX text already in memory.

pco(antenna, frequency)

@spec pco(Orbis.GNSS.Antex.Antenna.t(), String.t()) :: {float(), float(), float()}

Frequency-dependent PCO (north/east/up in meters).

pcv(antenna, frequency, zenith_deg, azimuth_deg \\ nil)

@spec pcv(Orbis.GNSS.Antex.Antenna.t(), String.t(), float(), float() | nil) :: float()

Frequency-dependent phase-center variation in meters.

Interpolation is linear in zenith and azimuth. Azimuth is optional: when not given (or when the antenna has no azimuth-dependent rows), the NOAZI row is used.

satellite_antenna(antex, prn, epoch)

@spec satellite_antenna(t(), String.t(), NaiveDateTime.t()) ::
  Orbis.GNSS.Antex.Antenna.t() | nil

Return the satellite antenna block for PRN prn (e.g. "G05") valid at the given epoch, or nil if none.

ANTEX carries one satellite-antenna block per spacecraft per validity window (the same PRN is reused across spacecraft over time), so the block must be selected by VALID FROM/VALID UNTIL. An unbounded valid_until (the active spacecraft) is treated as open-ended.