Thesis - final copy
[matches/honours.git] / thesis / figures / tcs / plots / process.py~
index 2512233..ac673dc 100755 (executable)
@@ -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()
 

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