PyGNSS-TEC
PyGNSS-TEC is a high-performance Python package leveraging Rust acceleration, designed for calculating and processing Total Electron Content (TEC) data from Global Navigation Satellite System (GNSS) observations. The package provides tools for RINEX file reading, TEC calculation, and DCB correction to support ionospheric studies.
Read the documentation for detailed usage instructions.
Warning: This package is under active development and may undergo significant changes. It is not recommended for production use until it reaches a stable release (v1.0.0).
Note: All code in this repository is tested using standard IGS GNSS data files downloaded from the Crustal Dynamics Data Information System (CDDIS) database. If you encounter problems with GNSS data files downloaded from other databases, please open a bug report issue and attach the data files to the issue.
Features
- High-Performance: Efficiently read GNSS RINEX files using rinex crate, calculate and calibrate TEC from dual-frequency GNSS observations using Rust and polars lazy evaluation (see benchmarks).
- Multiple File Formats: Support for RINEX versions 2.x and 3.x, as well as Hatanaka compressed files (e.g., .rnx, .crx, .crx.gz).
- Automatic Code Selection: Select dual-frequency code and carrier-phase pairs based on observation quality, DCB coverage, and configurable priorities, with per-epoch fallback when preferred signals are unavailable.
- Multi-GNSS Support: Process observations from multiple GNSS constellations (see Overview for constellation support).
- Open-Source: Fully open-source under the MIT License, encouraging community contributions and collaboration.
Installation
Via pip
You can install PyGNSS-TEC via pip:
pip install pygnss-tec
Via uv (recommended)
uv is a modern Python package and project manager written in Rust. You can add PyGNSS-TEC to your uv project with:
uv add pygnss-tec
From source
Building from source requires Python 3.12 or later, Rust 1.88 or later (including Cargo), and uv:
git clone https://github.com/Eureka-0/pygnss-tec.git
cd pygnss-tec
uv sync
uv run maturin build --release
The built wheel is available in target/wheels/.
Usage
Overview
The following table summarizes the support for different GNSS constellations in PyGNSS-TEC:
| Constellation | RINEX Reading | TEC Calculation |
|---|---|---|
| GPS (G) | Yes | Yes |
| Beidou (C) | Yes | Yes |
| Galileo (E) | Yes | No |
| GLONASS (R) | Yes | No |
| QZSS (J) | Yes | No |
| IRNSS (I) | Yes | No |
| SBAS (S) | Yes | No |
The default TEC configuration supports GPS for RINEX 2, and GPS/BeiDou for RINEX 3.
RINEX file reading
Read a RINEX observation file (supports RINEX v2.x, v3.x, and Hatanaka compressed files):
import gnss_tec as gt
# Header contains RINEX header information; lf is a Polars LazyFrame.
header, lf = gt.read_rinex_obs(
"./data/rinex_obs_v3/CIBG00IDN_R_20240100000_01D_30S_MO.crx.gz"
)
# Collect the LazyFrame into a Polars DataFrame.
df = lf.collect(engine="in-memory")
You can read multiple files from the same station by passing a list of file paths.
Read navigation once and reuse it when calculating satellite azimuth and elevation:
header, observations = gt.read_rinex_obs(
"./data/rinex_obs_v3/CIBG00IDN_R_20240100000_01D_30S_MO.crx.gz",
include_lli=True,
)
navigation = gt.read_rinex_nav(
"./data/rinex_nav_v3/BRDC00IGS_R_20240100000_01D_MN.rnx.gz"
)
observations_with_angles = gt.compute_az_el(
observations, header, navigation
).collect(engine="in-memory")
Navigation records remain in Rust memory, and compute_az_el appends azimuth and elevation in degrees without filtering observations.
TEC calculation
Directly calculate TEC from RINEX observation and navigation files. An optional DCB file supplies satellite and receiver bias corrections:
tec_lf = gt.compute_tec_from_rinex(
"./data/rinex_obs_v3/CIBG00IDN_R_20240100000_01D_30S_MO.crx.gz",
"./data/rinex_nav_v3/BRDC00IGS_R_20240100000_01D_MN.rnx.gz",
"./data/bias/CAS0OPSRAP_20240100000_01D_01D_DCB.BIA.gz",
)
tec_df = tec_lf.collect(engine="in-memory")
# Save the TEC DataFrame to a Parquet file for efficient storage and later use.
tec_df.write_parquet("tec.parquet")
STEC and VTEC are in TECU, coordinates are in degrees, and output times are UTC.
Configuration
You can customize TEC calculation using TECConfig:
config = gt.TECConfig(
constellations="CG",
min_elevation=30.0,
min_snr=30.0,
)
tec_lf = gt.compute_tec_from_rinex(
"observations.crx.gz",
"navigation.rnx.gz",
config=config,
)
Calculation from existing DataFrames, LazyFrames and saved Parquet observations is also supported.
Use compute_tec(observations_with_angles, header) to calculate TEC from observations with precomputed angles.
See the TEC calculation guide for more examples.
Contributing
Bug reports and reproducible examples are welcome through GitHub issues. Bug fixes, new features, and documentation improvements are welcome through pull requests. See contributing documentation for development, testing and documentation builds.
License
This project is licensed under the MIT LICENSE, allowing for free use, modification, and distribution of the software.
Metadata
Release files for pygnss-tec 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygnss_tec-0.5.0.tar.gz | 320.6 kB | Without provenance | Details for pygnss_tec-0.5.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pygnss_tec-0.5.0-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details for pygnss_tec-0.5.0-cp312-abi3-win_amd64.whl |
| pygnss_tec-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details for pygnss_tec-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl |
| pygnss_tec-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ ARM64 | Details for pygnss_tec-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl |
| pygnss_tec-0.5.0-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details for pygnss_tec-0.5.0-cp312-abi3-macosx_11_0_arm64.whl |
| pygnss_tec-0.5.0-cp312-abi3-macosx_10_12_x86_64.whl | CPython 3.12 | abi3 | macOS 10.12+ x86-64 | Details for pygnss_tec-0.5.0-cp312-abi3-macosx_10_12_x86_64.whl |
Total release size: 5.0 MB
Release files / pygnss_tec-0.5.0.tar.gz
| Download URL | pygnss_tec-0.5.0.tar.gz |
|---|---|
| Size | 320.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
489dbdde4ba31f2ca11404163742d30d2add74674b887bb3553db09d95fe310e
|
|
BLAKE2b-256 checksum How to use checksums |
a2b07c54d2e153ab35e01937b19e8e8cbabe39645addb41cfecd744bda662440
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pygnss_tec-0.5.0-cp312-abi3-win_amd64.whl
| Download URL | pygnss_tec-0.5.0-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 873.6 kB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2225411e79da898a52361ff29df5a234c4bd6d609131f99df1e3797de7de0c51
|
|
BLAKE2b-256 checksum How to use checksums |
88015ad1a8317e7573730a929ab925130897c0de46d6902657e6aeeebbb5169e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pygnss_tec-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | pygnss_tec-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9d5918e5c4278fdea708f77c51212524f0df068b2e02acaa92427b1ab493b157
|
|
BLAKE2b-256 checksum How to use checksums |
7da40cc575d402fa0e715a6fba230cfb7e05cd07d61e0c4b498b6fa1cc07eb04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pygnss_tec-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl
| Download URL | pygnss_tec-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 951.7 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
0362d9fe2f7531e19862b2b5232e9f97fddf24e798cb6b4fa17c0faeb8f5b5ec
|
|
BLAKE2b-256 checksum How to use checksums |
9163770bf694f114dd253a7b5bfbd2246e2759651050177de3761fd453e43f5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pygnss_tec-0.5.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | pygnss_tec-0.5.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 869.5 kB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
397258058a2d789ac4b4e682c176e764c719269426d8029552d7e7fe3a5c58ed
|
|
BLAKE2b-256 checksum How to use checksums |
82e6f7cdd4d646e07de921b7055d4acfba20a4e49a3387dc831375f4ea3589fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pygnss_tec-0.5.0-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | pygnss_tec-0.5.0-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 936.9 kB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4d1acb0c281bc90a0fe7b854ba78fe7d113bf8f7c95a161a386e801fa47bc4f4
|
|
BLAKE2b-256 checksum How to use checksums |
a9a14bbb29c319b263f62c3fd7d186f2da8d1c70290a6cdeb44f8e50a18d839e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for pygnss-tec 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.