-
Notifications
You must be signed in to change notification settings - Fork 42
/
example2.py
64 lines (54 loc) · 1.98 KB
/
example2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# example file for ppp-tools
# https://github.com/aewallin/ppp-tools
#
import datetime
import os
import matplotlib.pyplot as plt
import time
import numpy
import matplotlib
matplotlib.rcParams['axes.formatter.useoffset'] = False
# import ppp_rtklib
# import ppp_glab
import ppp_gpsppp
import station
import ppp_common
station1 = station.mi04
station2 = station.mi05
products = "rapid"
def read_days( station1, station2, dt_list ):
current_dir = os.getcwd()
all_t=[]
all_d=[]
for dt in dt_list:
(t_gpspace, d_gpspace) = ppp_common.diff_stations(current_dir, station1, station2, dt, products, "gpspace")
for (t,d) in zip(t_gpspace, d_gpspace):
all_t.append(t)
all_d.append(d)
return (all_t, all_d)
dt = datetime.datetime.utcnow()-datetime.timedelta(days=4) # 4 days ago
current_dir = os.getcwd()
day_list = []
#for n in [8, 7, 6, 5, 4, 3]:
for n in [ 12, 11, 10, 9, 8, 7, 6, 5, 4, 3]:
day_list.append( datetime.datetime.utcnow()-datetime.timedelta(days=n) )
(t45, d45) = read_days( station.mi04, station.mi05, day_list )
(t25, d25) = read_days( station.mi02, station.mi05, day_list )
(t24, d24) = read_days( station.mi02, station.mi04, day_list )
# compute double difference
# (t_glab,d_glab) = ppp_common.diff_stations(current_dir, station1, station2, dt, products, "glab")
# (t_rtklib,d_rtklib) = ppp_common.diff_stations(current_dir, station1, station2, dt, products, "rtklib")
#(t_gpspace, d_gpspace) = ppp_common.diff_stations(current_dir, station1, station2, dt, products, "gpspace")
plt.figure()
plt.title("%s - %s receiver clock, double difference"%(station1.name, station2.name))
#plt.plot(t_glab,d_glab, label="glab")
#plt.plot(t_rtklib,d_rtklib, label="rtklib")
plt.plot(t45, numpy.array(d45), label="4-5 gpspace")
plt.plot(t25, numpy.array(d25), label="2-5 gpspace")
plt.plot(t24, d24, label="2-4 gpspace")
#plt.ylim((-3, 3))
plt.legend(loc="best")
plt.grid()
plt.ylabel("%s - %s / ns" %(station1.name, station2.name))
plt.show()