SkillAgentSearch skills...

PyRTKLib

Processing / plotting of RINEX based GPS & Galileo data

Install / Use

/learn @alainmuls/PyRTKLib
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

pyRTKLib repository

Introduction

The pyRTKLib repository processes RINEX observation / navigation files for Galileo, GPS or a combination of both, using the open source RTKLib library. It generates plots for:

  • UTM and height coordinates versus time,
  • UTM scatter plot,
  • pseudo-range residuals plot,
  • Carrier-to-Noise CN0 plot,
  • satellite elevation plot, and
  • receiver clock plot.

The repository is based on the following directory structure[^1] for the binary receiver data:

\scriptsize

${HOME}/RxTURP
    BEGPIOS
        ASTX
            ...
            19133
            19134
            19135
            ...
        BEGP
            ...
            19133
            19134
            19135
            ...
        uBlox
            ...
            19133
            19134
            19135
            ...

\normalsize

where YYDDD represents 2 digits for the year and 3 digits for the day of year.

During processing, in each receiver type directory (ASTX, BEGP, ...) a rinex directory is created with sub-directories with the same YYDDD as the original raw binary data sub-directories.

[^1]: I never tested this repository using another directory structure.

Processing steps

Processing is split up in 5 steps:

  • pySBFDaily.py
    • receivers from Septentrio log data in the binary SBF format. These data are logged in (six-)hourly files and are first combined to a daily SBF file. The naming follows the IGS convention for RINEX v2.x files. The (daily) combined file is stored in the raw binary data directory.
  • pyconvbin.py
    • converts the binary (daily) SBF or u-Blox file to RINEX observation and navigation files.
  • pyftposnav.py
    • downloads the RINEX navigation file for all GNSS systems for a specific date. This creates a directory igs on the same level as the ASTX directory, in which the sub-directories YYDOY are created.
  • pyrtkproc.py
    • based on a common template, ensuring similar processing for all GNSSs, the RINEX observation and navigation files are processed using rnx2rtkp program from the RTKLib library. Two output files are created in a rtkp/GNSS subdirectory:
      • <file-name>.pos containing date-time, position and (co-)variance information. The processing mode and number of satellites used are also reported,
      • <file-name>.pos.stat containing various information about the satellites, the pseudo-range residuals, receiver clock and velocity.
  • pyrtkplot.sh
    • using the <file-name>.pos and <file-name>.pos.stat files, plots are created.

Each script uses pythons logging facility and creates in the directory from which it is called a <script-name>.log file which can be used for later inspection. The default logging levels are:

  • for the console: LOGGING.INFO
  • for the log-file: LOGGING.DEBUG

pySBFDaily.py

Getting help

\scriptsize

$ pySBFDaily.py --help
usage: pySBFDaily.py [-h] [-d DIR] [-o] [-l LOGGING LOGGING]

pySBFDaily.py creates a daily SBF file based on (six) hourly SBF files found
in given directory

optional arguments:
  -h, --help            show this help message and exit
  -d DIR, --dir DIR     Directory of SBF file (defaults to .)
  -o, --overwrite       overwrite daily SBF file (default False)
  -l LOGGING LOGGING, --logging LOGGING LOGGING
                        specify logging level console/file (default INFO
                        DEBUG)

\normalsize

Processing example

\scriptsize

$ pySBFDaily.py --dir ~/RxTURP/BEGPIOS/ASTX/19134 -o -l INFO DEBUG
INFO: pySBFDaily.py - main: working diretory is /home/amuls/RxTURP/BEGPIOS/ASTX/19134
INFO: pySBFDaily.py - main: changed to directory /home/amuls/RxTURP/BEGPIOS/ASTX/19134
INFO: pySBFDaily.py - main: combine SBF (six-)hourly files to daily SBF file
INFO: pySBFDaily.py - main: creating daily SBF file SEPT1340.19_

\normalsize

yields the following raw binary data directory:

\scriptsize

$ ll /home/amuls/RxTURP/BEGPIOS/ASTX/19134 -rt
total 853200
-rw-rw-r-- 1 amuls amuls 100144280 May 14 08:02 SEPT1341.19_
-rw-rw-r-- 1 amuls amuls  11580873 May 14 08:02 SEPT1341.191
-rw-rw-r-- 1 amuls amuls 102000168 May 14 14:02 SEPT1342.19_
-rw-rw-r-- 1 amuls amuls  11645676 May 14 14:02 SEPT1342.191
-rw-rw-r-- 1 amuls amuls 101275596 May 14 20:02 SEPT1343.19_
-rw-rw-r-- 1 amuls amuls  11705476 May 14 20:02 SEPT1343.191
-rw-rw-r-- 1 amuls amuls  12423431 May 15 02:02 SEPT1344.191
-rw-rw-r-- 1 amuls amuls 109727776 May 15 02:02 SEPT1344.19_
-rw-r--r-- 1 amuls amuls 413147820 Oct 28 14:53 SEPT1340.19_

\normalsize

pyconvbin.py

'pyconvbin.py' is based on several programs to convert binary (proprietary) formats to RINEX:

  • sbf2rin for converting binary SBF data to RINEX v3.x format,
  • convbin for converting binary u-Blox data to RINEX v3.x format,
  • the open source program gfzrnx[^4] used for checking the RINEX files and for separating according to the data of satellite systems

Using the proprietary conversion programs temporary RINEX observation and navigation files are created. The observation header information is extracted and stored in a json structure. From this header information, the pyconvbin.py determines the date of data collection, used for creating the RINEX files for the satellite systems from the global temporary RINEX files. The following marker naming convention is used:

  • Galileo ('E'), marker name GALI for open source navigation services, marker name GPRS when PRS is detected,
  • GPS ('G'), marker name GPSN,
  • if possible, Combined EG ('M') marker name COMB

Part of the extracted header information is displayed below.

\scriptsize

        "times": {
            "DT": "2019-04-05 00:00:00",
            "date": null,
            "doy": 95,
            "year": 2019,
            "yy": 19
        },
        "gnss": {
            "select": [
                "E",
                "G",
                "M"
            ],
            "E": {
                "name": "Galileo",
                "satsys": "E",
                "sysfrq": [
                    "1",
                    "5"
                ],
                "systyp": [
                    "C",
                    "D",
                    "L",
                    "S"
                ],
                "sysobs": [
                    "C1C",
                    "C5Q",
                    "D1C",
                    "D5Q",
                    "L1C",
                    "L5Q",
                    "S1C",
                    "S5Q"
                ],
            "G": {
                "name": "GPS NavSTAR",
                "satsys": "G",
                "sysfrq": [
                    "1",
                    "2",
                    "5"
                ],
                "systyp": [
                    "C",
                    "D",
                    "L",
                    "S"
                ],
                "sysobs": [
                ...
                ...

\normalsize

During the final RINEX files creation, the above mentioned marker names replace the original marker name and the approximate coordinates, marker name and number and observer/agency header lines are replaced.[^3]

The RINEX files are stored in the corresponding directories rinex\YYDOY. For each GNSS system the script automatically detects the frequency bands logged in the original RINEX files and creates (sub-)RINEX files with only the observations related to the frequency band. The following shows the RINEX files created from the ASTX and TUR-P receiver:

\scriptsize

[amuls:~/RxTURP/BEGPIOS/BEGP/rinex] $ ls -lR 19034
19034:
total 142456
-rw-r--r-- 1 amuls amuls   105860 apr 22 17:59 GPRS0340.19E
-rw-r--r-- 1 amuls amuls 70818732 apr 22 17:59 GPRS0340.19O
-rw-r--r-- 1 amuls amuls 37499771 apr 22 18:00 GPRS0340_E1.19O
-rw-r--r-- 1 amuls amuls 37395623 apr 22 18:00 GPRS0340_E6.19O


[amuls:~/RxTURP/BEGPIOS/ASTX/rinex] $ ls -lR 19034
19034:
total 1263596
-rw-r--r-- 1 amuls amuls 363006960 apr 22 22:48 COMB0340.19O
-rw-r--r-- 1 amuls amuls    924284 apr 22 22:48 COMB0340.19P
-rw-r--r-- 1 amuls amuls 143256384 apr 22 22:52 COMB0340_M1.19O
-rw-r--r-- 1 amuls amuls  71288762 apr 22 22:51 COMB0340_M5.19O
-rw-r--r-- 1 amuls amuls    770060 apr 22 22:48 GALI0340.19E
-rw-r--r-- 1 amuls amuls  94135998 apr 22 22:42 GALI0340.19O
-rw-r--r-- 1 amuls amuls  49433129 apr 22 22:49 GALI0340_E1.19O
-rw-r--r-- 1 amuls amuls  47684774 apr 22 22:49 GALI0340_E5.19O
-rw-r--r-- 1 amuls amuls    155108 apr 22 22:48 GPSN0340.19N
-rw-r--r-- 1 amuls amuls 271982819 apr 22 22:45 GPSN0340.19O
-rw-r--r-- 1 amuls amuls  96935112 apr 22 22:50 GPSN0340_G1.19O
-rw-r--r-- 1 amuls amuls 127480719 apr 22 22:50 GPSN0340_G2.19O
-rw-r--r-- 1 amuls amuls  26715845 apr 22 22:51 GPSN0340_G5.19O

\normalsize

An observation statistics, prn visibility and tabular file are created in the sub-directory gfzrnx\MARKER.

  • the observation statistics file report for each satellite the number of observables in the RINEX observation file in tabular format

    \scriptsize

    $ cat /home/amuls/RxTURP/BEGPIOS/ASTX/rinex/19134/gfzrnx/GALI/GALI1340-19O.obsstat
    STP GALI E TYP   C1C   C5Q   D1C   D5Q   L1C   L5Q   S1C   S5Q
    STO GALI E E01 34685 34837 34685 34837 34685 34837 34685 34837
    STO GALI E E02 27443 27459 27443 27459 27443 27459 27443 27459
    STO GALI E E03 33499 33550 33499 33550 33499 33550 33499 33550
    STO GALI E E04 42628 42671 42628 42671 42628 42671 42628 42671
    STO GALI E E05 45416 45416 45416 45416 45416 45416 45416 45416
    STO GALI E E07 16376 16566 16376 16566 16376 16566 16376 16566
    STO GALI E E08 22419 22430 22419 22430 22419 22430 22419 22430
    STO GALI E E09 46114 46215 46114 46215 46114 46215 46114 46215
    STO GALI E E11 43915 44002 43915 44002 43915 44002 43915 44002
    STO GALI E E12 
    
View on GitHub
GitHub Stars48
CategoryDevelopment
Updated4mo ago
Forks27

Languages

Python

Security Score

72/100

Audited on Nov 18, 2025

No findings