-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot.py
52 lines (30 loc) · 859 Bytes
/
plot.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
import numpy as np
import matplotlib.pyplot as pt
import re
import time
def make_plot():
with open("data.txt", "a") as f :
while f.readline() is not none
try:
tokens = f.readline().split()
except:
print 'error'
stamp = tokens[0].replace("_", " ").replace("."," ").split()
seconds = stamp[3]*1200 + stamp[4]*60 + stamp[5]
if stamp[1] is 13:
t.append(tokens[3])
s.append(seconds)
elif stamp[1] is 14:
plt_13.plot(t, s)
#plt_14.plot(t, s)
plt13.xlabel('seconds')
plt13.ylabel('wavelength')
plt13.title("live stream data 13th Feb")
plt13.grid(True)
plt13.savefig("live stream data 13th Feb")
#plt14.xlabel('seconds')
#plt14.ylabel('savelength')
#plt14.title("live stream data 14th Feb")
#plt14.grid(True)
#plt14.savefig("live stream data 14th Feb")
#plt.show()