PyGNSSFix is a Python-based GNSS positioning toolkit implementing several algorithms for post-processing analysis.
Currently, the available modes include:
- Single Point Positioning (SPP)
- Pseudorange-based Precise Point Positioning (PR-PPP)
- Carrier Phase-based Precise Point Positioning (CP-PPP)
(with cycle slip detection and ambiguity resolution available)
Currently supported constellations: GPS and Galileo.
- Flexible support for multiple GNSS constellations (GPS, GAL).
- RINEX-based processing workflow (post-processing positioning solution).
- Implements standard and precise GNSS positioning models.
- Post-processing scripts for result analysis, residuals and visualization.
- Highly configurable and extensible system.
- Two solvers are implemented:
- Weighted Least Squares
- Extended Kalman Filter
PyGNSSFix supports several variations of the positioning algorithms (SPP, PR-PPP, CP-PPP) depending on:
- Constellations
- Observables
- Estimation type (Position / Velocity)
- Filtering method
- Stochastic process models
| Mode | Supported Constellations |
|---|---|
| SPP | GPS, GAL, or GPS+GAL |
| PR-PPP | GPS, GAL, or GPS+GAL |
| CP-PPP | GPS, GAL, or GPS+GAL |
| Observation Type | Description |
|---|---|
| Raw Single-Frequency | Use pseudorange and/or carrier phase from a single frequency per constellation |
| Raw Dual-Frequency | Use pseudorange and/or carrier phase from two frequencies per constellation |
| Iono-Free | Linear combination of dual-frequency observations to remove first-order ionospheric delay |
-
Position-only:
Estimate receiver position and clock bias (using PR/CP observations). -
Position + Velocity:
If Doppler observations are enabled, estimate velocity and clock bias rate in addition to position and clock bias.
The process varies depending on the selected solver (WLS or EKF).
Two-step process:
- First solve position + clock bias from PR/CP observations (Iterated Least Squares).
- Then solve velocity + clock bias rate from Doppler observations (separate LS problem).
All states are estimated jointly in the EKF state vector:
- Position
- Velocity
- Clock bias
- Clock bias rate
State transitions can be configured as:
- Uncorrelated: In this case the user can select different stochastic processes (see subsection below).
- Correlated: For Position / Velocity and Clock Bias / Clock Bias Rate it is possible to correlate the states via dynamical models (PV models, clock models).
For more information about the states, see the specific internal documentation KalmanFilterProcessModels.md.
Each state variable (position, velocity, clock bias, clock bias rate) can evolve according to:
| Process Type | Description |
|---|---|
| White Noise | State considered uncorrelated between epochs |
| Random Walk | State evolves as cumulative noise over time |
| Gauss–Markov | First-order autoregressive model with finite memory |
For more information about the stochastic processes, see the specific internal KalmanFilterProcessModels.md.
The list of all available states that are estimable are the following:
- Position
- Velocity
- Clock Bias
- Clock Bias Rate
- Troposphere Wet Delay
- Inter System Bias
- Ionosphere Delay
- Ambiguity
- Receiver Phase Bias
More details in the table below:
| State Name | Dimension (with description) | Unit | State description (availability) |
|---|---|---|---|
| Position Vector | 3×1 (ECEF) | m | Mandatory state, always included |
| Velocity | 3×1 (ECEF) | m/s | Enabled by configuration, requires Doppler measurements |
| Clock Bias | 1×1 | s | Mandatory state, always included |
| Clock Bias Rate | 1×N_const (per constellation) | s/s | Enabled by configuration, requires Doppler measurements |
| Troposphere Wet Delay | 1×1 | m | Optional, included when troposphere modeling is enabled |
| Inter-System Bias | 1×1 | s | Only estimated when dual constellations are processed (e.g., GPS + Galileo) |
| Ionosphere Delay | N_sat×1 (per satellite) | m | Estimated when raw dual-frequency observations are processed and enabled by config |
| Ambiguity | N_obs×1 (per carrier-phase observation, per satellite & frequency) | cycles | Only present in CP-PPP mode |
| Receiver Phase Bias | N_freq×1 (per frequency, per constellation) | s | Only present in CP-PPP mode |
The implemented measurement models are:
- Pseudorange (PR)
- Carrier Phase (CP)
- Pseudorange Rate (PRR)
Single-Frequency Pseudorange (PR):
Single-Frequency Carrier Phase (CP):
Iono-Free Pseudorange (IF-PR):
Iono-Free Carrier Phase (IF-CP):
Pseudorange Rate (PRR):
-
$\rho(t, t-\tau)$ : Geometric range between receiver and satellite at transmit time -
$c$ : Speed of light -
$\Delta t_{rec}$ : Receiver clock bias, with hardware bias included (s) -
$\dot{\Delta t}_{rec}$ : Receiver clock drift (s/s) -
$\Delta t_{sat}$ : Satellite clock bias, with hardware bias included (depending on configuration) (s) -
$\dot{\Delta t}_{sat}$ : Satellite clock drift (s/s) -
$\dot{rel}_{sat}$ : Relativistic satellite clock correction rate (s/s) -
$ISB$ : Inter-system bias (between GNSS constellations) -
$b_{sat,j}$ : Satellite group delay (code bias) for frequency$j$ -
$b^{\phi}_j$ : Receiver phase bias for frequency$j$ -
$I$ : Ionospheric delay (a-priori model) -
$\delta I$ : Estimated ionospheric delay (residual) -
$\mu_j$ : Frequency-dependent ionospheric scaling factor -
$T$ : Tropospheric delay -
$N_j$ : Carrier-phase ambiguity for frequency$j$ (float or integer) -
$\lambda_j$ : Carrier wavelength for frequency$j$ -
$pcc_{rec,j}$ : Receiver phase center correction (frequency-dependent) -
$pcc_{sat,j}$ : Satellite phase center correction (frequency-dependent) -
$PR_j$ : Pseudorange measurement at frequency$j$ -
$CP_j$ : Carrier-phase measurement at frequency$j$ -
$PR_{IF}$ : Iono-free pseudorange combination -
$CP_{IF}$ : Iono-free carrier-phase combination -
$\mathbf{v}^{sat}$ : Satellite velocity vector (ECEF) -
$\mathbf{v}_{rec}$ : Receiver velocity vector (ECEF) -
$\mathbf{los}$ : Line-of-sight unit vector from receiver to satellite -
$PRR_j$ : Pseudorange-rate (Doppler) observable at frequency$j$
See [1] (Chapter 21) for a complete explanation of the meaning of all estimation variables and their relation with the theoretical terms that form the standard definition of the GNSS observation equations.
For more details see the theory notes.
The following correction models are implemented:
-
Ionospheric Delay:
- Klobuchar Model
- NTCM-G Model
- Global Ionospheric Maps (IONEX)
-
Tropospheric Delay:
- Saastamoinen model
- GPT3
-
Satellite Clock Corrections:
- Broadcast clock parameters
- Precise clock files (CLK)
-
Satellite Orbits:
- Broadcast ephemerides
- Precise orbits (SP3)
-
Antenna Phase Center Offsets/Variations:
- Receiver antenna models from ANTEX
- Satellite antenna models from ANTEX
For more details see the theory notes.
PyGNSSFix requires different sets of input files depending on the processing mode (SPP, PR-PPP, CP-PPP).
The following file types are supported:
-
Observation RINEX (
.obs)
Contains raw pseudorange, carrier-phase, doppler and C/N0 measurements collected by the receiver.
Used as the primary input for all positioning modes. -
Navigation RINEX (
.nav)
Broadcast ephemerides, satellite clock corrections, and ionospheric parameters.
Required for Single Point Positioning (SPP). -
Clock Files (
.clk)
Precise satellite clock corrections provided by analysis centers (e.g., IGS).
Essential for Precise Point Positioning (PPP). -
Orbit Files (
.sp3)
Precise satellite orbit products (SP3c/d format).
Used in PR-PPP and CP-PPP for higher accuracy than broadcast orbits. -
Ionosphere Maps (
.ionex)
Global ionospheric models in IONEX format, typically from IGS.
Provide vertical total electron content (VTEC) for ionospheric delay corrections. -
ANTEX Files (
.atx)
Antenna phase center offsets (PCO) and variations (PCV) for both satellites and receivers.
Required for sub-centimeter accuracy in PPP. -
Bias Files (SINEX BIAS)
Contain observable-specific biases (OSBs) or differential code biases (DCBs).
OSBs are required for ambiguity resolution in CP-PPP model (PPP-AR).
-
CSpice Kernels
External ephemeris and reference data used for high-precision transformations and for the position of the Sun and Moon. The required files are already contained in the repository folder (cspice_kernels) and only need to be changed if an update of the kernels is intended.- de421.bsp – Solar system planetary ephemerides
- earth_latest_high_prec.bpc – Earth orientation and rotation model
- naif0012.tls.pc – Leap seconds and time system definitions
-
Fault Injection Files
Custom input defining artificial errors or anomalies to be injected into the measurements or models.
Useful for testing robustness and fault detection algorithms. An example is provided in test_fault_config.csv -
Frame Conversion Files (EPSG JSON)
EPSG-based coordinate system definitions in JSON format.
Required for transformations between different terrestrial/space frames. The required files necessary for the current implementations of the software are already available in the repository folder (workspace/geo_time_data/ITRF) and only need to be changed if an update of the transformations is intended: -
Earth Orientation Parameters (EOP)
Files providing Earth orientation and time system corrections:- finals1980.all – IERS EOP series for the 1980 model-based transformations
- finals2000.all – IERS EOP series for the 2000 model-based transformations
- tai-utc.dat – Leap seconds and UTC–TAI offset history
-
Tropospheric Model Grid Files (GPT)
gpt3_1.grd (Global Pressure and Temperature 3 model).
Provide site-dependent meteorological parameters for advanced tropospheric delay modeling.
| Mode | Mandatory Files | Optional Files |
|---|---|---|
| SPP | Observation RINEX, Navigation RINEX | – |
| PR-PPP | Observation RINEX, SP3 (orbits), CLK (satellite clocks), SINEX Bias (with OSBs or DCBs) | Navigation RINEX, ANTEX, IONEX |
| CP-PPP | Observation RINEX, SP3 (orbits), CLK (satellite clocks), SINEX Bias (must be OSBs when AR is enabled) | Navigation RINEX, ANTEX, IONEX |
The full list of output files available is:
-
Output States:
ambiguity.txt: estimated ambiguity statesreceiver_phase_bias.txt: estimated receiver phase biases statesposition.txt: estimated position statevelocity.txt: estimated velocity stateclock_bias.txt: estimated clock biasiono.txt: estimated ionospheric delay statesisb.txt: estimated ISB statetropo.txt: estimated tropospheric wet delay stateclock_bias_rate.txt: estimated clock bias rate states
-
Additional Files:
satellite_azel.txt: satellite azimuth and elevation anglesDOP_ECEF.txt: DOPs in ECEF frameDOP_ENU.txt: DOPs in ENU frameprefit_residuals.txt: estimation prefit residualspostfit_residuals.txt: estimation postfit residualstime.txt: time in string formatobservations.txt: observations used in the estimation processedraw_observations.txt: raw input observationsmelbourne_wubbena_obs.txt: Melbourne Wubbena observations (combination)geometry_free_obs.txt: Geometry-Free observations (combination)cycle_slips.txt: detected cycle slips
Note that the files are only created when the data is processed by the selected configuration.
- Python 3.10+
- Requirement libraries in requirements.txt.
git clone https://github.com/rodrigo-moliveira/PyGNSSFix.git
cd PyGNSSFix
pip install -r requirements.txtThere are two main entry points:
python algs/main_gnss.py <config_gnss.json>-
Executes the positioning algorithm (SPP, PR-PPP, or CP-PPP).
-
Requires a configuration file specifying input data, processing options, and models.
python algs/post_processing_gnss.py <config_performance.json>-
Performs additional analysis on the results (plots, error statistics, residual analysis, comparisons).
-
Uses a different configuration file.
Configuration is handled via json files. Examples for <config_gnss.json> and <config_performance.json> are provided in configs.
- brux_2024_gnss_solver.json, jfng_gnss_solver.json, zim_gnss_solver.json for GNSS algorithms
- brux_performance.json, jfng_performance.json, zim_performance.json for post-processing algorithms
See the html documentation with json schemas for both configurations in gnss_doc.html and performance_doc.html.
PyGNSSFix/
│── algs/ # Algorithm entry points and executable scripts
│── configs/ # Configuration templates and parameter files
│── runs/ # Generated outputs from execution runs
│── src/ # Core source code (modules, classes, utilities)
│── docs/ # Documentation and theory notes (algorithms, models)
│── workspace/ # Working directory for local data and experiments
│ ├── datasets/ # GNSS input datasets (RINEX, SP3, CLK, etc.)
│ ├── faults/ # Fault injection or error scenario files
│ └── geo_time_data/ # Auxiliary geophysical/temporal data (CSpice, EOP, ITRF, tropo)
│── LICENSE # License information
│── requirements.txt # Python dependencies
│── README.md # Project overview and usage instructions
The following reference books/references have been used to implement this project.
[1] Springer Handbook of Global Navigation Satellite Systems, Peter J.G. Teunissen, Oliver Montenbruck, Springer Cham, 2017
[2] ESA GNSS DATA PROCESSING, Volume I: Fundamentals and Algorithms, J. Sanz Subirana, J.M. Juan Zornoza and M. Hernández-Pajares
[3] European GNSS (GALILEO) Open Service OS, Signal-In-Space Interface Control Document (ICD). Issue 2.0, January 2021
[4] NAVSTAR GPS Space Segment/Navigation User Interfaces (IS-GPS-200). May 2021
These references are used in the documentation of some classes/functions.
This project is built under an MIT License.