Automatic commit. Fri Sep 7 00:00:05 WST 2012
[matches/honours.git] / research / TCS / 2012-09-06 / focus / analysis.py
diff --git a/research/TCS/2012-09-06/focus/analysis.py b/research/TCS/2012-09-06/focus/analysis.py
new file mode 100755 (executable)
index 0000000..e900b7f
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/python -u
+
+
+import os, sys
+lib_path = os.path.abspath('../../')
+sys.path.append(lib_path)
+import process
+
+dirs = {}
+
+for f in os.listdir("."):
+       if os.path.isdir(f) == True:
+               data_set = []
+               for datafile in os.listdir("./"+str(f)):
+                       data_set.append(process.MaxNormalise(map(lambda e : [e[1], e[2]], process.GetData("./"+str(f)+"/"+str(datafile)))))
+
+               avg = process.Average(data_set)
+               dirs.update({f : avg})
+
+process.gnuplot("set title \"Vary Focus Voltage\"")
+process.gnuplot("set xlabel \"DAC (counts)\"")
+process.gnuplot("set ylabel \"Normalised S(E)\"")
+
+for p in dirs.items():
+       if (len(p[1]) > 0):
+               process.gnuplot.replot(process.Gnuplot.Data(p[1], title=str(p[0])+"", with_="lp"))
+
+sys.stdin.readline()

UCC git Repository :: git.ucc.asn.au