Loading GPS orbits from Rinex NAV file?

Asked by mungewell

Hi,
I discovered pyephem when performing some analysis of raw GPS data. My desire was to quickly compute GPS satellite location in Azimuth/Elevation and my previous solution (GPStk's 'wheresat') was proving very slow to compute 1Hz positions.

I successfully used the 'readtle' function to load/compute the orbits, but have the feeling that these will not be as accurate as the ephemeris transmitted by the satellites themselves - which I have in the form of a Rinex NAV file.

Does anyone know of a method to import/convert/read the from a NAV file?
Simon.

Sample NAV below
--
     2.10 N: GPS NAV DATA RINEX VERSION / TYPE
RTKCONV 2.4.1 20111026 152034 UTC PGM / RUN BY / DATE
log: C:\Users\swood\Desktop\20111018_overnight\RAW10111019 COMMENT
format: NovAtel OEM4/V COMMENT
    2.5146E-08 -7.4506E-09 -1.1921E-07 1.1921E-07 ION ALPHA
    1.3107E+05 -1.6384E+04 -1.9661E+05 -6.5536E+04 ION BETA
     .000000000000E+00 .000000000000E+00 503808 1658 DELTA-UTC: A0,A1,T,W
    15 LEAP SECONDS
                                                            END OF HEADER
27 11 8 10 23 59 44.0 .293537508696E-03 .386535248253E-11 .000000000000E+00
     .910000000000E+02 .859062500000E+02 .397980863215E-08 -.204959952042E+01
     .499747693539E-05 .215929013211E-01 .220909714699E-05 .515364279747E+04
     .345584000000E+06 .106170773506E-06 .849556551143E+00 .493600964546E-06
     .981332201865E+00 .346875000000E+03 -.121844958010E+01 -.792675875275E-08
     .311798701953E-09 .100000000000E+01 .164800000000E+04 .000000000000E+00
     .240000000000E+01 .630000000000E+02 -.419095158577E-08 .910000000000E+02
     .338556000000E+06 .400000000000E+01
--

Question information

Language:
English Edit question
Status:
Answered
For:
PyEphem Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
mungewell (simon-mungewell) said :
#1

Here's a quick comparison between my script and GPStk's 'wheresat'.

--
$ wheresat.exe -p 1 -e ../rinex_gps_glonass/RAW1011102100.nav -f "%4F_%010.3g" --start="10/21/2011 06:00:15" -u "-1635377.1361 -3665372.6408 4941664.1946" | head -n 30
Scanning over prnSet.
Scan complete, size = 1
Scanning over PRNs indices.
Scan complete, size = 1
Set timeFormat to %4F_%010.3g
positionOpt has count = 1
# time, PRN, X(m), Y(m), Z(m), Clock Correction(ms), Azimuth(deg), Elevation(deg), Range(m)
File read by EphReader.
10/21/2011 06:00:15
10/21/2011 18:00:00
1658_453615.000 1 -17243579.062 -3462659.095 19889982.761 0.042121 287.903 45.806 21587470.047
1658_454515.000 1 -18181568.633 -5459328.551 18563831.884 0.042146 278.244 47.502 21481909.842
1658_455415.000 1 -19133873.329 -7261100.358 16917926.110 0.042171 267.898 47.519 21481878.682
1658_456315.000 1 -20061089.121 -8845371.192 14980638.294 0.042195 257.842 45.852 21587679.410
1658_457215.000 1 -20921707.465 -10197677.027 12785358.304 0.042220 248.846 42.720 21795723.659
1658_458115.000 1 -21673746.266 -11312049.795 10369915.426 0.042245 241.233 38.470 22098740.548
1658_459015.000 1 -22276411.910 -12191047.263 7775924.133 0.042270 234.954 33.457 22486278.141
1658_459915.000 1 -22691727.749 -12845455.923 5048064.631 0.042295 229.776 27.980 22945401.375
1658_460815.000 1 -22886065.726 -13293679.148 2233311.130 0.042320 225.428 22.268 23461471.371
1658_461715.000 1 -22831521.297 -13560836.474 -619880.644 0.042345 221.660 16.491 24018907.742
1658_462615.000 1 -22507078.443 -13677606.940 -3462407.437 0.042370 218.259 10.771 24601854.701
1658_463515.000 1 -21899519.728 -13678866.016 -6245365.779 0.042395 215.055 5.203 25194728.900
1658_464415.000 1 -21004044.993 -13602167.080 -8920893.368 0.042420 - - -
1658_465315.000 1 -19824575.465 -13486128.027 -11442991.485 0.042444 - - -
1658_466215.000 1 -18373731.115 -13368785.997 -13768314.060 0.042469 - - -
1658_467115.000 1 -16672481.979 -13285984.436 -15856909.935 0.042494 - - -
1658_468015.000 1 -14749486.726 -13269855.304 -17672905.779 0.042519 - - -
1658_468915.000 1 -12640143.664 -13347455.389 -19185118.261 0.042544 - - -
1658_469815.000 1 -10385390.391 -13539609.646 -20367585.378 0.042569 - - -
1658_470715.000 1 -8030297.770 -13860006.350 -21200008.272 0.042594 - - -

$ python wheresat.py -p 1 -s 1319176800 | head -n 20
1658_453615.000 1 0 0 0 0 287.64385463 45.8833666931 21613000.0
1658_454515.000 1 0 0 0 0 277.964055897 47.5382839629 21507782.0
1658_455415.000 1 0 0 0 0 267.619843682 47.5136372253 21508050.0
1658_456315.000 1 0 0 0 0 257.587279339 45.8078043103 21614092.0
1658_457215.000 1 0 0 0 0 248.627355223 42.6455052717 21822312.0
1658_458115.000 1 0 0 0 0 241.052757396 38.3737512856 22125432.0
1658_459015.000 1 0 0 0 0 234.807778834 33.3464656791 22513000.0
1658_459915.000 1 0 0 0 0 229.659291521 27.8619877001 22972082.0
1658_460815.000 1 0 0 0 0 225.334825549 22.1496665632 23488044.0
1658_461715.000 1 0 0 0 0 221.584737506 16.380357743 24045312.0
1658_462615.000 1 0 0 0 0 218.199176659 10.6831458384 24628038.0
1658_463515.000 1 0 0 0 0 215.005926619 5.18521281361 25220648.0
1658_464415.000 1 0 0 0 0 211.863206317 0.199962939338 25808254.0
1658_465315.000 1 0 0 0 0 - - -
1658_466215.000 1 0 0 0 0 - - -
1658_467115.000 1 0 0 0 0 - - -
1658_468015.000 1 0 0 0 0 - - -
1658_468915.000 1 0 0 0 0 - - -
1658_469815.000 1 0 0 0 0 - - -
1658_470715.000 1 0 0 0 0 - - -

Revision history for this message
Brandon Rhodes (brandon-rhodes) said :
#2

I myself don't have a library for reading a NAV file — I would suggesting asking your question on Stack Overflow, where it will reach a much wider audience. Good luck — and if you tag your Stack Overflow question “PyEphem,” then I will watch its progress and could pull any good advice you get back into the PyEphem docs.

Can you help with this problem?

Provide an answer of your own, or ask mungewell for more information if necessary.

To post a message you must log in.