6 if os.path.exists("tmp\\r-d.dat"):
\r
7 os.remove("tmp\\r-d.dat")
\r
8 if os.path.exists("tmp\\s-d.dat"):
\r
9 os.remove("tmp\\s-d.dat")
\r
11 os.system("dataX.exe reference.dat - dark.dat >> tmp\\r-d.dat")
\r
12 os.system("dataX.exe glass.dat - dark.dat >> tmp\\s-d.dat")
\r
13 os.system("dataX.exe tmp\\s-d.dat / tmp\\r-d.dat >> processed\\glass_transmission.dat")
\r
14 os.remove("tmp\\s-d.dat")
\r
15 os.system("dataX.exe glass2.dat - dark.dat >> tmp\\s-d.dat")
\r
16 os.system("dataX.exe tmp\\s-d.dat / tmp\\r-d.dat >> processed\\glass2_transmission.dat")
\r
18 dataFiles = os.listdir()
\r
19 for dataFile in dataFiles:
\r
20 if re.match(".*\.dat", dataFile) != None and re.match("reference.*\.dat", dataFile) == None and re.match("dark.*\.dat", dataFile) == None and re.match("glass.*\.dat", dataFile) == None:
\r
21 os.remove("tmp\\s-d.dat")
\r
22 sys.stdout.write("Processing file \""+dataFile+"\"... ");
\r
23 nameWithoutExtension = re.split("\.dat", dataFile)[0]
\r
24 # sys.stdout.write(" (Name is \""+nameWithoutExtension+"\")... ")
\r
25 os.system("dataX.exe " + dataFile + " - dark.dat >> tmp\\s-d.dat")
\r
26 os.system("dataX.exe tmp\\s-d.dat / tmp\\r-d.dat >> processed\\"+nameWithoutExtension+"_(on_glass).dat")
\r
27 os.system("dataX.exe processed\\"+nameWithoutExtension+"_(on_glass).dat / processed\\glass_transmission.dat >> processed\\"+nameWithoutExtension+"_transmission.dat")
\r
28 sys.stdout.write("Done!\n")
\r