Closedown

This commit is contained in:
gac-x11ma
2018-08-30 16:09:12 +02:00
parent f2cffd3a5f
commit 0e163213d8
2 changed files with 4 additions and 39 deletions

View File

@@ -1,6 +1,3 @@
#print "Running Energy scan script with arguments: E1=", sys.argv[0], " E2= ", sys.argv[1], " Time= ", sys.argv[2], " Delay= ", sys.argv[3]
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+"/"
@@ -12,10 +9,7 @@ E1 = sys.argv[0]
E2 = sys.argv[1]
TIME = sys.argv[2]
DELAY = sys.argv[3]
#E1 = 801
#E2 = 810
#TIME = 1
#DELAY = 0
number_of_scans = 1
ID1=0
ID2=1
@@ -49,9 +43,6 @@ def _startPlot(type):
s = p.getSeries(0)
cur = 0
time.sleep(3.0)
TEY = []
dE1 = 0.0
dE2 = 0.0
t_start = time.time()
t_end = time.time() + TIME*60.0
while running:
@@ -61,30 +52,6 @@ def _startPlot(type):
break
e = energy.read()
#time.sleep(0.0001)
ID1 = ID1_En.read()
ID2 = ID2_En.read()
#dE1 = ID1_En.read() - energy.read()
#dE2 = ID2_En.read() - energy.read()
aK1=keithley_1a.read()
aK2=keithley_2a.read()
aK3=keithley_3a.read()
aK1raw=Keithley_1_raw.read()
aK2raw=Keithley_2_raw.read()
aK3raw=Keithley_3_raw.read()
aTEYnorm=aK2/aK1
TEY.append(line_sep)
TEY.append(e)
TEY.append(ID1)
TEY.append(ID2)
TEY.append(aTEYnorm)
TEY.append(aK1)
TEY.append(aK2)
TEY.append(aK3)
TEY.append(pol_str)
TEY.append(aK1raw)
TEY.append(aK2raw)
TEY.append(aK3raw)
if (abs(e-cur)) > 0.1:
v = abs((keithley_2a.read() / ((keithley_1a if (type==1) else keithley_3a).read() )))
s.appendData(e,v)
@@ -131,7 +98,6 @@ mag_str = None
pol_str = None
polswitch = 1
#fid = get_next_fid(input_path, "o" + file_prefix)
fid = get_next_fid(input_path, "o" + file_prefix)
@@ -223,12 +189,11 @@ for scan_no in range(number_of_scans):
caput(OTF_ESET, E1)
T_end = Temp.getValue()
time.sleep(5.0)
#TODO: wait for file instead of sleep
#Convert file
output_file = output_path + "os" + file_prefix + "_" + suffix + ".dat"
print("Converting data file: " + output_file);
convert_file(input_file, output_file, mag_str, pol_str)
convert_file(input_file, output_file, mag_str, pol_str, True)
plot_file(output_file, file_prefix+"_" + suffix) #"Scan " + str(scan_no+1))
print "Finished scan " + str(scan_no+1) + " out of " + str(number_of_scans)