Add script to plot output of dcpdiff.
authorCarl Hetherington <cth@carlh.net>
Thu, 3 Dec 2015 10:36:51 +0000 (10:36 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 3 Dec 2015 10:36:51 +0000 (10:36 +0000)
scripts/plotdiff [new file with mode: 0755]

diff --git a/scripts/plotdiff b/scripts/plotdiff
new file mode 100755 (executable)
index 0000000..debd700
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+import sys
+import matplotlib.pylab as plt
+import numpy
+
+mean = None
+deviation = None
+
+with open(sys.argv[1], 'r') as f:
+    for l in f:
+        l = l.strip()
+        s = l.split()
+        if l.startswith('Compared'):
+            N = int(s[3])
+            if mean is None:
+                mean = numpy.zeros(int(s[5]))
+                deviation = numpy.zeros(int(s[5]))
+        elif l.startswith('mean'):
+            mean[N] = float(s[2])
+            deviation[N] = float(s[5])
+
+plt.plot(mean)
+plt.plot(deviation)
+plt.show()