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

an error encounter in "bias = data[:,sv_of_interest,'L1','data']*(3.0E8/f1)-data[:,sv_of_interest,'C1','data']" #3

Open
weisongwen opened this issue Nov 15, 2017 · 17 comments

Comments

@weisongwen
Copy link

Hi, @gregstarr Thanks for your great work on this package,

I encounder an error when I run as the tutorial here (https://github.com/gregstarr/PyGPS/blob/master/Examples/ReadRinex%20Demo.ipynb).

The error can be seen as following:
_Traceback (most recent call last):
File "readRinexObs_wws.py", line 80, in
bias = data[:,sv_of_interest,'L1','data']*(3.0E8/f1)-data[:,sv_of_interest,'C1','data']
File "/usr/lib/python2.7/dist-packages/pandas/core/panel.py", line 254, in getitem
return super(Panel, self).getitem(key)
File "/usr/lib/python2.7/dist-packages/pandas/core/generic.py", line 999, in getitem
return self._get_item_cache(item)
File "/usr/lib/python2.7/dist-packages/pandas/core/generic.py", line 1003, in get_item_cache
res = cache.get(item)
TypeError: unhashable type

it seems that there is something wrong with this sentence:
bias = data[:,sv_of_interest,'L1','data']*(3.0E8/f1)-data[:,sv_of_interest,'C1','data']

Apart from this, if i read the infromation into data with this sentence:
data = rinexobs("data/wws.15o")
it means that the pseudorange is contained in "data"? how can i get the pseudorange of each satellites from "data"?

The type of "data" is pandas.core.panelnd.Panel4D,

best regards
welson

@gregstarr
Copy link
Owner

gregstarr commented Nov 15, 2017 via email

@gregstarr
Copy link
Owner

gregstarr commented Nov 15, 2017 via email

@weisongwen
Copy link
Author

hi, @gregstarr thanks for your reply.

As i am using ros jade, which need the python 2.7. is there any way that i can get pseudorange from "data" using python 2.7?

@weisongwen
Copy link
Author

Hi, @gregstarr
I have change it to adapt to the python2.7 in ROS. I can read the .nav file now, but i can get the position of each satellites with getSatXYZ(nav,sv,times): in gps.py file. But how can i know which satellites does each position belongs to (satpos1), for example, which belongs to GPS satellites 2 (there are many gps satellites ).

@weisongwen
Copy link
Author

Hi, @gregstarr sorry to bother you again here. I want to get the pseudorange from .obs file and get and satellites positions from .nav file.

  1. I read .obs file using rinexobs() from your package.
    code: head,data = gps.rinexobs(files[0],returnHead=True)
  2. I read .nav file using "readRinexNav"
    code: "nav = gps.readRinexNav('data/brdc2800.15n')"

In this case, pseudorange is contained in "data", satellites position can be calculate by gps.getSatXYZ(nav,1,arr). but how can I get the pseudorange and position for a specific satellites?
I can get the pseudorange and position, but i do not know which satellites it belongs to.
for example, I want to get the pseudorange and position of G10 (number of satellite). As I want to calculate the position of receiver using WLS method.

My python file can be referred as following:
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.dates import YearLocator, MonthLocator, DateFormatter
from pandas import DataFrame, Panel4D, read_hdf
from glob import glob
from datetime import datetime
import time
import matplotlib
import random
import gps
from IPython.display import Image
from pandas import DataFrame,Series
import CoordTransforms3 as CT
import rinpy
from mpl_toolkits.mplot3d import Axes3D
files = glob('/home/wenws/PyGPS/Examples/data/mah
')
head,data = gps.rinexobs(files[0],returnHead=True)
nav = gps.readRinexNav('data/brdc2800.15n')
import datetime
satpos1 = gps.getSatXYZ(nav,1,arr)
satpos2 = gps.getSatXYZ(nav,2,arr)
satpos3 = gps.getSatXYZ(nav,3,arr)
satpos4 = gps.getSatXYZ(nav,4,arr)
*

best
Welson

@gregstarr
Copy link
Owner

gregstarr commented Nov 16, 2017 via email

@weisongwen
Copy link
Author

weisongwen commented Nov 17, 2017

Hi @gregstarr
Thanks for your advice, I can get the pseudorange for satellites with your method and the code can be see as following.

for index_epoch in data.labels:# index by epoch
		print '---------pseudorange for satellites in-',index_epoch
		for index_num_satellites in data.items:#index by satellites
			print 'pseudorange for satellites:',index_num_satellites
			print data[index_epoch,index_num_satellites,'C1','data']

in each epoch, i use this data[index_epoch,index_num_satellites,'C1','data'] to get pseudorange for the satellite (number:index_num_satellites). The result can be seen as following:

---------pseudorange for satellites in- 2015-10-07 06:00:53
pseudorange for satellites: 2
23556062.375
pseudorange for satellites: 3
21857212.563
pseudorange for satellites: 6
21835345.109
pseudorange for satellites: 9
21829638.156
pseudorange for satellites: 23
20598098.508
---------pseudorange for satellites in- 2015-10-07 06:00:54
pseudorange for satellites: 2
23555617.211
pseudorange for satellites: 3
21857749.141
pseudorange for satellites: 6
21835329.313
pseudorange for satellites: 9
21829116.5
pseudorange for satellites: 23
20598020.336

But how can I get the satellite position for each satellites in each epoch? for example, the position of satellites G23.

Best
Welson

@gregstarr
Copy link
Owner

gregstarr commented Nov 17, 2017 via email

@weisongwen
Copy link
Author

Hi @gregstarr
Thanks for your advice, I can successfully get the satellite position based on your advice.

Best
Welson

@gregstarr
Copy link
Owner

gregstarr commented Nov 17, 2017 via email

@weisongwen
Copy link
Author

weisongwen commented Nov 17, 2017

Hi, @gregstarr , 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                   

best
Welson

@gregstarr
Copy link
Owner

gregstarr commented Nov 17, 2017 via email

@gregstarr
Copy link
Owner

gregstarr commented Nov 17, 2017 via email

@weisongwen
Copy link
Author

Hi, @gregstarr Thanks for your kind reply and revision. Thanks a lot.
I think it is available to read rinex3 .nav file now.

Besides, I am trying to conduct weighted least square (WLS) method to calculate position of GPS receiver. Do you have any function to do this?

best
Welson

@gregstarr
Copy link
Owner

gregstarr commented Nov 17, 2017 via email

@weisongwen
Copy link
Author

Hi, @gregstarr
Thanks for your knid reply, In this case, I will try to add the function of weighted least square (WLS) method.

Best
Welson

@gregstarr
Copy link
Owner

gregstarr commented Nov 20, 2017 via email

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

No branches or pull requests

2 participants