example3.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 """
4 An example of reading a rinex file and extracting the
5 pseudrange obs and computing a biased multipath observation.
6 """
7 
8 # We recommend only using
9 # 'import gnsstk',
10 # but if you need constants fairly often, then importing them specifically at once
11 # may be easier than referring to them by gnsstk.L1_FREQ_GPS.
12 from gnsstk import C_MPS, GAMMA_GPS, L1_FREQ_GPS
13 import gnsstk
14 
15 
16 rfn = gnsstk.getPathData() + '/test_input_rinex2_obs_RinexObsFile.06o'
17 
18 # Make a GNSSTk SatID used to find a specific satellite in the data
19 svid = gnsstk.RinexSatID(5, gnsstk.SatelliteSystem.GPS)
20 
21 try:
22  header, data = gnsstk.readRinex3Obs(rfn, strict=True)
23  print header
24 
25  # Loop through all the epochs and process the data for each one
26  for d in data:
27  # Note that d is now a Rinex3ObsData
28 
29  # Check if the PRN is in view (by searching for it)
30  if d.obs.find(svid) == d.obs.end():
31  print gnsstk.CivilTime(d.time), 'svid', svid, 'not in view'
32  else:
33  P1 = d.getObs(svid, "C1W", header).data
34  P2 = d.getObs(svid, "C2W", header).data
35  L1 = d.getObs(svid, "L1C", header).data
36  mu = P1 - L1*(C_MPS/L1_FREQ_GPS) - 2*(P1-P2)/(1-GAMMA_GPS)
37  print gnsstk.CivilTime(d.time), svid, 'biased multipath', mu
38 
39 # We can catch any custom gnsstk exception like this:
40 except gnsstk.InvalidRequest as e:
41  print "InvalidRequest:",e
42 except gnsstk.Exception as e:
43  print e
44 
gnsstk::Exception
Definition: Exception.hpp:151
gnsstk::CivilTime
Definition: CivilTime.hpp:55
gnsstk::RinexSatID
Definition: RinexSatID.hpp:63


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39