Skip to content

Input and Output

Read observations, broadcast navigation or bias records, and preserve the header metadata required by cached observation workflows. For layouts, time systems and LLI retention, see RINEX Observations.

read_rinex_obs

read_rinex_obs(
    obs_fn: str | Path | Iterable[str | Path],
    constellations: str | None = None,
    codes: str | Iterable[str] | None = None,
    *,
    utc: bool = True,
    station: str | None = None,
    pivot: bool = True,
    include_lli: bool = False,
) -> tuple[RinexObsHeader, pl.LazyFrame]

Decode raw RINEX observations with optional lock indicators.

Parameters:

Name Type Description Default
obs_fn str, Path, or iterable of str or Path

Observation files from one station and RINEX major version (2/3). RINEX, Hatanaka and supported compressed files are accepted.

required
constellations str or None

Constellation letters to include; None includes all supported ones.

None
codes str, iterable of str, or None

Case-sensitive Python regular expressions matching whole observation codes. Literal codes such as ["C1C", "L1C"] work; "[CL]1.*" selects code/phase on band 1. None includes all codes; no matches produce an empty frame.

None
utc bool

Return UTC epochs; False returns timezone-naive GPS epochs.

True
station str or None

Override the station identifier derived from the header.

None
pivot bool

Return one column per observation code. False returns code/value columns with one row per observation.

True
include_lli bool

Extract and emit all selected observations' raw lock indicators: _lli in wide output or lli in long output. UInt8 values and missing indicators (null) retain their version-specific meaning. False omits native LLI buffers/columns. Epoch flags, observations, time and retained event metadata are independent of this switch.

False

Returns:

Name Type Description
header RinexObsHeader

Header metadata including per-file positions/receiver identities and timestamped event records, preserved by header.to_metadata().

observations LazyFrame

Nanosecond time, station/prn, Float64 observations in RINEX units, epoch_flag and optional UInt8/null LLI. Geometry and TEC state are prepared by the TEC functions. Only flag-0/1 records contribute values; timestamped flag-6 payloads are retained in header events. Special records with blank epoch fields are consumed and omitted without assigning a timestamp or receiver state. Parsing completes before return.

Raises:

Type Description
FileNotFoundError

If an observation file does not exist.

ValueError

If code expressions/constellations are invalid, or files mix stations, RINEX major versions or inconsistent GPS scales.

Notes

Request include_lli=True before DataFrame/Parquet TEC processing when recorded lock/half-cycle QC is intended. Absent LLI cannot be reconstructed. compute_tec_from_rinex opts in automatically. This option does not reduce source-file I/O or upstream inline-indicator parsing.

RinexObsHeader dataclass

Dataclass for RINEX observation file header metadata.

version instance-attribute

version: str

RINEX version.

constellation instance-attribute

constellation: str | None

Constellation for which the RINEX file contains observations.

marker_name instance-attribute

marker_name: str

Marker name.

marker_type instance-attribute

marker_type: str | None

Marker type.

rx_ecef instance-attribute

rx_ecef: tuple[float, float, float]

Approximate receiver position in ECEF coordinates (X, Y, Z) in meters.

rx_geodetic instance-attribute

rx_geodetic: tuple[float, float, float]

Approximate receiver position in geodetic coordinates (latitude, longitude, altitude) in degrees and meters.

sampling_interval instance-attribute

sampling_interval: float | None

Sampling interval in seconds.

leap_seconds instance-attribute

leap_seconds: int | None

Number of leap seconds.

epoch_resolution class-attribute instance-attribute

epoch_resolution: str = 'ns'

Integer epoch resolution; parsed observations use nanoseconds.

epoch_events class-attribute instance-attribute

epoch_events: tuple[tuple[int, int, str], ...] = ()

Timestamped events: UTC ns, RINEX flag and original logical records.

Blank-epoch special events and their payloads are omitted. Flag-6 slip payloads are retained here and excluded from observation values.

receiver_id class-attribute instance-attribute

receiver_id: str | None = None

Receiver serial number, model and firmware identity, if supplied.

receiver_history class-attribute instance-attribute

receiver_history: tuple[ReceiverHeader, ...] = ()

Per-file first UTC epoch, original ECEF position and receiver identity.

phase_integer_cycles class-attribute instance-attribute

phase_integer_cycles: bool = True

Whether the header declares ordinary unscaled full-cycle phase.

Manually constructed frames assume full cycles. RINEX readers record unsupported wavelength/scale declarations. Legacy Parquet without this metadata records False. This metadata does not veto STEC time-continuity correction, which makes no per-carrier integer claim.

to_metadata

to_metadata() -> dict[str, str]

Convert the RinexObsHeader to a dictionary suitable for storing as Parquet file metadata using Polars.

from_metadata staticmethod

from_metadata(metadata: dict[str, str]) -> RinexObsHeader

Create a RinexObsHeader from a dictionary of Parquet file metadata.

read_rinex_nav

read_rinex_nav(
    nav_fn: str | Path | Iterable[str | Path], *, constellations: str | None = None
) -> NavigationData

Read RINEX 2/3 broadcast navigation for repeated geometry calculations.

Parameters:

Name Type Description Default
nav_fn str, Path, or iterable of str or Path

Navigation files, optionally gzip compressed. Files are merged in sorted path order before indexing.

required
constellations str or None

One-letter GNSS codes to retain; None retains all parsed constellations.

None

Returns:

Type Description
NavigationData

Immutable native records and per-satellite indexes. Reading completes before return. No per-record Python objects or DataFrame are created.

Raises:

Type Description
FileNotFoundError

If a source file does not exist.

OSError

If a file cannot be decoded.

ValueError

If paths or constellation codes are invalid, files cannot be merged, or an input is not RINEX 2/3 navigation.

NavigationData dataclass

Read-only broadcast ephemerides owned by Rust.

Create instances with read_rinex_nav. Reusing an instance shares its native records and indexes without rereading the source files. This is an in-process geometry dataset, not a lossless navigation-file editor. SBAS records can be read, but their propagation is not implemented.

sources property

sources: tuple[str, ...]

Sorted source paths, independent of subsequent file changes.

satellites property

satellites: tuple[str, ...]

Sorted satellite identifiers with retained ephemerides.

constellations property

constellations: str

Sorted one-letter constellation codes present in the dataset.

n_ephemerides property

n_ephemerides: int

Number of distinct per-satellite reference epochs.

epoch_range property

epoch_range: tuple[int, int] | None

First/last reference epochs as UTC Unix nanoseconds, not validity bounds.

read_bias

read_bias(fn: str | Path | Iterable[str | Path]) -> pl.LazyFrame

Read GNSS bias products into a lazy table.

Parameters:

Name Type Description Default
fn str, Path, or iterable of str or Path

Bias product files, including supported compressed inputs.

required

Returns:

Type Description
LazyFrame

Decoded bias records and product metadata. TEC code-bias preparation separately validates DSB/ns/GPS semantics and half-open validity intervals before applying corrections.

Raises:

Type Description
FileNotFoundError

If a bias file does not exist.

TypeError

If fn is not a path or iterable of paths.