Skip to content

TEC Calculation

All entry points share TECConfig and return Polars LazyFrames. The TEC Calculation guide explains input preparation, caching and diagnostic output.

compute_tec_from_rinex

compute_tec_from_rinex(
    obs_fn: str | Path | Iterable[str | Path],
    nav_fn: str | Path | Iterable[str | Path],
    bias_fn: str | Path | Iterable[str | Path] | None = None,
    config: TECConfig | None = None,
    *,
    station: str | None = None,
) -> pl.LazyFrame

Calculate TEC from RINEX observations and navigation files.

Parameters:

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

Observation files from the same station and RINEX major version. The reader explicitly enables LLI for recorded lock/half-cycle QC.

required
nav_fn str, Path, or iterable of str or Path

Navigation files for satellite propagation and receiver geometry.

required
bias_fn str, Path, iterable of str or Path, or None

Optional DCB products; without them TEC remains uncorrected.

None
config TECConfig or None

Configuration; None constructs TECConfig().

None
station str or None

Override the station identifier; None uses the observation header.

None

Returns:

Type Description
LazyFrame

TEC in TECU and geometry in degrees with UTC epochs. Column/row selection follows compute_tec and retain_diagnostics; LLI still contributes to QC when omitted from the final output.

Raises:

Type Description
FileNotFoundError

If an observation file does not exist.

ValueError

If reader or TEC input/bias constraints are violated.

compute_tec

compute_tec(
    df: DataFrame | LazyFrame,
    header: RinexObsHeader,
    bias_fn: str | Path | Iterable[str | Path] | None = None,
    config: TECConfig | None = None,
    *,
    nav_fn: str | Path | Iterable[str | Path] | None = None,
) -> pl.LazyFrame

Calculate TEC from wide GNSS observations.

Parameters:

Name Type Description Default
df DataFrame or LazyFrame

Wide observations with time, station and prn. Time must be timezone-aware UTC or timezone-naive GPS, unique per station/PRN. Reader inputs require pivot=True. Missing LLI is accepted but supplies no recorded loss-of-lock or half-cycle information.

required
header RinexObsHeader

Version, sampling and receiver/event metadata. Existing rx_lat and rx_lon columns take precedence over the header position.

required
bias_fn str, Path, iterable of str or Path, or None

Optional DCB products. Without them, retained TEC is uncorrected; hiding calibration_status does not imply complete calibration.

None
config TECConfig or None

Configuration; None constructs TECConfig(). Output selection follows retain_diagnostics without changing QC/calibration.

None
nav_fn str, Path, iterable of str or Path, or None

Navigation files for raw-observation geometry, required unless azimuth and elevation are already present in degrees.

None

Returns:

Type Description
LazyFrame

UTC epochs, identifiers, receiver/IPP coordinates in degrees, azimuth/elevation in degrees, selected codes and TEC in TECU. Default/selected diagnostics return accepted rows. Complete diagnostics also retains rejected rows with null public TEC. Internal leveling/weight/bias-interval fields are never returned.

Raises:

Type Description
TypeError

If time is not a Polars Datetime.

ValueError

If required columns, time scale/uniqueness, RINEX version or sampling cadence are invalid, or requested bias semantics fail.

compute_tec_from_parquet

compute_tec_from_parquet(
    parquet_fn: str | Path,
    bias_fn: str | Path | Iterable[str | Path] | None = None,
    config: TECConfig | None = None,
    *,
    nav_fn: str | Path | Iterable[str | Path] | None = None,
) -> pl.LazyFrame

Calculate TEC from stored wide observations and RINEX metadata.

Parameters:

Name Type Description Default
parquet_fn str or Path

Parquet file saved with header.to_metadata(), including sampling interval and receiver coordinates. Missing LLI is accepted but cannot supply recorded lock/half-cycle QC.

required
bias_fn str, Path, iterable of str or Path, or None

Optional DCB products; without them TEC remains uncorrected.

None
config TECConfig or None

Configuration; None constructs TECConfig().

None
nav_fn str, Path, iterable of str or Path, or None

Navigation files, required unless stored azimuth/elevation exist.

None

Returns:

Type Description
LazyFrame

TEC in TECU and geometry in degrees with UTC epochs. Column/row selection follows compute_tec and retain_diagnostics.

Raises:

Type Description
ValueError

If required RINEX metadata are missing or observation/bias constraints in compute_tec are violated.