X-Git-Url: https://git.ucc.asn.au/?p=matches%2Fhonours.git;a=blobdiff_plain;f=thesis%2Ffigures%2Ftcs%2Fplots%2Fprocess.py~;fp=thesis%2Ffigures%2Ftcs%2Fplots%2Fprocess.py~;h=ac673dccf4193ba7fbbba5889f677372e5035ec7;hp=251223392c461f581245a6765d5b8bd2f9cf0c45;hb=d64ad3f0b622195e307ae648d2c7dede88566fa5;hpb=ddcdd43bf4077f35beefc59eb8568e13b6c5b3cd diff --git a/thesis/figures/tcs/plots/process.py~ b/thesis/figures/tcs/plots/process.py~ index 25122339..ac673dcc 100755 --- a/thesis/figures/tcs/plots/process.py~ +++ b/thesis/figures/tcs/plots/process.py~ @@ -105,6 +105,7 @@ def GetDataSets(directory="."): def Derivative(data, a=1, b=2, sigma=None,step=1): + #print "Derivative called" result = [[]] n = 0 dI = [0,0] @@ -270,22 +271,22 @@ def ShowTCS(filename, raw=True,calibrate=True, normalise=False, show_error=False 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) @@ -294,7 +295,9 @@ def ShowTCS(filename, raw=True,calibrate=True, normalise=False, show_error=False 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) @@ -360,10 +363,10 @@ def ShowData(filename,calibrate=True, normalise=False, show_error=False, plot=gn 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") @@ -373,8 +376,8 @@ def ShowData(filename,calibrate=True, normalise=False, show_error=False, plot=gn 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) @@ -543,7 +546,7 @@ def main(): i = 1 plotFunc = ShowTCS - normalise = False + normalise = True title = "" master_title = "" smooth=0 @@ -607,7 +610,7 @@ def main(): 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()