Scheduler
temperature.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import matplotlib.pyplot as plt
3 import sys
4 
5 filename = "reports/configuration.conftemperatureReport.txt"
6 if (len(sys.argv) > 1):
7  filename = sys.argv[1]
8 
9 with open(filename) as f:
10  print f.readline()
11  time = []
12  temp = []
13  for line in f:
14  entry = line.split(":")
15  #if (float(entry[0]) > 90000000):
16  time.append(float(entry[0]))
17  temp.append(float(entry[1]))
18 
19 
20 
21 #f = open("reports/energyReport.txt")
22 #line = f.readline()
23 #time2 = []
24 #power = []
25 #for line in f:
26 # entry = line.split(":")
27 # time2.append(float(entry[0]))
28 # power.append(float(entry[1]))
29 #f.close()
30 
31 
32 #avg = []
33 #buf = []
34 #bufindex = 0
35 #for i in range(0,20001):
36 # buf.append(temp[i])
37 #for i in range (0,10000):
38 # avg.append(0.0)
39 #sum = 0
40 #for i in range(0,20001):
41 # sum += buf[i]
42 #avg.append(sum/20001)
43 #for i in range(10001, len(temp)-10000):
44 # sum -= buf[bufindex]
45 # buf[bufindex] = temp[i+10000]
46 # sum += buf[bufindex]
47 # avg.append(sum/20001)
48 # bufindex += 1
49 # if (bufindex == 20000):
50 # bufindex = 0
51 #for i in range (len(temp)-10001,len(temp)-1):
52 # avg.append(0)
53 
54 
55 
56 
57 
58 
59 #avg = []
60 #alpha = 0.0001
61 #avg.append(0.0)
62 #for i in range(1,len(temp)):
63 # a = temp[i]*alpha + (1-alpha)*avg[i-1]
64 # avg.append(a)
65 
66 
67 plt.plot(time, temp, 'ro')
68 #plt.plot(time2, power, 'bo')
69 #plt.plot(time, avg, 'b-')
70 plt.show()