Closedown

This commit is contained in:
X11MA
2017-05-26 10:32:11 +02:00
parent 59e2e366db
commit c8db386b16
4 changed files with 317 additions and 64 deletions

View File

@@ -51,7 +51,7 @@ PLOT_TYPE = 1
print "\nStarting energy scan - Parameters: ",
print Element,E1,E2,TIME,DELAY,OFFSET1,OFFSET2,RUNTYPE#,ALPHA1,ALPHA2
caput(OTF_ESET, E1)
###############################################################################
# Plotting
@@ -74,24 +74,24 @@ def _startPlot(type):
TEY = []
dE1 = 0.0
dE2 = 0.0
t_start = time.clock()
t_end = time.clock() + TIME*60.0
t_start = time.time()
t_end = time.time() + TIME*60.0
while running:
try:
if otf_start.read() == 0:
#if (otf_start.read() == 0 or time.time() > t_end):
break
e = energy.read()
if OTF_override == 1:
cur_en = E1+(E2-E1)*(time.clock()-t_start)/(TIME*60)
if (time.time() <= t_end and OTF_override == 1):
cur_en = E1+(E2-E1)*(time.time()-t_start)/(TIME*60)
#caput ("X11MA-PHS:E_SP",cur_en)
cur_en1 = cur_en - dE1
cur_en2 = cur_en - dE2
caput ("X11MA-ID1:ENERGY",e)
caput ("X11MA-ID2:ENERGY",e)
caput ("X11MA-ID1:ENERGY",e-0.1)
caput ("X11MA-ID2:ENERGY",e-0.1)
time.sleep(0.0001)
#while abs (e - cur_en) < 0.01:
# pass
# pass
#time.sleep(0.0001)'''
ID1 = ID1_En.read()
ID2 = ID2_En.read()
@@ -249,6 +249,7 @@ for scan_no in range(number_of_scans):
otf_start.write(0)
finally:
stopPlot()
caput(OTF_ESET, E1+5.0)
T_end = Temp.getValue()
time.sleep(5.0)
#TODO: wait for file instead of sleep