Bv2.1 8.4 We must have <Hash>es
[libdcp.git] / scripts / plotdiff
1 #!/usr/bin/python
2
3 import sys
4 import matplotlib.pylab as plt
5 import numpy
6
7 mean = None
8 deviation = None
9
10 with open(sys.argv[1], 'r') as f:
11     for l in f:
12         l = l.strip()
13         s = l.split()
14
15         if l.find("out of range") != -1:
16             continue
17
18         if l.startswith('Compared'):
19             N = int(s[3])
20             if mean is None:
21                 mean = numpy.zeros(int(s[5]))
22                 deviation = numpy.zeros(int(s[5]))
23         elif l.startswith('mean'):
24             print s
25             mean[N] = float(s[2])
26             deviation[N] = float(s[4])
27
28 plt.plot(mean)
29 plt.plot(deviation)
30 plt.show()