Closedown

This commit is contained in:
gac-x11ma
2018-08-30 16:39:11 +02:00
parent 5685a8d60a
commit 9bb86b75d3
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
file_prefix = time.strftime("%Y%m%d")
# CHANGE THE PATH IN THE OTH
input_path = "/sls/X11MA/data/X11MA/Desktop/e17174/Sample01_Au_ref/"+file_prefix+"/"
input_path = "/sls/X11MA/data/e17174/Data1/Aug_2018/Sample01_Au_ref/"+file_prefix+"/"
output_path = input_path
+3 -4
View File
@@ -60,21 +60,20 @@ def wait_channel(name, value, timeout =None, type='s'):
cawait(name, value, timeout = timeout, type=type)
print "Done"
def convert_file(input_file_name, output_file_name, field = 0, pol = 0, keithley_3 = False):
def convert_file(input_file_name, output_file_name):
sep = "\t"
line_sep = "\r\n"
with open(input_file_name) as inp:
lines = inp.readlines()
with open(output_file_name, "wb") as out:
out.write("Energy" + sep + "rbkenergy" + sep + "Mag" + sep + "Pol" + sep + "Io" + sep + "CADC2" + sep + "Norm/CADC3" + line_sep)
out.write("Energy" + sep + "Io" + sep + "CADC2" + sep + "CADC3" + line_sep)
s = sep + " " #File format has a space before numeric values
for line in lines[1:]:
line = line.strip()
if line=="": break
try:
(Ecrbk,CADC1, CADC2, NORM, CADC3, CADC4, MCurr, cffrbk, ID1Erbk, ID2Erbk, vTime) = line.split(" ")
#out.write(Ecrbk + sep + Ecrbk + sep + str(field) + sep + str(pol) + sep + CADC1 + sep + CADC2 + sep + (CADC3 if keithley_3 else NORM) + line_sep)
out.write(Ecrbk + s + str(field) + s + str(pol) + s + CADC1 + s + CADC2 + s + (CADC3 if keithley_3 else NORM) + line_sep)
out.write(Ecrbk + s + CADC1 + s + CADC2 + s + CADC3 + line_sep)
except:
traceback.print_exc()