# `Sidereon.GNSS.Frequencies`
[🔗](https://github.com/neilberkman/sidereon-ex/blob/main/lib/sidereon/gnss/frequencies.ex#L1)

Canonical GNSS carrier-frequency lookups.

This module exposes the same carrier table used by the core GNSS algorithms.
Fixed-frequency lookups use canonical band atoms such as `:l1`, `:e5a`, or
`:b3i`. RINEX observation-band lookups use the one-character RINEX band digit
and accept a GLONASS FDMA channel for G1/G2.

Frequencies are returned in hertz and wavelengths in metres. All public
functions return `{:ok, value}` or `{:error, reason}` and never raise for
unknown systems or bands.

# `carrier_band`

```elixir
@type carrier_band() ::
  :l1
  | :l2
  | :l5
  | :e1
  | :e5a
  | :e5b
  | :e5
  | :e6
  | :b1c
  | :b1i
  | :b2a
  | :b2b
  | :b2
  | :b3i
  | :g1
  | :g2
```

Canonical carrier band.

Supported fixed-frequency bands are `:l1`, `:l2`, `:l5`, `:e1`, `:e5a`,
`:e5b`, `:e5`, `:e6`, `:b1c`, `:b1i`, `:b2a`, `:b2b`, `:b2`, and `:b3i`.
GLONASS `:g1` and `:g2` are channel-derived and are available through the
RINEX band functions.

# `error`

```elixir
@type error() ::
  {:unknown_system, term()}
  | {:unknown_band, term(), term()}
  | {:no_default_pair, term()}
  | {:missing_glonass_channel, term(), term()}
  | {:invalid_channel, term()}
```

Frequency lookup error.

# `rinex_band`

```elixir
@type rinex_band() :: String.t()
```

One-character RINEX observation band digit, for example `"1"`.

# `system`

```elixir
@type system() :: String.t()
```

GNSS system letter such as `"G"`, `"E"`, `"C"`, or `"R"`.

# `carrier_frequency_hz`

```elixir
@spec carrier_frequency_hz(system(), carrier_band()) ::
  {:ok, float()} | {:error, error()}
```

Return the fixed carrier frequency for `system` and canonical `band`.

GLONASS G1/G2 frequencies depend on the satellite FDMA channel and therefore
are not fixed carrier frequencies. Use `rinex_band_frequency_hz/3` with a
channel for those carriers.

# `default_pair`

```elixir
@spec default_pair(system()) ::
  {:ok, {carrier_band(), carrier_band()}} | {:error, error()}
```

Return the standard dual-frequency ionosphere-free pair for `system`.

GPS, Galileo, and BeiDou have standard pairs. GLONASS FDMA frequencies are
channel-derived, so no constellation-wide default pair is returned.

# `rinex_band_frequency_hz`

```elixir
@spec rinex_band_frequency_hz(system(), rinex_band(), integer() | nil) ::
  {:ok, float()} | {:error, error()}
```

Return a RINEX observation-band frequency in hertz.

`band` is the RINEX band digit from an observation code. For GLONASS band
`"1"` (G1) and `"2"` (G2), pass the parsed FDMA channel from the observation
file's `GLONASS SLOT / FRQ #` header records.

# `rinex_band_wavelength_m`

```elixir
@spec rinex_band_wavelength_m(system(), rinex_band(), integer() | nil) ::
  {:ok, float()} | {:error, error()}
```

Return a RINEX observation-band wavelength in metres.

This uses the same system, band, and GLONASS-channel rules as
`rinex_band_frequency_hz/3`.

# `wavelength_m`

```elixir
@spec wavelength_m(system(), carrier_band()) :: {:ok, float()} | {:error, error()}
```

Return the fixed carrier wavelength for `system` and canonical `band`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
