data.append(map(lambda e : float(e), line.split("\t")))
return data
+def DoNothing(data):
+ return data
+
+def GetDataSets(directory=".", function=DoNothing):
+ dirs = {}
+ for f in os.listdir(directory):
+ if os.path.isdir(directory+"/"+str(f)) == True:
+ data_set = []
+ for datafile in os.listdir(directory+"/"+str(f)):
+ if datafile.split(".")[1] == "dat":
+ data_set.append(function(map(lambda e : [e[1], e[2]], GetData("./"+str(f)+"/"+str(datafile)))))
+
+ avg = Average(data_set)
+ dirs.update({f : avg})
+ return dirs
+
+
+
def Derivative(data, a=0, b=1):
result = []
n = 0
#gnuplot("set term postscript colour")
#gnuplot("set output \"test.eps\"")
for i in range(1, len(sys.argv)):
- tcs.append(MaxNormalise(map(lambda e : [e[1], e[2]], GetData(sys.argv[i]))))
+ tcs.append(Derivative(map(lambda e : [e[1], e[2]], GetData(sys.argv[i]))))
#tcs.append(GetTCS(GetData(sys.argv[i])))
if (len(tcs[i-1]) > 0):
gnuplot.replot(Gnuplot.Data(tcs[i-1], title=sys.argv[i], with_="lp"))
avg = Average(tcs)
- gnuplot.replot(Gnuplot.Data(avg, title="Average", with_="l lw 2"))
+ #gnuplot.replot(Gnuplot.Data(avg, title="Average", with_="l lw 2"))
sys.stdout.write("Save averaged data as (blank for no save): ")
filename = sys.stdin.readline().strip(" \r\n\t")