Git Product home page Git Product logo

georinex's People

Contributors

betabison avatar daniestevez avatar eliask avatar fmeynadier avatar izzydrewlynn avatar jtec avatar mrsnhl avatar nmayorov avatar scivision avatar valgur avatar vomay avatar ydmir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

georinex's Issues

The time for gps.getSatXYZ(nav,1,arr) function

Hi @scivision Thanks for your effort in this package.
when I use following function, I found that the output satellite position is not right. Because if I use the output satellite position to calculate the gps receiver's position, gps receiver's position is wrong.

satpos1 = gps.getSatXYZ(nav,1,arr)
satpos2 = gps.getSatXYZ(nav,2,arr)
satpos3 = gps.getSatXYZ(nav,3,arr)

the parameter arr in function gps.getSatXYZ is the UTC time from .obs file? I use the following code to get the time for function gps.getSatXYZ.

arr_test = np.array([gps_receiver_time + datetime.timedelta(minutes=i) for i in range(2)])#make sure the length of arr_test is not 0

gps_receiver_time is the UTC time provided by .obs file.

and then compute satellite 3 position:

satellite_position=gps.getSatXYZ(nav,3,arr_test)

do you have any idea about this issue?

Best
Welson

Proposal: Convert Space to 0 in PRN

Dear Scivision

some RINEX writers have the habit to write the 1-digit PRN numbers without the leading 0, e.g. :

17  4 29  0  2  0.0000000  0 23R 2R 8G19R18R 1G14R 9R19G 6G22G32G 2

instead of

17  4 29  0  2  0.0000000  0 23R02R08G19R18R01G14R09R19G06G22G32G02

I have seen this in NAV and OBS files, in both RINEX 2 and 3. In general, this is not an issue for georinex. However, the space ends up in the sv coordinate ticks. This makes it hard to compare the same satellite in two RINEX files, recorded by different receivers.

I propose to check the second character of each PRN for a space and replace it by a 0.

Best Regards
Volker

'test_meas_some_missing()' might be incorrect in test_obs3.py

The issue is in line 61 of test_obs3.py

assert S2P.shape == (2, 14)

After looking at demo3.10o file, I think the shape should be (2, 10) since the measurement 'S2P' is present only in the G satellite system (10 satellites) and should not include the R satellite system (4 satellites)

Correct me if I am wrong

No dask scheduler

  1. There are many types of RINEX files.
    Almost every issue is because of some corner case with a particular RINEX format.
    Thus we will usually need a copy of your RINEX file.
    If it's very large/private, consider copying just the part of it that causes the issue for you.
  2. Please copy and paste the error traceback, to help find which function the error is occurring in.
  3. generally a dump of all the versions of Python packages you have is not needed

I am trying to read a rinex file from UNAVCO on a mac: ftp://data-out.unavco.org/pub/rinex3/obs/2020/257/ARVL00ATA_R_20202570000_01D_15S_MO.crx.gz
and get this error:
georinex_read ARVL00ATA_R_20202570000_01D_15S_MO.rnx -v -o ARVL00ATA_R_20202570000_01D_15S_MO.nc
saving OBS: ARVL00ATA_R_20202570000_01D_15S_MO.nc
Traceback (most recent call last):
File "/Users/tedhabermann/anaconda3/bin/georinex_read", line 8, in
sys.exit(georinex_read())
File "/Users/tedhabermann/anaconda3/lib/python3.6/site-packages/georinex/main.py", line 51, in georinex_read
verbose=P.verbose, fast=P.strict, interval=P.interval)
File "/Users/tedhabermann/anaconda3/lib/python3.6/site-packages/georinex/base.py", line 69, in load
overwrite=overwrite, fast=fast, interval=interval)
File "/Users/tedhabermann/anaconda3/lib/python3.6/site-packages/georinex/base.py", line 207, in rinexobs
obs.to_netcdf(outfn, group=group, mode=wmode, encoding=enc)
File "/Users/tedhabermann/anaconda3/lib/python3.6/site-packages/xarray/core/dataset.py", line 1568, in to_netcdf
invalid_netcdf=invalid_netcdf,
File "/Users/tedhabermann/anaconda3/lib/python3.6/site-packages/xarray/backends/api.py", line 1044, in to_netcdf
scheduler = _get_scheduler()
File "/Users/tedhabermann/anaconda3/lib/python3.6/site-packages/xarray/backends/locks.py", line 79, in _get_scheduler
actual_get = dask.base.get_scheduler(get, collection)
AttributeError: module 'dask.base' has no attribute 'get_scheduler'

Rinex Header

It would be useful to have a new method to get the Rinex header data

RuntimeError with crx file loading

I'm attempting to open a .crx file via the following in Python:


import georinex
dat = georinex.load('file.crx.gz')

but am receiving the following error:


  File "E:\Anaconda\lib\site-packages\georinex\base.py", line 63, in load
    verbose=verbose, fast=fast, interval=interval)

  File "E:\Anaconda\lib\site-packages\georinex\base.py", line 186, in rinexobs
    fast=fast, interval=interval)

  File "E:\Anaconda\lib\site-packages\georinex\obs3.py", line 76, in rinexobs3
    with opener(fn) as f:

  File "E:\Anaconda\lib\contextlib.py", line 81, in __enter__
    return next(self.gen)

  File "E:\Anaconda\lib\site-packages\georinex\io.py", line 62, in opener
    f = io.StringIO(_opencrx(f))

  File "E:\Anaconda\lib\site-packages\georinex\io.py", line 99, in _opencrx
    raise RuntimeError('Hatanka crx2rnx not available. Did you compile it per README?')

RuntimeError: Hatanka crx2rnx not available. Did you compile it per README?

I compiled the crx2rnx as suggested in your documentation, so I'm not really sure what is going on.

I can upload the file I was using in case this helps. I am using Python 3.6.5.

Thanks

Proposal: Add use option also for three character observation type

Dear Scivision,

I can confirm that your effort to speed up the parsing, by making the indicators optional, was successful.

Unfortunately, the parsing is still a bit slow. I have another proposal to speed it up:

The use argument is very useful to speed up the parsing, by selecting only the constellations/satellites you want. Especially ignoring the GEOs makes a big different, since they are recorded every single epoch. How do you feel about adding an option to allow a similar selection for the signal types?

Here is an example of what I would like to do:

#Only read Galileo E1 Code
gr.readrinex('test.rnx', use='E', signal='C1C')

#Read all code and phase observations of all constellations but GEOs
gr.readrinex('test.rnx', use=['E', 'G', 'C', 'R', 'J'], signal=['C', 'L'] )

I am convinced the potential time saving is substantial.

Implementing this, one may consider changing the use keyword, since it is not unambiguous anymore. But this is a detail.

Thanks a lot for your effort. Keep up the good work!

Best Regards
Volker

Can't use the CLI tool after pip install

Hi!

First of all, thank you very much for this great tool. I am already using it from my python scripts but I am not able to use the CLI tools such as ReadRinex.

Looking inside my virtualenv folder I found a ReadRinex inside bin and it looked like this:

#!/Users/fabiopicchi/.venvs/test/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys

from ReadRinex import main 

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

However, there is no ReadRinex module installed. Under site-packages I just have the georinex package. Thus, I get the following error when trying to run this CLI tool:

Traceback (most recent call last):
    File "/Users/fabiopicchi/.venvs/test/bin/ReadRinex", line 6, in <module>
    from ReadRinex import main
ModuleNotFoundError: No module named 'ReadRinex'

I have never dug into the pip packaging process so I can't exactly point where the actual problem is (I read the setup.cfg file and everything seems fine). Maybe I am doing something wrong?

Also, I think it would be very useful to provide the Hatanaka compression and decompression tools as binaries. This way, running a project that has georinex as a dependency in different machines will be a little bit more convenient if this feature is required.

error running pyRINEX

Hi,
I am running python 3.6.4. I got error running a GPS RINEX 2.11 navigation file

plots.py, line 28, in plotobs
    if not p in obs:
TypeError: argument of type 'NoneType' is not iterable

Have you seen this error before? Am I missing a library?

Proposal: Speed up data storing processing in xarray

Dear scivision,

I ran a profiler on georinex (why did you change the name), while reading a 24h@30s Multi-GNSS Rinex 3 (LEICA GR25) file and found that the xarray.merge is responsible for >90% of the time consumption. This is not a surprise, but annoying nonetheless. I checked the code and saw that you are using xarray.concat instead of xarray.merge for single constellation cases. So I made a test:

#Galileo only: 57.44 sec
e=gr.readrinex('C:/Users/Volker Mayer/Desktop/ABMFxxGLP_R_20181330000_01D_30S_MO.rnx', use=['E'])
#GPS only: 59.79 sec
g=gr.readrinex('C:/Users/Volker Mayer/Desktop/ABMFxxGLP_R_20181330000_01D_30S_MO.rnx', use=['G'])
#GPS+Galileo: 2.89 min
eg=gr.readrinex('C:/Users/Volker Mayer/Desktop/ABMFxxGLP_R_20181330000_01D_30S_MO.rnx', use=['E', 'G'])

As you can see, reading GPS+Galileo at once takes about 50% longer than doing them one after another. This shows that concat is substantially quicker than merge. So here is my proposal:

Create one xarray dataset for each constellation and merge them only once at the very end. I am optimistic that this will allow at least 50% of time savings. Probably even quicker would be to use one xarray dataset per satellite and again merge them only once!

Best Regards
Volker

Decimate reading observations

Dear Michael,

I started working with georinex, big thanks for this packege.

I have a request: is it possible to decimate the observables?

I mean by this that is the observation interval is 1 sec that I want to only read the observables every 5, 10, ... seconds.

Kind regards
Alain

ValueError running pyrinex

Hi

I'm getting an error when first reading in an obs file.

import pyrinex as pr
obs,nav = pr.readrinex('../Sample/14601736.18o')

Full StackTrace:


ValueError Traceback (most recent call last)
in ()
2 srcDir = '/Users/ianmarang/Documents/Project_docs/Crop/Narrabri_farm_data/DGPS_SNR/Sample/'
3
----> 4 obs,nav = pr.readrinex(srcDir+'14601736.18o')
5 print(obs)
6 print(nav)

~/anaconda2/envs/py3/lib/python3.6/site-packages/pyrinex/init.py in readrinex(rinexfn, outfn, use, verbose)
29 nav = rinexnav(rinexfn, outfn)
30 elif fnl.endswith('o') or fnl.endswith('o.rnx'):
---> 31 obs = rinexobs(rinexfn, outfn, use=use, verbose=verbose)
32 elif rinexfn.suffix.endswith('.nc'):
33 nav = rinexnav(rinexfn)

~/anaconda2/envs/py3/lib/python3.6/site-packages/pyrinex/init.py in rinexobs(fn, ofn, use, group, verbose)
97 ver = getRinexVersion(fn)
98 if int(ver) == 2:
---> 99 obs = _scan2(fn, use, verbose)
100 elif int(ver) == 3:
101 obs = _scan3(fn, use, verbose)

~/anaconda2/envs/py3/lib/python3.6/site-packages/pyrinex/rinex2.py in _scan2(fn, use, verbose)
162 break
163
--> 164 eflag = int(ln[28])
165 if eflag not in (0, 1, 5, 6): # EPOCH FLAG
166 print(eflag)

ValueError: invalid literal for int() with base 10: 'i'

Conda details:
active environment : py3
active env location : /Users/ianmarang/anaconda2/envs/py3
shell level : 1
user config file : /Users/ianmarang/.condarc
populated config files :
conda version : 4.5.4
conda-build version : not installed
python version : 2.7.14.final.0
base environment : /Users/ianmarang/anaconda2 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/osx-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/osx-64
https://repo.anaconda.com/pkgs/pro/noarch
package cache : /Users/ianmarang/anaconda2/pkgs
/Users/ianmarang/.conda/pkgs
envs directories : /Users/ianmarang/anaconda2/envs
/Users/ianmarang/.conda/envs
platform : osx-64
user-agent : conda/4.5.4 requests/2.14.2 CPython/2.7.14 Darwin/14.5.0 OSX/10.10.5
UID:GID : 505:20
netrc file : None
offline mode : False

Name Version Build Channel

appnope 0.1.0 py36hf537a9a_0
backcall 0.1.0 py36_0
blas 1.0 mkl
bzip2 1.0.6 h1de35cc_5
ca-certificates 2018.03.07 0
cairo 1.14.12 hc4e6be7_3
certifi 2018.4.16 py36_0
cftime 1.0.0
curl 7.60.0 ha441bb4_0
Cython 0.28.3
decorator 4.3.0 py36_0
expat 2.2.5 hb8e80ba_0
fontconfig 2.13.0 h5d5b041_1
freetype 2.9.1 hb4e5f40_0
freexl 1.0.5 h1de35cc_0
gdal 2.2.4 py36h1702cab_1
geos 3.6.2 h5470d99_2
gettext 0.19.8.1 h15daf44_3
giflib 5.1.4 h1035379_1
glib 2.56.1 h35bc53a_0
hdf4 4.2.13 h39711bb_2
hdf5 1.8.18 h017327d_1
icu 58.2 h4b95b61_1
intel-openmp 2018.0.3 0
ipykernel 4.8.2 py36_0
ipython 6.4.0 py36_0
ipython_genutils 0.2.0 py36h241746c_0
jedi 0.12.0 py36_1
jpeg 9b he5867d9_2
json-c 0.13.1 h3efe00b_0
jupyter_client 5.2.3 py36_0
jupyter_core 4.4.0 py36h79cf704_0
kealib 1.4.7 haa18932_5
libboost 1.65.1 hcc95346_4
libcurl 7.60.0 hf30b1f0_0
libcxx 4.0.1 h579ed51_0
libcxxabi 4.0.1 hebd6815_0
libdap4 3.19.0 hefe82ba_2
libedit 3.1.20170329 hb402a30_2
libffi 3.2.1 h475c297_4
libgdal 2.2.4 h2fbb439_1
libgfortran 3.0.1 h93005f0_2
libiconv 1.15 hdd342a3_7
libkml 1.3.0 hc0cae1e_3
libnetcdf 4.4.1.1 h1d6afd8_8
libpng 1.6.34 he12f830_0
libpq 10.3 hf30b1f0_0
libsodium 1.0.16 h3efe00b_0
libspatialite 4.3.0a h0a2fa02_18
libssh2 1.8.0 h322a93b_4
libtiff 4.0.9 hcb84e12_1
libuuid 1.0.3 h6bb4b03_2
libxml2 2.9.8 hab757c2_1
mkl 2018.0.3 1
mkl_fft 1.0.1 py36h917ab60_0
mkl_random 1.0.1 py36h78cc56f_0
ncurses 6.1 h0a44026_0
netCDF4 1.4.0
numpy 1.14.5 py36h9bb19eb_2
numpy-base 1.14.5 py36ha9ae307_2
openjpeg 2.3.0 hb95cd4c_1
openssl 1.0.2o h26aff7b_0
pandas 0.23.1 py36h1702cab_0
parso 0.2.1 py36_0
pcre 8.42 h378b8a2_0
pexpect 4.6.0 py36_0
pickleshare 0.7.4 py36hf512f8e_0
pip 10.0.1 py36_0
pixman 0.34.0 hca0a616_3
poppler 0.65.0 ha097c24_1
poppler-data 0.4.9 0
proj4 4.9.3 h3f1bf9d_7
prompt_toolkit 1.0.15 py36haeda067_0
ptyprocess 0.6.0 py36_0
pygments 2.2.0 py36h240cd3f_0
pyrinex 1.4.1
python 3.6.6 hc167b69_0
python-dateutil 2.7.3 py36_0
pytz 2018.4 py36_0
pyzmq 17.0.0 py36h1de35cc_1
readline 7.0 hc1231fa_4
setuptools 39.2.0 py36_0
simplegeneric 0.8.1 py36_2
six 1.11.0 py36h0e22d5e_1
sqlite 3.24.0 ha441bb4_0
tk 8.6.7 h35a86e2_3
tornado 5.0.2 py36_0
traitlets 4.3.2 py36h65bd3ce_0
wcwidth 0.1.7 py36h8c6ec74_0
wheel 0.31.1 py36_0
xarray 0.10.7
xerces-c 3.2.1 h44e365a_0
xz 5.2.4 h1de35cc_4
zeromq 4.2.5 h378b8a2_0
zlib 1.2.11 hf3cbc9b_2

Looks like its failing when trying to confirm the version of the rinex obs file, but I've never used this before today so I could use some help.

Cheers
Ian

Enhancement: batch convert using asyncio

At first thought, it seems like batch conversion of RINEX to NetCDF could be greatly sped up by using coroutines (asyncio). When time permits, let's consider this enhancement.

Installation error/ Rinex nav read error for mixed Rinex files

Hi Michael,

when i was installing Georinex i got this error message but the package installed fine.

Requirement already satisfied: pytz>=2011k in c:\users\gssc\appdata\local\continuum\anaconda3\lib\site-packages (from pandas>=0.19.2->xarray->georinex)
Building wheels for collected packages: georinex
Running setup.py bdist_wheel for georinex ... error
Complete output from command C:\Users\GSSC\AppData\Local\Continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\GSSC\AppData\Local\Temp\pip-build-8bww53q8\georinex\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\GSSC\AppData\Local\Temp\tmptm1u2xrhpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib
creating build\lib\georinex
copying georinex\io.py -> build\lib\georinex
copying georinex\keplerian.py -> build\lib\georinex
copying georinex\nav2.py -> build\lib\georinex
copying georinex\nav3.py -> build\lib\georinex
copying georinex\obs2.py -> build\lib\georinex
copying georinex\obs3.py -> build\lib\georinex
copying georinex\plots.py -> build\lib\georinex
copying georinex_init_.py -> build\lib\georinex
running egg_info
writing georinex.egg-info\PKG-INFO
writing dependency_links to georinex.egg-info\dependency_links.txt
writing entry points to georinex.egg-info\entry_points.txt
writing requirements to georinex.egg-info\requires.txt
writing top-level names to georinex.egg-info\top_level.txt
reading manifest file 'georinex.egg-info\SOURCES.txt'
writing manifest file 'georinex.egg-info\SOURCES.txt'
installing to build\bdist.win-amd64\wheel
running install
running install_lib
creating build\bdist.win-amd64
creating build\bdist.win-amd64\wheel
creating build\bdist.win-amd64\wheel\georinex
copying build\lib\georinex\io.py -> build\bdist.win-amd64\wheel.\georinex
copying build\lib\georinex\keplerian.py -> build\bdist.win-amd64\wheel.\georinex
copying build\lib\georinex\nav2.py -> build\bdist.win-amd64\wheel.\georinex
copying build\lib\georinex\nav3.py -> build\bdist.win-amd64\wheel.\georinex
copying build\lib\georinex\obs2.py -> build\bdist.win-amd64\wheel.\georinex
copying build\lib\georinex\obs3.py -> build\bdist.win-amd64\wheel.\georinex
copying build\lib\georinex\plots.py -> build\bdist.win-amd64\wheel.\georinex
copying build\lib\georinex_init_.py -> build\bdist.win-amd64\wheel.\georinex
running install_egg_info
Copying georinex.egg-info to build\bdist.win-amd64\wheel.\georinex-1.5.3-py3.6.egg-info
running install_scripts
error: [Errno 2] No such file or directory: 'LICENSE'


Failed building wheel for georinex
Running setup.py clean for georinex
Failed to build georinex
Installing collected packages: georinex
Running setup.py install for georinex ... done
Successfully installed georinex-1.5.3

Then i read the mixed Rinex file using the updated version and i examined each data point visually by exporting the data to a excel file. I see (specially Galileo sats) the dates are wrong and some attribute are empty ( in Rinex file they are not). I don't know whether this has something to do with errors during the installation.
Really appreciate the effort you put to make this package.
I hope you will be able to correct this.

Rinex file, excel file -- https://files.fm/u/cu7wrt3z

Cheers
Best regards
Charles

Galileo NAV messages with both I/NAV and F/NAV

Hello,

I am trying to parse a recent Galileo file:
ftp://ftp.cddis.eosdis.nasa.gov/pub/gnss/data/daily/2020/182/20l/tlsg1820.20l.Z

As it contains both F/NAV 0x102 (258) and I/NAV 0x205 (517) messages, current nav2.py rejects all messages.

Adding a filter on DataSrc value enables to extract information.

I do not know if this solution makes sense.

Thank you


#_ %% format I2 http://gage.upc.edu/sites/default/files/gLAB/HTML/GPS_Navigation_Rinex_v2.11.html
svs.append(f'{svtype}{ln[:2]}'.replace(' ', '0'))

        times.append(time)
        """
        now get the data as one big long string per SV
        """
        raw = ln[22:79]  # NOTE: MUST be 79, not 80 due to some files that put \n a character early!
        for _ in range(Nl[header['systems']]):
            raw += f.readline()[STARTCOL2:79]
        # one line per SV
        # NOTE: Sebastijan added .replace('  ', ' ').replace(' -', '-')
        # here, I would like to see a file that needs this first, to be sure
        # I'm not needlessly slowing down reading or creating new problems.
        raws.append(raw.replace('D', 'E').replace('\n', ''))

#_ %% Galileo specific: filter data source

#_ https://binex.unavco.org/binex_record_01.html
#_ data sources:

#_ bit 0: I/NAV E1-B
#_ bit 1: F/NAV E5a-I
#_ bit 2: I/NAV E5b-I
#_ bit 8: af0-af2, ToC are for E5a,E1
#_ bit 9: af0-af2, ToC are for E5b,E1

#_ although only specific combinations are valid, i.e.

#_ 0x102 (258) for F/NAV from E5a
#_ 0x201 (513) for I/NAV from E1
#_ 0x204 (516) for I/NAV from E5b
#_ 0x205 (517) for I/NAV from E1+E5b
data_src_filt = 0x205
if svtype == 'E' and data_src_filt is not None:

    # aggregate all rows in a 2D char matrix
    raw = np.array(raws, dtype="S")
    raw_len = np.vectorize(len)(raw)
    if not (raw_len == raw_len[0]).all():
        raise RuntimeError("Non-uniform rows are unexpected")
    raw_uint8 = raw.view(dtype=np.uint8).reshape(len(raw), -1)

    # extract characters of column DataSrc and convert to uint16
    i_data_src = fields.index("DataSrc")
    col = raw_uint8[:, i_data_src*19:(i_data_src+1)*19].reshape(-1)
    data_src = col.view(dtype="S19").astype(float).astype(np.uint16)

    # filter matching values
    is_in = data_src == data_src_filt
    times = np.array(times)[is_in].tolist()
    raws = [r.decode() for r in raw[is_in]]
    svs = np.array(svs)[is_in].tolist()

#_ %% parse
svu = sorted(set(svs))


Feature Request: GLONASS Satellites assigned to same number as GPS

Consider the following record header:

17 1 2 13 15 0.0000000 0 30S27G30R24G26R23G16E01R17R01G13R09G09
R07G23G29R06G02R08R16G05S28G06G07E09
R10E22S36S20S23S26

In it we have amongst other, the satellites R23, G23, and S23, belonging to the GLONASS, GPS, and SBAS constellations respectively. Currently, the code for enumerating satellites in the pandas tables, create the labels from the following:
sp.append(int(lines[i][33+(s%12)*3:35+(s%12)*3])).
This only account for the satellite number, without accounting for its constellation, creating serious errors when trying to use the code on multi-constallation files.

georinex.read() : Read error for mixed rinex observation files

Hello Michael,

I am trying to load measurements from a single GNSS system with the 'use' argument.

The Dataset returned after the load does not contain any data variables

dat = gr.load("cutsamp.16o",meas=['C1C','S1C',],use=['G']) print(dat)
Output
... Data variables: *empty*

But when I add more than one GNSS system as part of the 'use' argument it loads the data correctly

dat = gr.load("cutsamp.16o",meas=['C1C','S1C',],use=['G','S']) print(dat)
Output
... Data variables: C1C (time, sv) : ... S1C (time, sv) : ...

I have attached the file "cutsamp.16o" for your reference. Note that it is a RINEX 3.02 file
cutsamp.zip

Irregular nav3 parsing with GPS data

The following example contains a RINEX file generated by a Spirent GSS9000 constellation simulator. It contains GPS data with 31 field while the nav3 parser expects 29 field. A workaround is to include 2 spare fields at position 20 and at the end.

rinex3Nav.zip

README: Section "Read Navigation File Example"

Hello,

Thanks for your great work. Just a little mark.

In your readme section "Read Navigation File Example", Function readRinexNav does not exist.

perhaps, you mean rinexnav or rinexnav2 or rinexnav3?

Thanks

how can this package be changed to read the rinex3.02 .nav file

Hi, @scivision , thanks for your work in this package.
Thanks for your work here. how can this package be changed to read the rinex3.02 .nav file? my .nav file is like this (rinex 3.2):

3.02           N: GNSS NAV DATA    G: GPS              RINEX VERSION / TYPE
LgsRinex v1.7.7.0   SMO                 20171117 051209 UTC PGM / RUN BY / DATE
GPSA   1.1176D-08 -1.4901D-08 -5.9605D-08  1.1921D-07       IONOSPHERIC CORR
GPSB   9.8304D+04 -1.1469D+05 -1.9661D+05  7.2090D+05       IONOSPHERIC CORR
GPUT -3.7252902985D-09-1.065814104D-14  61440 1976          TIME SYSTEM CORR
    18    18  1929     7                                    LEAP SECONDS
                                                            END OF HEADER
G01 2017 11 17 00 00 00-1.082336530089D-05-2.387423592154D-12 0.000000000000D+00
     2.600000000000D+01 4.312500000000D+01 4.455542601534D-09 2.261013945883D+00
     2.192333340645D-06 7.114754174836D-03 7.407739758492D-06 5.153672552109D+03
     4.320000000000D+05-9.126961231232D-08 7.577775093435D-01-7.450580596924D-08
     9.691207199508D-01 2.407187500000D+02 6.318014759246D-01-7.981403982171D-09
     5.718095441587D-10 1.000000000000D+00 1.975000000000D+03 0.000000000000D+00
     2.000000000000D+00 0.000000000000D+00 5.587935447693D-09 2.600000000000D+01
     4.247400000000D+05                   
G02 2017 11 17 04 00 00 2.789050340652D-04-9.663381206337D-12 0.000000000000D+00
     6.100000000000D+01 4.615625000000D+01 4.950563514683D-09-1.495754475149D+00
     2.572312951088D-06 1.728782569990D-02 7.607042789459D-06 5.153617258072D+03
     4.464000000000D+05 4.153698682785D-07 7.005942974446D-01 3.054738044739D-07
     9.481762359175D-01 2.264062500000D+02-1.938649816409D+00-8.148910879413D-09
     4.689481025721D-10 1.000000000000D+00 1.975000000000D+03 0.000000000000D+00
     2.000000000000D+00 0.000000000000D+00-2.048909664154D-08 6.100000000000D+01
     4.391400000000D+05                   
G03 2017 11 17 00 00 00-4.102196544409D-05 5.570655048359D-12 0.000000000000D+00
     6.200000000000D+01-3.440625000000D+01 4.867345637649D-09 1.199389953372D+00
    -1.976266503334D-06 1.129540265538D-03 5.628913640976D-06 5.153610057831D+03
     4.320000000000D+05 1.117587089539D-08 1.800773457900D+00 3.911554813385D-08
     9.598706640660D-01 2.691562500000D+02 5.853639356718D-01-8.238200344124D-09
    -3.446572194310D-10 1.000000000000D+00 1.975000000000D+03 0.000000000000D+00
     2.000000000000D+00 0.000000000000D+00 2.328306436539D-09 6.200000000000D+01
     4.247400000000D+05                   
G05 2017 11 17 04 00 00-2.250215038657D-05 1.136868377216D-12 0.000000000000D+00
     1.010000000000D+02-3.156250000000D+01 5.160929461567D-09 1.019456906164D+00
    -1.467764377594D-06 5.289388587698D-03 5.319714546204D-06 5.153583730698D+03
     4.464000000000D+05-7.823109626770D-08 1.781452415021D+00 4.842877388000D-08
     9.467839021727D-01 2.704687500000D+02 6.257362175680D-01-8.413207908120D-09
    -3.964450712157D-10 1.000000000000D+00 1.975000000000D+03 0.000000000000D+00
     2.000000000000D+00 0.000000000000D+00-1.071020960808D-08 1.010000000000D+02
     4.391400000000D+05                   

Why pyrinex can't read nav files correctly?

I got questions when I use pyrinex to read nav files.The error is followed down and I want to know how I can solve the problem.


Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.1\helpers\pydev\pydevd.py", line 1668, in
main()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.1\helpers\pydev\pydevd.py", line 1662, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.1\helpers\pydev\pydevd.py", line 1072, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.1\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/lenovo/Desktop/毕设/程序/dual_frequency/rinex.py", line 2, in
navdata = pyrinex.rinexnav('ntus0010.18n')
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrinex_init_.py", line 71, in rinexnav
darr = np.genfromtxt(BytesIO(raws.encode('ascii')))
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\lib\npyio.py", line 2019, in genfromtxt
raise ValueError(errmsg)
ValueError: Some errors were detected !

C Compiler Issue

  1. There are many types of RINEX files.
    Almost every issue is because of some corner case with a particular RINEX format.
    Thus we will usually need a copy of your RINEX file.
    If it's very large/private, consider copying just the part of it that causes the issue for you.
  2. Please copy and paste the error traceback, to help find which function the error is occurring in.
  3. generally a dump of all the versions of Python packages you have is not needed

ReadRinex rinex_files/brest_france/20191022_BRST00FRA_R_20192950000_01D_30S_MO.crx -u G -m S1C -v
cc /usr/local/lib/python3.7/site-packages/georinex/rnxcmp/source/crx2rnx.c -o /usr/local/lib/python3.7/site-packages/georinex/rnxcmp/crx2rnx
ld: can't open output file for writing '/usr/local/lib/python3.7/site-packages/georinex/rnxcmp/crx2rnx.ld_Qso3hq', errno=13 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gcc /usr/local/lib/python3.7/site-packages/georinex/rnxcmp/source/crx2rnx.c -o /usr/local/lib/python3.7/site-packages/georinex/rnxcmp/crx2rnx
ld: can't open output file for writing '/usr/local/lib/python3.7/site-packages/georinex/rnxcmp/crx2rnx.ld_IaiMOI', errno=13 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang /usr/local/lib/python3.7/site-packages/georinex/rnxcmp/source/crx2rnx.c -o /usr/local/lib/python3.7/site-packages/georinex/rnxcmp/crx2rnx
ld: can't open output file for writing '/usr/local/lib/python3.7/site-packages/georinex/rnxcmp/crx2rnx.ld_NHyA2O', errno=13 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Traceback (most recent call last):
File "/usr/local/bin/ReadRinex", line 8, in
sys.exit(main())
File "/usr/local/bin/ReadRinex.py", line 48, in main
verbose=P.verbose, fast=P.strict, interval=P.interval)
File "/usr/local/lib/python3.7/site-packages/georinex/base.py", line 66, in load
verbose=verbose, fast=fast, interval=interval)
File "/usr/local/lib/python3.7/site-packages/georinex/base.py", line 189, in rinexobs
fast=fast, interval=interval)
File "/usr/local/lib/python3.7/site-packages/georinex/obs3.py", line 76, in rinexobs3
with opener(fn) as f:
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in enter
return next(self.gen)
File "/usr/local/lib/python3.7/site-packages/georinex/io.py", line 61, in opener
f = io.StringIO(opencrx(f))
File "/usr/local/lib/python3.7/site-packages/georinex/hatanaka.py", line 51, in opencrx
raise RuntimeError('could not build Hatanka converter. Do you have a C compiler?')
RuntimeError: could not build Hatanka converter. Do you have a C compiler?

I have the home-brew gcc installed but python is complaining I don't have a compiler?

error trying parse seconds in HEADER LABEL "TIME OF FIRST OBS"

I got 'string to float conversion error' for some rinex with second in "TIME OF FIRST OBS" AND "TIME OF LAST OBS" records represented without zeroes before the dot. like following:
(" 93 1 1 0 0 .000000 ")
In this case the program fail trying to convert the string "." into float

I have also found in some rinex the seconds field set to 60, like following:
(" 93 1 1 23 58 60 .000000 ")
while the correct record should be:
(" 93 1 1 23 59 0 .0000000 ")
In this case the program fail trying to construct datetime object because of the seconds cannot be greather than 59

I fixed this two problems modifing the function obsheader2 of obs2.py module (both for 'TIME OF FIRST OBS' and 'TIME OF LST OBS' keys) like following:

hdr['t0'] = datetime(year=int(t0s[:6]), month=int(t0s[6:12]), day=int(t0s[12:18]),
hour=int(t0s[18:24]), minute=int(t0s[24:30]), second=0,
microsecond=int(float(t0s[30:43]) % 1 * 1000000)) + timedelta(seconds=int(float('0' + t0s[30:36].strip())))

instead of:

hdr['t0'] = datetime(year=int(t0s[:6]), month=int(t0s[6:12]), day=int(t0s[12:18]),
hour=int(t0s[18:24]), minute=int(t0s[24:30]), second=int(float(t0s[30:36]),
microsecond=int(float(t0s[30:43]) % 1 * 1000000))

does it possible to put this patch in the official module or do I need to update my local installation?
Regards

Sergio Bruni

Reliant on optional header record

On reading some RINEX files rinexobs fails with the following message "IndexError: list index out of range" after trying to read the number of satellites from the header:
numberOfSv = int(grabfromhead(header,None,6,"# OF SATELLITES")[0][0]

The # OF SATELLITES record is an optional header and it is thus problematic to rely on it.

Windows compability: crx2rnx

Dear scivision,

I love the fact that you decided to support Hatanaka compressed files. However, I am struggling to get it to work in my Windows 10 environment. The respective crx2rnx Windows binaries are available here

Thanks!
Volker

read the file but no output

Hello Scivison,

Thank you for the correction. Your demo files run ok with the pyrinex but ;
i ran my file and looks like it does not record data to xarray my file can be download here https://files.fm/u/95k952ck
could you please observe the file and tell me whats wrong with it.

<xarray.Dataset>
Dimensions: (sv: 20, time: 933)
Coordinates:

sv (sv) object 'C13' 'C27' 'C28' 'C30' 'G05' 'G14' 'G16' 'G20' ...
time (time) datetime64[ns] 2018-04-17T16:19:25.999800 ...
Data variables:
C1C (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
C1Cssi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L1C (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L1Clli (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L1Cssi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
D1C (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
D1Cssi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
S1C (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
S1Cssi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
C1B (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
C1Bssi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L1B (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L1Blli (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L1Bssi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
D1B (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
D1Bssi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
S1B (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
S1Bssi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
C2I (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
C2Issi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L2I (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L2Illi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
L2Issi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
D2I (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
D2Issi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
S2I (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
S2Issi (time, sv) float64 nan nan nan nan nan nan nan nan nan nan nan ...
Attributes:
filename: GEOP107Q.18o

Reading Error for Commented RINEX files - v1.9.0

Hey guys, I am using georinex to read some RINEX files from IGS (International GNSS Service). It is working really well and I would like to thank you for providing such a tool.

However, there are some .obs files with a few comments in the middle of the file (not only in the header). See for instance the following RINEX file, at the following line regarding to the observations at 1 hour:

file: ftp://cddis.gsfc.nasa.gov/gnss/data/daily/2013/359/13o/mana3590.13o.Z
line: 13 12 25 1 0 0.0000000 4 5

You will find some strange comments, such as:

13 12 25 1 0 0.0000000 4 5
MANA (COGO code) COMMENT
0.000 (antenna height) COMMENT
+12.14896250 (latitude) COMMENT
-86.24899354 (longitude) COMMENT
0077.169 (elevation) COMMENT

As far as I have detected, georinex is not reading correct such files. It reads the observations bellow the comments and says that such obsearvations are related to the time obtained in the comments plus 30 seconds (or any other interval). However, the next time is also at 1 hour. As a result, georinex is shifting all times when we find this problem.

Indeed, this strange lines are not suposed to be there, so it is a bug in the RINEX files. I have seen this kind of comments since many years ago, which are obtained due to the use of TEQC when generating RINEX files. Despite being a bug, some files have this comments..

I do not know if this would be easy to solve in georinex..

Thanks anyway!

'IndexError: too many indices for array' for large RINEX 3 files

Dear scivision,

I spend the day checking out pyrinex and am starting to like it. However I am having issue reading large RINEX3 files (24h@30s). In this case it crashed at 01:26:30.

I work at ESA's Navigation Support Office and we do a lot of RINEX analysis, mostly of 24h files. I see great potential in this tool for our daily work.

I am looking forward to hear from you.

a= pr.readrinex('ABMF00GLP_R_20181330000_01D_30S_MO.rnx')
Traceback (most recent call last):02:30 2018-05-13 00:04:30   2018-05-13 00:09:00       2018-05-13 00:16:30  2018-05-13 00:19:30 2018-05-13 00:21:30  2018-05-13 00:24:30 2018-05-13 00:26:00 2018-05-13 00:27:30   2018-05-13 00:31:30 2018-05-13 00:33:30              2018-05-13 00:47:30    2018-05-13 00:52:00           2018-05-13 01:06:00  2018-05-13 01:09:00 2018-05-13 01:10:30  2018-05-13 01:13:30 2018-05-13 01:15:00      2018-05-13 01:21:00    2018-05-13 01:25:00 2018-05-13 01:26:30   

  File "<ipython-input-87-b3eefa642c66>", line 1, in <module>
    a= pr.readrinex('C:/Users/xxx/Desktop/ABMF00GLP_R_20181330000_01D_30S_MO.rnx')

  File "C:\Users\xxx\AppData\Local\Continuum\anaconda3\lib\site-packages\pyrinex\__init__.py", line 31, in readrinex
    obs = rinexobs(rinexfn, outfn, use=use, verbose=verbose)

  File "C:\Users\xxx\AppData\Local\Continuum\anaconda3\lib\site-packages\pyrinex\__init__.py", line 101, in rinexobs
    obs = _scan3(fn, use, verbose)

  File "C:\Users\xxx\AppData\Local\Continuum\anaconda3\lib\site-packages\pyrinex\rinex3.py", line 258, in _scan3
    garr = darr[si, :]

IndexError: too many indices for array

I am running pyrinex 1.4.1. find the other versions below:

# Name Version Build Channel _ipyw_jlab_nb_ext_conf 0.1.0 py36he6757f0_0 alabaster 0.7.10 py36hcd07829_0 anaconda 5.2.0 py36_3 anaconda-client 1.6.14 py36_0 anaconda-navigator 1.8.7 py36_0 anaconda-project 0.8.2 py36hfad2e28_0 asn1crypto 0.24.0 py36_0 astroid 1.6.3 py36_0 astropy 3.0.2 py36h452e1ab_1 attrs 18.1.0 py36_0 babel 2.5.3 py36_0 backcall 0.1.0 py36_0 backports 1.0 py36h81696a8_1 backports.shutil_get_terminal_size 1.0.0 py36h79ab834_2 beautifulsoup4 4.6.0 py36hd4cc5e8_1 bitarray 0.8.1 py36hfa6e2cd_1 bkcharts 0.2 py36h7e685f7_0 blas 1.0 mkl blaze 0.11.3 py36h8a29ca5_0 bleach 2.1.3 py36_0 blosc 1.14.3 he51fdeb_0 bokeh 0.12.16 py36_0 boto 2.48.0 py36h1a776d2_1 bottleneck 1.2.1 py36hd119dfa_0 bzip2 1.0.6 hfa6e2cd_5 ca-certificates 2018.03.07 0 certifi 2018.4.16 py36_0 cffi 1.11.5 py36h945400d_0 cftime 1.0.0b1 py36h452e1ab_0 chardet 3.0.4 py36h420ce6e_1 click 6.7 py36hec8c647_0 cloudpickle 0.5.3 py36_0 clyent 1.2.2 py36hb10d595_1 colorama 0.3.9 py36h029ae33_0 comtypes 1.1.4 py36_0 conda 4.5.8 py36_0 conda-build 3.10.5 py36_0 conda-env 2.6.0 h36134e3_1 conda-verify 2.0.0 py36h065de53_0 console_shortcut 0.1.1 h6bb2dd7_3 contextlib2 0.5.5 py36he5d52c0_0 cryptography 2.2.2 py36hfa6e2cd_0 curl 7.60.0 h7602738_0 cycler 0.10.0 py36h009560c_0 cython 0.28.2 py36hfa6e2cd_0 cytoolz 0.9.0.1 py36hfa6e2cd_0 dask 0.17.5 py36_0 dask-core 0.17.5 py36_0 datashape 0.5.4 py36h5770b85_0 decorator 4.3.0 py36_0 distributed 1.21.8 py36_0 docutils 0.14 py36h6012d8f_0 entrypoints 0.2.3 py36hfd66bb0_2 et_xmlfile 1.0.1 py36h3d2d736_0 fastcache 1.0.2 py36hfa6e2cd_2 filelock 3.0.4 py36_0 flask 1.0.2 py36_1 flask-cors 3.0.4 py36_0 freetype 2.8 h51f8f2c_1 get_terminal_size 1.0.0 h38e98db_0 gevent 1.3.0 py36hfa6e2cd_0 glob2 0.6 py36hdf76b57_0 greenlet 0.4.13 py36hfa6e2cd_0 h5py 2.7.1 py36h3bdd7fb_2 hdf5 1.10.2 hac2f561_1 heapdict 1.0.0 py36_2 html5lib 1.0.1 py36h047fa9f_0 icc_rt 2017.0.4 h97af966_0 icu 58.2 ha66f8fd_1 idna 2.6 py36h148d497_1 imageio 2.3.0 py36_0 imagesize 1.0.0 py36_0 intel-openmp 2018.0.0 8 ipykernel 4.8.2 py36_0 ipython 6.4.0 py36_0 ipython_genutils 0.2.0 py36h3c5d0ee_0 ipywidgets 7.2.1 py36_0 isort 4.3.4 py36_0 itsdangerous 0.24 py36hb6c5a24_1 jdcal 1.4 py36_0 jedi 0.12.0 py36_1 jinja2 2.10 py36h292fed1_0 jpeg 9b hb83a4c4_2 jsonschema 2.6.0 py36h7636477_0 jupyter 1.0.0 py36_4 jupyter_client 5.2.3 py36_0 jupyter_console 5.2.0 py36h6d89b47_1 jupyter_core 4.4.0 py36h56e9d50_0 jupyterlab 0.32.1 py36_0 jupyterlab_launcher 0.10.5 py36_0 kiwisolver 1.0.1 py36h12c3424_0 lazy-object-proxy 1.3.1 py36hd1c21d2_0 libcurl 7.60.0 hc4dcbb0_0 libiconv 1.15 h1df5818_7 libpng 1.6.34 h79bbb47_0 libsodium 1.0.16 h9d3ae62_0 libssh2 1.8.0 hd619d38_4 libtiff 4.0.9 hb8ad9f9_1 libxml2 2.9.8 hadb2253_1 libxslt 1.1.32 hf6f1972_0 llvmlite 0.23.1 py36hcacf6c6_0 locket 0.2.0 py36hfed976d_1 lxml 4.2.1 py36heafd4d3_0 lzo 2.10 h6df0209_2 m2w64-gcc-libgfortran 5.3.0 6 m2w64-gcc-libs 5.3.0 7 m2w64-gcc-libs-core 5.3.0 7 m2w64-gmp 6.1.0 2 m2w64-libwinpthread-git 5.0.0.4634.697f757 2 markupsafe 1.0 py36h0e26971_1 matplotlib 2.2.2 py36h153e9ff_1 mccabe 0.6.1 py36hb41005a_1 menuinst 1.4.14 py36hfa6e2cd_0 mistune 0.8.3 py36hfa6e2cd_1 mkl 2018.0.2 1 mkl-service 1.1.2 py36h57e144c_4 mkl_fft 1.0.1 py36h452e1ab_0 mkl_random 1.0.1 py36h9258bd6_0 more-itertools 4.1.0 py36_0 mpmath 1.0.0 py36hacc8adf_2 msgpack-python 0.5.6 py36he980bc4_0 msys2-conda-epoch 20160418 1 multipledispatch 0.5.0 py36_0 navigator-updater 0.2.1 py36_0 nbconvert 5.3.1 py36h8dc0fde_0 nbformat 4.4.0 py36h3a5bc1b_0 netCDF4 1.4.0 networkx 2.1 py36_0 nltk 3.3.0 py36_0 nose 1.3.7 py36h1c3779e_2 notebook 5.5.0 py36_0 numba 0.38.0 py36h830ac7b_0 numexpr 2.6.5 py36hcd2f87e_0 numpy 1.14.3 py36h9fa60d3_1 numpy-base 1.14.3 py36h555522e_1 numpydoc 0.8.0 py36_0 odo 0.5.1 py36h7560279_0 olefile 0.45.1 py36_0 openpyxl 2.5.3 py36_0 openssl 1.0.2o h8ea7d77_0 packaging 17.1 py36_0 pandas 0.23.0 py36h830ac7b_0 pandoc 1.19.2.1 hb2460c7_1 pandocfilters 1.4.2 py36h3ef6317_1 parso 0.2.0 py36_0 partd 0.3.8 py36hc8e763b_0 path.py 11.0.1 py36_0 pathlib2 2.3.2 py36_0 patsy 0.5.0 py36_0 pep8 1.7.1 py36_0 pickleshare 0.7.4 py36h9de030f_0 pillow 5.1.0 py36h0738816_0 pip 10.0.1 py36_0 pkginfo 1.4.2 py36_1 pluggy 0.6.0 py36hc7daf1e_0 ply 3.11 py36_0 prompt_toolkit 1.0.15 py36h60b8f86_0 psutil 5.4.5 py36hfa6e2cd_0 py 1.5.3 py36_0 pycodestyle 2.4.0 py36_0 pycosat 0.6.3 py36h413d8a4_0 pycparser 2.18 py36hd053e01_1 pycrypto 2.6.1 py36hfa6e2cd_8 pycurl 7.43.0.1 py36h74b6da3_0 pyflakes 1.6.0 py36h0b975d6_0 pygments 2.2.0 py36hb010967_0 pylint 1.8.4 py36_0 pyodbc 4.0.23 py36h6538335_0 pyopenssl 18.0.0 py36_0 pyparsing 2.2.0 py36h785a196_1 pyqt 5.9.2 py36h1aa27d4_0 pyrinex 1.4.1 pysocks 1.6.8 py36_0 pytables 3.4.3 py36he6f6034_1 pytest 3.5.1 py36_0 pytest-arraydiff 0.2 py36_0 pytest-astropy 0.3.0 py36_0 pytest-doctestplus 0.1.3 py36_0 pytest-openfiles 0.3.0 py36_0 pytest-remotedata 0.2.1 py36_0 python 3.6.5 h0c2934d_0 python-dateutil 2.7.3 py36_0 pytz 2018.4 py36_0 pywavelets 0.5.2 py36hc649158_0 pywin32 223 py36hfa6e2cd_1 pywinpty 0.5.1 py36_0 pyyaml 3.12 py36h1d1928f_1 pyzmq 17.0.0 py36hfa6e2cd_1 qt 5.9.5 vc14he4a7d60_0 [vc14] qtawesome 0.4.4 py36h5aa48f6_0 qtconsole 4.3.1 py36h99a29a9_0 qtpy 1.4.1 py36_0 requests 2.18.4 py36h4371aae_1 rope 0.10.7 py36had63a69_0 ruamel_yaml 0.15.35 py36hfa6e2cd_1 scikit-image 0.13.1 py36hfa6e2cd_1 scikit-learn 0.19.1 py36h53aea1b_0 scipy 1.1.0 py36h672f292_0 seaborn 0.8.1 py36h9b69545_0 send2trash 1.5.0 py36_0 setuptools 39.1.0 py36_0 simplegeneric 0.8.1 py36_2 singledispatch 3.4.0.3 py36h17d0c80_0 sip 4.19.8 py36h6538335_0 six 1.11.0 py36h4db2310_1 snappy 1.1.7 h777316e_3 snowballstemmer 1.2.1 py36h763602f_0 sortedcollections 0.6.1 py36_0 sortedcontainers 1.5.10 py36_0 sphinx 1.7.4 py36_0 sphinxcontrib 1.0 py36hbbac3d2_1 sphinxcontrib-websupport 1.0.1 py36hb5e5916_1 spyder 3.2.8 py36_0 sqlalchemy 1.2.7 py36ha85dd04_0 sqlite 3.23.1 h35aae40_0 statsmodels 0.9.0 py36h452e1ab_0 sympy 1.1.1 py36h96708e0_0 tblib 1.3.2 py36h30f5020_0 terminado 0.8.1 py36_1 testpath 0.3.1 py36h2698cfe_0 tk 8.6.7 hcb92d03_3 toolz 0.9.0 py36_0 tornado 5.0.2 py36_0 traitlets 4.3.2 py36h096827d_0 typing 3.6.4 py36_0 unicodecsv 0.14.1 py36h6450c06_0 urllib3 1.22 py36h276f60a_0 vc 14 h0510ff6_3 vs2015_runtime 14.0.25123 3 wcwidth 0.1.7 py36h3d5aa90_0 webencodings 0.5.1 py36h67c50ae_1 werkzeug 0.14.1 py36_0 wheel 0.31.1 py36_0 widgetsnbextension 3.2.1 py36_0 win_inet_pton 1.0.1 py36he67d7fd_1 win_unicode_console 0.5 py36hcdbd4b5_0 wincertstore 0.2 py36h7fe50ca_0 winpty 0.4.3 4 wrapt 1.10.11 py36he5f5981_0 xarray 0.10.7 xlrd 1.1.0 py36h1cb58dc_1 xlsxwriter 1.0.4 py36_0 xlwings 0.11.8 py36_0 xlwt 1.3.0 py36h1a4751e_0 yaml 0.1.7 hc54c509_2 zeromq 4.2.5 hc6251cf_0 zict 0.1.3 py36h2d8e73e_0 zlib 1.2.11 h8395fce_2

Take measures by a range date after load

Well, after to read a lot, I could not find something that allows me to restrict the measures by provide a range of two dates. The reason to do that, is that my rinex is really heavy. and the .load() would be too unnecessary!

So, when read by the first time, I can set the full-day reading, like:

obs = gr.load(complete_path, meas=columns, use=constellations)

and if I want a specific range, I would just use 'tlim' tag. Ok, so, after to get my obs, I want to get all measures that is related to a specific date, without to read it again. So, I've tried:

obs_short = obs.sel(time=[initial_date, final_date])

but obs_short will be only a two measures variable, not a range! I also have tried tlim in the .sel():

obs_short = obs.sel(tlim=[initial_date, final_date])

but there is no such property in .sel!

Someone could help?

rinexheader does not parse rinex file with more than 9 observation types

submitting to rinexheader function a rinex file with more than 9 observation types, like the following:

10    C1    L1    S1    P2    L2    S2    C2    C5    L5 # / TYPES OF OBSERV
        S5                                                                   # / TYPES OF OBSERV

I got a parsing error and I fixed It modifing module obs2.py as shown below:

BEFORE FIXING

137        if '# / TYPES OF OBSERV' in h:
138           if Nobs is None:
139                Nobs = int(c[:6])
140                c = c[6:].split()

AFTER FIXING

137        if '# / TYPES OF OBSERV' in h:
138           if Nobs is None:
139                Nobs = int(c[:6])
140           c = c[6:].split()

Regards

Sergio Bruni

np.genfromtxt time consumption

Dear Scivision,

I put your latest release v1.6.1 in a profiler. After getting rid of xarrax.concat and .merge, the new bottle neck is the 'np.genfromtxt' function:

darr = np.genfromtxt(BytesIO(raws.encode('ascii')), delimiter=[Lf, 1, 1]*hdr['Nobs'])

I know np.genfromtxt is handy, but not the fastest. Did you checkout pandas.read_csv or pandas.read_fwf? Alternatively, a specialized self-written read function may be quickest. I think it is worth spending some extra thoughts on this one, since it is the center-piece of the whole software.

Exception while reading observation file

  1. The RINEX file is this one: https://rnl.ae.utexas.edu/texcup/2019May09-rover/asterx4/SEPT1291.19O
    (9M)
  2. traceback for the code
    gr.load(SEPTENTRIO_ASTERX4_DATA)

IndexError Traceback (most recent call last)
in
----> 1 OBSERVABLES = gr.load(SEPTENTRIO_ASTERX4_DATA)
2 #OBSERVABLES = gr.rinexheader(SEPTENTRIO_ASTERX4_DATA)

~/h/virtualenvs/i/lib/python3.8/site-packages/georinex/base.py in load(rinexfn, out, use, tlim, useindicators, meas, verbose, overwrite, fast, interval)
64 overwrite=overwrite)
65 elif info['rinextype'] == 'obs':
---> 66 return rinexobs(rinexfn, outfn, use=use, tlim=tlim,
67 useindicators=useindicators, meas=meas,
68 verbose=verbose,

~/h/virtualenvs/i/lib/python3.8/site-packages/georinex/base.py in rinexobs(fn, outfn, use, group, tlim, useindicators, meas, verbose, overwrite, fast, interval)
184
185 if int(info['version']) in (1, 2):
--> 186 obs = rinexobs2(fn, use, tlim=tlim,
187 useindicators=useindicators, meas=meas,
188 verbose=verbose,

~/h/virtualenvs/i/lib/python3.8/site-packages/georinex/obs2.py in rinexobs2(fn, use, tlim, useindicators, meas, verbose, fast, interval)
36 attrs: Dict[str, Any] = {}
37 for u in use:
---> 38 o = rinexsystem2(fn, system=u, tlim=tlim,
39 useindicators=useindicators, meas=meas,
40 verbose=verbose,

~/h/virtualenvs/i/lib/python3.8/site-packages/georinex/obs2.py in rinexsystem2(fn, system, tlim, useindicators, meas, verbose, fast, interval)
231 data[i3+2, j, isv] = darr[:, k3+2]
232 else:
--> 233 data[i, j, isv] = darr[:, k]
234 # %% output gathering
235 data = data[:, :times.size, :] # trims down for unneeded preallocated

IndexError: index 57 is out of bounds for axis 2 with size 36

  1. Python version is
    3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18)
    [Clang 6.0 (clang-600.0.57)]
    (running inside jupyter)

Error reading rinex files

Hello Michael,

I was trying to read broadcast ephemerides from BKG GNSS data centre.
The rinex files can be downloaded using in the following link

https://files.fm/u/efm5v89e

when i read the data i get following error

E NAV data @ ['2018-09-18T00:00:00.000000000' '2018-09-18T00:10:00.000000000'
'2018-09-18T00:20:00.000000000' '2018-09-18T00:30:00.000000000'
'2018-09-18T00:40:00.000000000' '2018-09-18T00:50:00.000000000'
'2018-09-18T01:00:00.000000000' '2018-09-18T01:20:00.000000000'
'2018-09-18T01:30:00.000000000' '2018-09-18T01:40:00.000000000'
'2018-09-18T01:50:00.000000000' '2018-09-18T02:00:00.000000000'
'2018-09-18T02:10:00.000000000' '2018-09-18T02:20:00.000000000'
'2018-09-18T02:30:00.000000000' '2018-09-18T02:40:00.000000000'
'2018-09-18T02:50:00.000000000' '2018-09-18T03:20:00.000000000'
'2018-09-18T03:30:00.000000000' '2018-09-18T03:50:00.000000000'
'2018-09-18T04:00:00.000000000' '2018-09-18T04:20:00.000000000'
'2018-09-18T05:10:00.000000000' '2018-09-18T05:20:00.000000000'
'2018-09-18T06:30:00.000000000' '2018-09-18T06:40:00.000000000'
'2018-09-18T14:00:00.000000000' '2018-09-18T14:10:00.000000000'
'2018-09-18T14:20:00.000000000' '2018-09-18T14:30:00.000000000'
'2018-09-18T14:40:00.000000000' '2018-09-18T14:50:00.000000000'
'2018-09-18T15:00:00.000000000' '2018-09-18T15:10:00.000000000'
'2018-09-18T16:30:00.000000000' '2018-09-18T16:40:00.000000000'
'2018-09-18T16:50:00.000000000' '2018-09-18T17:00:00.000000000'
'2018-09-18T17:10:00.000000000' '2018-09-18T17:40:00.000000000']
is not the same length as the number of fields.

could you please help me look at this tell me what the issue.

60 seconds

Hi there,

One of the sp3 files for ESA's Swarm mission (ftp://swarm-diss.eo.esa.int/Level1b/Latest_baselines/GPSxNAV/, Satellite A, file for November 26th 2013) contains the following line:

  • 2013 11 26 0 1 60.00000000

When trying to read this line with load_sp3, the datetime library complains with the following error:

ValueError: second must be in 0..59

The error is of course correct (this one file alone contains this error 64 times), so I see two options here:

  1. Put on my Don-Quijote-hat and try to convince ESA that this is an error and that they should debug their data product processing chain and reprocess the entire seven years of Swarm data; or
  2. check for such errors in sp3dt, and fix them there.

Now, I know what I am going to do. So the real question becomes: would you be interested in pulling such a correction of wrong times into the georinex package, or is your position that whoever is responsible for producing sp3 files should take care of this issue, and it is not the responsibility of georinex to handle other people's mistake?

Cheers
Lasse

Error when loading high-rate data

High-rate data are usually available as Hatanaka-compressed files:
https://cddis.nasa.gov/archive/gnss/data/highrate/2020/288/20d/00/
As I decompress one of these files, turning it into a readable observation file (for instance, gamb288a00.20o), I get an error by simply trying to load the file; in particular, the error is usually of this type:

File "...\Python\Python39\lib\site-packages\georinex\obs2.py", line 233, in rinexsystem2
data[i, j, isv] = darr[:, k]
IndexError: index 37 is out of bounds for axis 2 with size 36

In some previous issues it has been reported that the error may arise from line 94 of obs2.py; nevertheless, even if I change that value (Nsvsys = 36) the error message does not change. Moreover, for certain high-rate observation files georinex works perfectly, so I guess there is some counting issue that I cannot detect. As of now, I've been using georinex for quite some months and I just started using it for high-rate data: I wonder if high-rate files differ in some crucial aspect, making them more likely to fail.

Python version: Python 3.9.0 64bit

Select signals per GNSS system

Dear Michael,

I have another question. Suppose we have a mixed GPS / Galileo RINEX observation file. Both systems have as observable type C1C and L1C. Now suppose that I only to read the C1C for both systems but only the C1C signal for Galileo. How should I specify the "meas" or do I have to select the same signals for both GNSS systems if they are both available?

kind regards
Alain

got an error when run "python tests/test.py"

Hi, @scivision Thanks for your great work on this package.

I got an error when i run python tests/test.py, I have successfully catkin_make this package.

_EE

ERROR: test.test_obs

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/wenws/pyrinex/tests/test.py", line 15, in test_obs
truth = read_hdf(str(rdir/'tests/demo.h5'),key='OBS')
File "/usr/lib/python2.7/dist-packages/pandas/io/pytables.py", line 325, in read_hdf
return f(store, True)
File "/usr/lib/python2.7/dist-packages/pandas/io/pytables.py", line 317, in
key, auto_close=auto_close, **kwargs)
File "/usr/lib/python2.7/dist-packages/pandas/io/pytables.py", line 643, in select
raise KeyError('No object named %s in the file' % key)
KeyError: 'No object named OBS in the file'

======================================================================
ERROR: test.test_nav

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/wenws/pyrinex/tests/test.py", line 21, in test_nav
truthnav = read_hdf(str(rdir/'tests/demo.h5'),key='NAV')
File "/usr/lib/python2.7/dist-packages/pandas/io/pytables.py", line 323, in read_hdf
store = HDFStore(path_or_buf, **kwargs)
File "/usr/lib/python2.7/dist-packages/pandas/io/pytables.py", line 398, in init
self.open(mode=mode, **kwargs)
File "/usr/lib/python2.7/dist-packages/pandas/io/pytables.py", line 549, in open
raise e
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe0 in position 0: unexpected end of data


Ran 2 tests in 0.020s

FAILED (errors=2)
Closing remaining open files:/home/wenws/pyrinex/tests/demo.h5...done_

Proposal: Make lli and ssi optioal

Dear Scivision,

Your Rinex3 parser does not only read all observations, but also all lli and ssi indicators. Both come with every phase observation and are stored as floats. They take up a large share of the output xarray size.

From my experience, those indicators are irrelevant for most applications.

I propose to make the lli and ssi parsing optional to save memory and potentially also parsing time. Besides, parsing/storing them as integers would make the xarray output more consistent with the nature/definition of the indicators. Personally, I would ignore thr indicators completely.

Thanks for your hard work!

Best Regards
Volker

Microseconds Error in sp3 Reader

The time in the file is:
2018 9 23 0 2 37.63292462

Georinex is saving datetime as:
2018-9-23T00:02:37.063292 (incorrect)

instead of:
2018-9-23T00:02:37.63292 (correct)

See first data point entry:
Screen Shot 2020-03-23 at 1 20 30 PM

What is stored inside georinex.to_datetime(data.time[ii]) (first element of the saved dates in sp3 file). this should equal the first date point in file above:
image

To fix, must multiply what is saved in microseconds by 10.

-Shaylah Mutschler

Unable to open file (ValueError: could not broadcast input array...)

I am currently working with the Rinex files from the esa, but unfortunately I cannot load any of the Rinex version 3 files in the daily directory.
Thank you very much for your help!

File:
ftp://gssc.esa.int/gnss/data/daily/2019/brdc/BRDC00IGS_R_20191330000_01D_MN.rnx.gz

Click to view exception
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
 in 
     29 test = 'data/gnss/data/daily/2019/brdc/BRDC00IGS_R_20191330000_01D_MN.rnx.gz'
     30 
---> 31 obs = gr.load(test, fast=False)
     32 
     33 

~/.local/lib/python3.7/site-packages/georinex/base.py in load(rinexfn, out, use, tlim, useindicators, meas, verbose, fast, interval)
     57 
     58     if info['rinextype'] == 'nav':
---> 59         return rinexnav(rinexfn, outfn, use=use, tlim=tlim)
     60     elif info['rinextype'] == 'obs':
     61         return rinexobs(rinexfn, outfn, use=use, tlim=tlim,

~/.local/lib/python3.7/site-packages/georinex/base.py in rinexnav(fn, outfn, use, group, tlim)
    130         nav = rinexnav2(fn, tlim=tlim)
    131     elif int(info['version']) == 3:
--> 132         nav = rinexnav3(fn, use=use, tlim=tlim)
    133     else:
    134         raise LookupError(f'unknown RINEX  {info}  {fn}')

~/.local/lib/python3.7/site-packages/georinex/nav3.py in rinexnav3(fn, use, tlim)
    101         for j, i in enumerate(svi):
    102             darr[j, :] = np.genfromtxt(io.BytesIO(raws[i].encode('ascii')),
--> 103                                        delimiter=Lf)
    104 
    105 # %% discard duplicated times

ValueError: could not broadcast input array from shape (29) into shape (28)


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.