Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
anand-satnav opened this issue May 3, 2019 · 3 comments
Open

Comments

@anand-satnav
Copy link

anand-satnav commented May 3, 2019

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

@anand-satnav
Copy link
Author

anand-satnav commented May 3, 2019

I inspected the code and I think I might have found the bug. Please confirm

File : georinex/obs3.py
Function : _epoch
Line : 204 - 209

When a single satellite system is present in hdr['fields'], the elif condition is triggered calling xarray.concat. Concatenation of data and epoch_data results in an empty dataset since data is empty. This is surprising as I expected it to concatenate all 'epoch_data' information into 'data'

When I remove this elif condition, and re-run the problem is solved . The else condition is triggered calling xarray.merge which correctly merges data and epoch_data

Note
The if condition is never triggered in this case since len(data) evaluates to 2 even when it is empty

@scivision
Copy link
Member

Thanks for the detailed report, we'll look into this

@scivision
Copy link
Member

scivision commented Sep 3, 2019

Sorry for my delay. Using your file:

dat = gr.load("cutsamp.16o",meas=['C1C','S1C',],use=['G'])

results in

<xarray.Dataset>
Dimensions:  (sv: 12, time: 1)
Coordinates:
  * time     (time) datetime64[ns] 2016-01-08
  * sv       (sv) <U3 'G18' 'G07' 'G15' 'G17' 'G20' ... 'G30' 'G05' 'G13' 'G19'
Data variables:
    C1C      (time, sv) float64 2.519e+07 2.588e+07 ... 2.053e+07 2.23e+07
    S1C      (time, sv) float64 35.8 33.0 48.2 49.6 43.2 ... 43.5 42.1 49.9 49.0
Attributes:
    version:            3.02
    interval:           30.0
    rinextype:          obs
    fast_processing:    0
    time_system:        GPS
    filename:           cutsamp.16o
    position:           [-2364337.2971, 4870285.5843, -3360809.8188]
    position_geodetic:  (-32.003888575142994, 115.89479894212391, 24.00298790...

I wonder if something has been fixed in xarray or georinex in the meanwhile. I just tested this with

  • georinex git revision 2a7a614
  • pandas 0.24.2
  • xarray 0.12.1
  • python 3.7.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants