georinex
Python RINEX 2 / 3 NAV / OBS / sp3 reader & batch convert to HDF5 with C-like speed
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.8%) to scientific vocabulary
Keywords
Repository
Python RINEX 2 / 3 NAV / OBS / sp3 reader & batch convert to HDF5 with C-like speed
Basic Info
Statistics
- Stars: 245
- Watchers: 27
- Forks: 94
- Open Issues: 36
- Releases: 51
Topics
Metadata Files
README.md
GeoRinex
RINEX 4, RINEX 3 and RINEX 2 reader and batch conversion to NetCDF4 / HDF5 in Python or Matlab. Batch converts NAV and OBS GPS RINEX (including Hatanaka compressed OBS) data into xarray.Dataset for easy use in analysis and plotting. This gives remarkable speed vs. legacy iterative methods, and allows for HPC / out-of-core operations on massive amounts of GNSS data. GeoRinex has over 125 unit tests driven by Pytest.
Pure compiled language RINEX processors such as within Fortran NAPEOS give perhaps 2x faster performance than this Python program--that's pretty good for a scripted language like Python! However, the initial goal of this Python program was to be for one-time offline conversion of ASCII (and compressed ASCII) RINEX to HDF5/NetCDF4, where ease of cross-platform install and correctness are primary goals.

Input data types
- RINEX 4.x, RINEX 3.x, or RINEX 2.x
- NAV
- OBS
- Plain ASCII or seamlessly read compressed ASCII in:
.gzGZIP.ZLZW.bz2bzip2.zip
- Hatanaka compressed RINEX (plain
.crxor.crx.gzetc.) - Python
io.StringIOtext stream RINEX
Also SP3 ephemeris:
Output
- File: NetCDF4 (subset of HDF5), with
zlibcompression. This yields orders of magnitude speedup in reading/converting RINEX data and allows filtering/processing of gigantic files too large to fit into RAM. - In-memory: Xarray.Dataset. This allows all the database-like indexing power of Pandas to be unleashed.
Install
Latest stable release:
sh
pip install georinex
Current development version:
```sh git clone https://github.com/geospace-code/georinex
python -m pip install -e ./georinex ```
Selftest
It can be useful to check the setup of your system with:
sh
python -m pytest
158 passed, 1 skipped
Usage
The simplest command-line use is through the top-level python -m georinex.read script.
Normally you'd use the -p option with single files to plot, if not converting.
Read single RINEX 4, RINEX 3, or RINEX 2 Obs or Nav file:
sh
python -m georinex.read myrinex.XXx
Read times from a file (helpful for debugging a file that doesn't read properly):
sh
python -m georinex.gtime myrinex.XXx
Read NetCDF converted RINEX data:
sh
python -m georinex.read myrinex.nc
Batch convert RINEX to NetCDF4 / HDF5:
sh
python -m georinex.rinex2hdf5 ~/data "*o" -o ~/data
in this example, the suffix .nc is appended to the original RINEX filename: my.15o => my.15o.nc
It's suggested to save the GNSS data to NetCDF4 (a subset of HDF5) with the -ooption,
as NetCDF4 is also human-readable, yet say 1000x faster to load than RINEX.
You can also of course use the package as a python imported module as in the following examples. Each example assumes you have first done:
python
import georinex as gr
Time limits
Time bounds can be set for reading -- load only data between those time bounds:
sh
--tlim start stop
option, where start and stop are formatted like 2017-02-23T12:00
python
dat = gr.load('my.rnx', tlim=['2017-02-23T12:59', '2017-02-23T13:13'])
read RINEX
This convenience function reads several formats (including compressed, Hatanaka) RINEX 2, RINEX 3, RINEX 4 OBS/NAV or .nc file:
python
obs = gr.load('tests/demo.10o')
Analysis
A significant reason for using xarray as the base class of GeoRinex is that big data operations are fast, easy and efficient.
It's suggested to load the original RINEX files with the -use or use= option to greatly speed loading and conserve memory.
A copy of the processed data can be saved to NetCDF4 for fast reloading and out-of-core processing by:
python
obs.to_netcdf('process.nc', group='OBS')
georinex.__init.py__ shows examples of using compression and other options if desired.
Join data from multiple files
Please see documentation for xarray.concat and xarray.merge for more details.
Assuming you loaded OBS data from one file into obs1 and data from another file into obs2, and the data needs to be concatenated in time:
python
obs = xarray.concat((obs1, obs2), dim='time')
The xarray.concatoperation may fail if there are different SV observation types in the files.
you can try the more general:
python
obs = xarray.merge((obs1, obs2))
Receiver location
While APPROX LOCATION XYZ gives ECEF location in RINEX OBS files, this is OPTIONAL for moving platforms.
If available, the location is written to the NetCDF4 / HDF5 output file on conversion.
To convert ECEF to Latitude, Longitude, Altitude or other coordinate systems, use
PyMap3d.
Read location from NetCDF4 / HDF5 file can be accomplished in a few ways:
python -m georinex.locto load and plot all RINEX and .nc files in a directory- using
xarray
```python obs = xarray.open_dataset('my.nc)
ecef = obs.position
latlon = obs.position_geodetic # only if pymap3d was used
``
* Usingh5py`:
python
with h5py.File('my.nc') as f:
ecef = h['OBS'].attrs['position']
latlon = h['OBS'].attrs['position_geodetic']
Convert to Pandas DataFrames
Although Pandas DataFrames are 2-D, using say df = nav.to_dataframe() will result in a reshaped 2-D DataFrame.
Satellites can be selected like df.loc['G12'].dropna(0, 'all') using the usual
Pandas Multiindexing methods.
Benchmark
An Intel Haswell i7-3770 CPU with plain uncompressed RINEX 2 OBS processes in about:
- 6 MB file: 5 seconds
- 13 MB file: 10 seconds
This processing speed is about within a factor of 2 of compiled RINEX parsers, with the convenience of Python, Xarray, Pandas and HDF5 / NetCDF4.
OBS2 and NAV2 currently have the fast pure Python read that has C-like speed.
Obs3
OBS3 / NAV3 are not yet updated to new fast pure Python method.
On Haswell laptop:
sh
time python -m georinex.read tests/CEDA00USA_R_20182100000_23H_15S_MO.rnx.gz -u E
real 48.6 s
sh
time python -m georinex.read tests/CEDA00USA_R_20182100000_23H_15S_MO.rnx.gz -u E -m C1C
real 17.6 s
Profiling
using
sh
conda install line_profiler
and ipython:
```ipython %loadext lineprofiler
%lprun -f gr.obs3.epoch gr.load('tests/CEDA00USAR2018210000023H15SMO.rnx.gz', use='E', meas='C1C') ```
shows that np.genfromtxt() is consuming about 30% of processing time, and xarray.concat and xarray.Datasetnested insideconcat` takes over 60% of time.
Notes
- GPS satellite position is given for each time in the NAV file as Keplerian parameters, which can be converted to ECEF.
- https://downloads.rene-schwarz.com/download/M001-KeplerianOrbitElementstoCartesianStateVectors.pdf
Number of SVs visible
With the GNSS constellations in 2018, per the Trimble Planner the min/max visible SV would be about:
- Maximum: ~60 SV maximum near the equator in Asia / Oceania with 5 degree elev. cutoff
- Minimum: ~6 SV minimum at poles with 20 degree elev. cutoff and GPS only
RINEX OBS reader algorithm
- read overall OBS header (so we know what to expect in the rest of the OBS file)
- fill the xarray.Dataset with the data by reading in blocks -- another key difference from other programs out there, instead of reading character by character, I ingest a whole time step of text at once, helping keep the processing closer to CPU cache making it much faster.
Data
For capable Android devices, you can log RINEX 3 using the built-in GPS receiver.
UNAVCO site map: identify the 4-letter callsign of a station, and look in the FTP sites below for data from a site.
UNAVCO RINEX 3 data:
- OBS: ftp://data-out.unavco.org/pub/rinex3/obs/
- NAV: ftp://data-out.unavco.org/pub/rinex3/nav/
UNAVCO RINEX 2 data:
- OBS: ftp://data-out.unavco.org/pub/rinex/obs/
- NAV: ftp://data-out.unavco.org/pub/rinex/nav/
Hatanaka compressed RINEX .crx
Compressed Hatanaka CRINEX files are supported seamlessly via
hatanaka
Python package.
These are distinct from the supported .rnx, .gz, or .zip RINEX files.
Hatanaka, Y. (2008), A Compression Format and Tools for GNSS Observation Data, Bulletin of the Geospatioal Information Authority of Japan, 55, 21-30. (available at http://www.gsi.go.jp/ENGLISH/Bulletin55.html)
Owner
- Name: Geospace code
- Login: geospace-code
- Kind: organization
- Location: 1 au
- Website: https://geospace-code.github.io
- Repositories: 16
- Profile: https://github.com/geospace-code
GNSS and other geospace analysis programs
Citation (CITATION)
https://doi.org/10.5281/zenodo.3401498
GitHub Events
Total
- Issues event: 2
- Watch event: 27
- Issue comment event: 1
- Pull request event: 2
- Fork event: 5
Last Year
- Issues event: 2
- Watch event: 27
- Issue comment event: 1
- Pull request event: 2
- Fork event: 5
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Michael Hirsch, Ph.D | s****n | 410 |
| Nikolay Mayorov | n****v@z****m | 8 |
| Ydmir | j****g@g****m | 5 |
| Martin Valgur | m****r@g****m | 4 |
| betaBison | k****k@g****m | 3 |
| Snehil Saluja | s****a@g****m | 2 |
| janbolting | j****g@g****m | 2 |
| izzydrewlynn | 3****n | 1 |
| VOMAY | 3****Y | 1 |
| Greg Starr | g****2@g****m | 1 |
| Frédéric Meynadier | f****r@b****g | 1 |
| Elias Kunnas | e****s@k****m | 1 |
| Daniel Estévez | d****l@d****t | 1 |
| Nikos Kanistras | n****s@l****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 75
- Total pull requests: 39
- Average time to close issues: 4 months
- Average time to close pull requests: 3 months
- Total issue authors: 54
- Total pull request authors: 21
- Average comments per issue: 2.95
- Average comments per pull request: 1.28
- Merged pull requests: 14
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 5
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Issue authors: 2
- Pull request authors: 3
- Average comments per issue: 0.5
- Average comments per pull request: 0.2
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- VOMAY (8)
- serioca (4)
- weisongwen (3)
- charlesnuwan92 (3)
- JulieTls (3)
- ctwillson (2)
- alainmuls (2)
- Ydmir (2)
- anand-satnav (2)
- mauriciodev (2)
- kasc7 (1)
- scivision (1)
- Hahne29 (1)
- Francesko90 (1)
- linustan (1)
Pull Request Authors
- aldebaran1 (5)
- Kevin4562 (4)
- nmayorov (4)
- Parrot7483 (3)
- Ydmir (3)
- valgur (3)
- jtec (3)
- VOMAY (2)
- scivision (2)
- breid-phys (2)
- FishmanL (2)
- mrsnhl (2)
- linustan (1)
- mauriciodev (1)
- betaBison (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 12,548 last-month
-
Total dependent packages: 1
(may contain duplicates) -
Total dependent repositories: 6
(may contain duplicates) - Total versions: 76
- Total maintainers: 1
pypi.org: georinex
Python RINEX 2/3 NAV/OBS reader with speed and simplicity.
- Documentation: https://georinex.readthedocs.io/
- License: MIT License
-
Latest release: 1.16.2
published about 2 years ago
Rankings
Maintainers (1)
proxy.golang.org: github.com/geospace-code/georinex
- Documentation: https://pkg.go.dev/github.com/geospace-code/georinex#section-documentation
- License: mit
-
Latest release: v1.16.2
published about 2 years ago
Rankings
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite