forked from muccc/iridium-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats.py
More file actions
executable file
·87 lines (65 loc) · 2.06 KB
/
Copy pathstats.py
File metadata and controls
executable file
·87 lines (65 loc) · 2.06 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/python
# vim: set ts=4 sw=4 tw=0 et fenc=utf8 pm=:
import sys
import matplotlib.pyplot as plt
import collections
f = open(sys.argv[1])
f.readline()
max_f = None
min_f = None
min_ts = None
max_ts = None
colors =['#cab2d6','#33a02c','#fdbf6f','#ffff99','#6a3d9a','#e31a1c','#ff7f00','#fb9a99','#b2df8a','#1f78b4','#aaaaaa', '#a6cee3']
frames = collections.OrderedDict()
frames['IMS'] = [colors[0], 'x', [], [], []]
frames['MSG'] = [colors[1], 'o', [], [], []]
frames['IRA'] = [colors[2], 'x', [], [], []]
frames['ISY'] = [colors[3], 'o', [], []]
frames['IBC'] = [colors[4], 'o', [], []]
frames['IU3'] = [colors[5], 'o', [], []]
frames['IDA'] = [colors[6], 'o', [], []]
frames['IIU'] = [colors[7], 'o', [], [], []]
frames['IIR'] = [colors[10], 'o', [], [], []]
frames['IIP'] = [colors[9], 'o', [], [], []]
frames['IIQ'] = [colors[8], 'o', [], [], []]
frames['VOC'] = [colors[11], 'o', [], []]
frames['VOD'] = [colors[1], 'x', [], []]
frames['VDA'] = [colors[2], 'o', [], []]
#frames['IRI'] = ['purple', 'x', [], []]
#frames['RAW'] = ['grey', 'x', [], []]
for line in f:
line = line.strip().split()
type = line[0][:-1]
#ts_base = int(line[1].split('-')[1].split('.')[0])
ts_base = 0
ts = ts_base + float(line[2])/1000.
f = int(line[3])
#len = int(line[6])
#strength = float(line[5])
if max_f == None or max_f < f:
max_f = f
if min_f == None or min_f > f:
min_f = f
if max_ts == None or max_ts < ts:
max_ts = ts
if min_ts == None or min_ts > ts:
min_ts = ts
if type in frames:
frames[type][2].append(ts)
frames[type][3].append(f)
for t in frames:
f = frames[t]
plt.scatter(y=f[3], x=f[2], c=f[0], label=t, alpha=1, edgecolors=f[0], marker=f[1], s=20)
#plt.colorbar()
#plt.ylim([min_f, max_f])
#plt.ylim([1624.95e6, 1626.5e6])
#plt.ylim([1616e6, 1627e6])
plt.ylim([1618e6, 1626.7e6])
#plt.xlim([1618e6, 1626.7e6])
#ax = plt.gca()
#ax.ticklabel_format(useOffset=False)
#ax.set_axis_bgcolor('white')
plt.xlim([min_ts, max_ts])
#plt.ylim([min_ts, max_ts])
plt.legend()
plt.show()