PyRTKLib
Processing / plotting of RINEX based GPS & Galileo data
Install / Use
/learn @alainmuls/PyRTKLibREADME
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:
UTMand height coordinates versus time,UTMscatter plot,- pseudo-range residuals plot,
- Carrier-to-Noise
CN0plot, - 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
SBFformat. These data are logged in (six-)hourly files and are first combined to a dailySBFfile. The naming follows the IGS convention forRINEXv2.x files. The (daily) combined file is stored in the raw binary data directory.
- receivers from Septentrio log data in the binary
pyconvbin.py- converts the binary (daily)
SBForu-Bloxfile toRINEXobservation and navigation files.
- converts the binary (daily)
pyftposnav.py- downloads the
RINEXnavigation file for all GNSS systems for a specific date. This creates a directoryigson the same level as theASTXdirectory, in which the sub-directoriesYYDOYare created.
- downloads the
pyrtkproc.py- based on a common template, ensuring similar processing for all GNSSs, the
RINEXobservation and navigation files are processed usingrnx2rtkpprogram from theRTKLiblibrary. Two output files are created in artkp/GNSSsubdirectory:<file-name>.poscontaining date-time, position and (co-)variance information. The processing mode and number of satellites used are also reported,<file-name>.pos.statcontaining various information about the satellites, the pseudo-range residuals, receiver clock and velocity.
- based on a common template, ensuring similar processing for all GNSSs, the
pyrtkplot.sh- using the
<file-name>.posand<file-name>.pos.statfiles, plots are created.
- using the
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:
sbf2rinfor converting binarySBFdata toRINEX v3.xformat,convbinfor converting binaryu-Bloxdata toRINEX v3.xformat,- the open source program
gfzrnx[^4] used for checking theRINEXfiles 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
GALIfor open source navigation services, marker nameGPRSwhen 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
RINEXobservation 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
