Package: georinex
GeoRinexRINEX 3 and RINEX 2 reader and batch conversion to NetCDF4 / HDF5 in Python or Matlab.
Batch convertsNAVandOBSGPS RINEX (including Hatanaka compressed OBS) data intoxarray.Datasetfor 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 typesRINEX 3.x or RINEX 2.xNAVOBSPlain ASCII or seamlessly read compressed ASCII in:.gzGZIP.ZLZW.bz2bzip2.zipHatanaka compressed RINEX (plain.crxor.crx.gzetc.)Pythonio.StringIOtext stream RINEXAlso SP3 ephemeris:SP3-aSP3-cSP3-dOutputFile: NetCDF4 (subset of HDF5), withzlibcompression.
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.InstallLatest stable release:pipinstallgeorinexCurrent development version:gitclonehttps://github.com/geospace-code/georinex

python-mpipinstall-e./georinexSelftestIt can be useful to check the setup of your system with:python-mpytest158 passed, 1 skippedUsageThe simplest command-line use is through the top-levelpython -m georinex.readscript.
Normally you'd use the-poption with single files to plot, if not converting.Read single RINEX3 or RINEX 2 Obs or Nav file:python-mgeorinex.readmyrinex.XXxRead times from a file (helpful for debugging a file that doesn't read properly):python-mgeorinex.timemyrinex.XXxRead NetCDF converted RINEX data:python-mgeorinex.readmyrinex.ncBatch convert RINEX to NetCDF4 / HDF5:python-mgeorinex.rinex2hdf5~/data"*o"-o~/datain this example, the suffix.ncis appended to the original RINEX filename:my.15o=>my.15o.ncIt'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:importgeorinexasgrTime limitsTime bounds can be set for reading -- load only data between those time bounds:--tlimstartstopoption, wherestartandstopare formatted like2017-02-23T12:00dat=gr.load('my.rnx',tlim=['2017-02-23T12:59','2017-02-23T13:13'])read RINEXThis convenience function reads any possible format (including compressed, Hatanaka) RINEX 2/3 OBS/NAV or.ncfile:obs=gr.load('tests/demo.10o')AnalysisA significant reason for usingxarrayas 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-useoruse=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:obs.to_netcdf('process.nc',group='OBS')georinex.__init.py__shows examples of using compression and other options if desired.Join data from multiple filesPlease see documentation forxarray.concatandxarray.mergefor more details.
Assuming you loaded OBS data from one file intoobs1and data from another file intoobs2, and the data needs to be concatenated in time:obs=xarray.concat((obs1,obs2),dim='time')Thexarray.concatoperation may fail if there are different SV observation types in the files.
you can try the more general:obs=xarray.merge((obs1,obs2))Receiver locationWhileAPPROX LOCATION XYZgives ECEF location in RINEX OBS files, this is OPTIONAL for moving platforms.
If available, thelocationis written to the NetCDF4 / HDF5 output file on conversion.
To convert ECEF to Latitude, Longitude, Altitude or other coordinate systems, usePyMap3d.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 directoryusingxarrayobs=xarray.open_dataset('my.nc)ecef=obs.positionlatlon=obs.position_geodetic# only if pymap3d was usedUsingh5py:withh5py.File('my.nc')asf:ecef=h['OBS'].attrs['position']latlon=h['OBS'].attrs['position_geodetic']Convert to Pandas DataFramesAlthough Pandas DataFrames are 2-D, using saydf = nav.to_dataframe()will result in a reshaped 2-D DataFrame.
Satellites can be selected likedf.loc['G12'].dropna(0, 'all')using the usualPandas Multiindexing methods.BenchmarkAn Intel Haswell i7-3770 CPU with plain uncompressed RINEX 2 OBS processes in about:6 MB file: 5 seconds13 MB file: 10 secondsThis 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.Obs3OBS3 / NAV3 are not yet updated to new fast pure Python method.On Haswell laptop:timepython-mgeorinex.readtests/CEDA00USA_R_20182100000_23H_15S_MO.rnx.gz-uEreal 48.6 stimepython-mgeorinex.readtests/CEDA00USA_R_20182100000_23H_15S_MO.rnx.gz-uE-mC1Creal 17.6 sProfilingusingcondainstallline_profilerandipython:%load_ext line_profiler

%lprun -f gr.obs3._epoch gr.load('tests/CEDA00USA_R_20182100000_23H_15S_MO.rnx.gz', use='E', meas='C1C')shows thatnp.genfromtxt()is consuming about 30% of processing time, andxarray.concatand xarray.Datasetnested insideconcat` takes over 60% of time.NotesRINEX 3.03specificationrelease notesRINEX 3.04specificationrelease notesRINEX 3.05specificationrelease notesGPS satellite position is given for each time in the NAV file as Keplerian parameters, which can beconverted to ECEF.https://downloads.rene-schwarz.com/download/M001-Keplerian_Orbit_Elements_to_Cartesian_State_Vectors.pdfhttp://www.gage.es/gFDNumber of SVs visibleWith the GNSS constellations in 2018, per theTrimble Plannerthe min/max visible SV would be about:Maximum: ~60 SV maximum near the equator in Asia / Oceania with 5 degree elev. cutoffMinimum: ~6 SV minimum at poles with 20 degree elev. cutoff and GPS onlyRINEX OBS reader algorithmread 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.DataForcapable Android devices,
you canlog RINEX 3using the built-in GPS receiver.UNAVCOsite 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 .crxCompressed Hatanaka CRINEX files are supported seamlessly viahatanakaPython package.
These are distinct from the supported.rnx,.gz, or.zipRINEX 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 athttp://www.gsi.go.jp/ENGLISH/Bulletin55.html)