ARGH
[matches/honours.git] / research / TCS / plot.py~
1 #!/usr/bin/python
2
3 import sys
4 import os
5
6
7 if __name__ == "__main__":
8
9         f = open(sys.argv[1], "r")
10         s = f.readline().strip("#\r\n \t").split(" ")
11         while (len(s) < 6 or s[1] != "Scale"):
12                 s = f.readline().strip("#\r\n \t").split(" ")
13                 print str(s)
14         s = float(s[3]) * float(s[5])
15         f.close()
16
17         
18         plotfile = open(".plot.py.tmp", "w")
19
20         plotfile.write("set title \"" + str(sys.argv[1]) + "\"\n")
21         plotfile.write("set xlabel \"U (Volts)\"\n")
22         plotfile.write("set ylabel \"I (uA)\"\n")
23         plotfile.write("plot \""+str(sys.argv[1])+"\" u ($2 * 16.8 / 4000):(($3 / 0.170) * 268 * 1e6 * "+str(s)+") w lp t \""+str(sys.argv[1])+"\"\n")
24
25         plotfile.close()
26
27         result = os.system("gnuplot --persist .plot.py.tmp")
28
29         os.remove(".plot.py.tmp")       
30         sys.exit(result)

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