git.ucc.asn.au
/
matches
/
honours.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Parallel Programming - Tidied things up
[matches/honours.git]
/
research
/
TCS
/
2012-09-07
/
deflection
/
analysis.py
diff --git
a/research/TCS/2012-09-07/deflection/analysis.py
b/research/TCS/2012-09-07/deflection/analysis.py
index
67101c7
..
41f2daf
100755
(executable)
--- a/
research/TCS/2012-09-07/deflection/analysis.py
+++ b/
research/TCS/2012-09-07/deflection/analysis.py
@@
-6,23
+6,22
@@
lib_path = os.path.abspath('../../')
sys.path.append(lib_path)
import process
sys.path.append(lib_path)
import process
-dirs =
{}
+dirs =
process.GetDataSets(".")
-for f in os.listdir("."):
- if os.path.isdir(f) == True:
- data_set = []
- for datafile in os.listdir("./"+str(f)):
- data_set.append(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 Deflection Voltage\"")
+#process.gnuplot("set xlabel \"DAC (counts)\"")
+#process.gnuplot("set ylabel \"Normalised S(E)\"")
+#process.gnuplot("set key outside right")
-process.gnuplot("set title \"Vary Deflection Voltage\"")
-process.gnuplot("set xlabel \"DAC (counts)\"")
-process.gnuplot("set ylabel \"Normalised S(E)\"")
-
-for p in dirs.items():
+max_curve = []
+for p in sorted(dirs.items(), key = lambda e : float(e[0].split("=")[1])):
if (len(p[1]) > 0):
if (len(p[1]) > 0):
- process.gnuplot.replot(process.Gnuplot.Data(p[1], title=str(p[0])+"", with_="lp"))
+ maxval = max(p[1], key = lambda e : e[1])
+ max_curve.append([float(p[0].split("=")[1]), maxval[1], maxval[0]])
+# process.gnuplot.replot(process.Gnuplot.Data(p[1], title=str(p[0])+"", with_="lp"))
+
+process.gnuplot.replot(process.Gnuplot.Data(max_curve, with_="lp", using="1:2", title="Max"))
+process.gnuplot.replot(process.Gnuplot.Data(max_curve, with_="lp", using="1:3", title="Max position"))
sys.stdin.readline()
sys.stdin.readline()
UCC
git Repository :: git.ucc.asn.au