def Derivative(data, a=1, b=2, sigma=None,step=1):
+ #print "Derivative called"
result = [[]]
n = 0
dI = [0,0]
if calibrate:
data = CalibrateData(data)
- units = ["V", "uA / V"]
+ units = ["Volts", "uA / V"]
else:
units = ["DAC counts", "ADC counts / DAC counts"]
if not normalise:
- gnuplot("set ylabel \"dI(E)/dE ("+str(units[1])+")\"")
+ gnuplot("set ylabel \"S(U) ("+str(units[1])+")\"")
else:
data = MaxNormalise(data)
- gnuplot("set ylabel \"dI(E)/dE (normalised)\"")
+ gnuplot("set ylabel \"S(U) (arb. units)\"")
if (output != None and type(output) == type("")):
gnuplot("set term png size 640,480")
gnuplot("set output \""+str(output)+"\"")
if master_title == "":
- master_title = "Total Current Spectrum S(E)"
+ master_title = "Total Current Spectrum S(U)"
if type(filename) == type("") and plot == gnuplot.plot:
if filename != "tcs data":
p = ReadParameters(filename)
gnuplot("set title \""+str(master_title)+"\"")
gnuplot("set xlabel \"U ("+str(units[0])+")\"")
-
+ gnuplot("set xrange [0:16]")
+ gnuplot("set mxtics 10")
+ gnuplot("set mytics 10")
if raw:
d = Derivative(data, 1, 2, step=step)
units = ["DAC counts", "ADC counts"]
if not normalise:
- gnuplot("set ylabel \"I(E) ("+str(units[1])+")\"")
+ gnuplot("set ylabel \"I(U) ("+str(units[1])+")\"")
else:
data = MaxNormalise(data)
- gnuplot("set ylabel \"I(E) (normalised)\"")
+ gnuplot("set ylabel \"I(U) (arb. units)\"")
if (output != None and type(output) == type("")):
gnuplot("set term png size 640,480")
gnuplot("set xlabel \"U ("+str(units[0])+")\"")
- ymax = 0.005 + 1.2 * max(d, key=lambda e : e[2])[2]
- ymin = -0.005 + 1.2 * min(d, key=lambda e : e[2])[2]
+ ymax = 0.005 + 1.2 * max(data, key=lambda e : e[2])[2]
+ ymin = -0.005 + 1.2 * min(data, key=lambda e : e[2])[2]
gnuplot("set yrange ["+str(ymin)+":"+str(ymax)+"]")
#d = Derivative(data, 1, 2, step=step)
i = 1
plotFunc = ShowTCS
- normalise = False
+ normalise = True
title = ""
master_title = ""
smooth=0
print "Done. Press enter to exit, or type name of file to save as."
out = sys.stdin.readline().strip("\t\r\n #")
if out != "":
- gnuplot("set term postscript colour")
+ gnuplot("set term postscript colour enhanced \"Arial Bold,18\"")
gnuplot("set output \""+out+"\"")
gnuplot.replot()