Closedown
This commit is contained in:
@@ -49,7 +49,8 @@ ROUNDS = 1
|
||||
PLOT_TYPE = 1
|
||||
"""
|
||||
print "\nStarting energy scan - Parameters: ",
|
||||
print E1,E2,TIME,DELAY,OFFSET1,OFFSET2,RUNTYPE#,ALPHA1,ALPHA2
|
||||
print Element,E1,E2,TIME,DELAY,OFFSET1,OFFSET2,RUNTYPE#,ALPHA1,ALPHA2
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
@@ -80,11 +81,13 @@ def _startPlot(type):
|
||||
#sTEYout = []
|
||||
while running:
|
||||
try:
|
||||
if otf_start.read() == 0:
|
||||
#if (otf_start.read() == 0 or time.time() > t_end):
|
||||
# break
|
||||
cur_en = E1+(E2-E1)*(time.time()-t_start)/(TIME*60)
|
||||
caput ("X11MA-PHS:E_SP",cur_en)
|
||||
break
|
||||
e = energy.read()
|
||||
'''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
|
||||
#print cur_en
|
||||
@@ -94,7 +97,7 @@ def _startPlot(type):
|
||||
caput ("X11MA-ID2:ENERGY",cur_en2)
|
||||
#while abs (e - cur_en) < 0.01:
|
||||
# pass
|
||||
#time.sleep(0.0001)
|
||||
#time.sleep(0.0001)'''
|
||||
ID1 = ID1_En.read()
|
||||
ID2 = ID2_En.read()
|
||||
#dE1 = ID1_En.read() - energy.read()
|
||||
@@ -103,7 +106,7 @@ def _startPlot(type):
|
||||
aK2=keithley_2a.read()
|
||||
aK3=keithley_3a.read()
|
||||
aTEYnorm=aK2/aK1
|
||||
TEY.append(line_sep)
|
||||
TEY.append(line_sep)
|
||||
TEY.append(e)
|
||||
TEY.append(ID1)
|
||||
TEY.append(ID2)
|
||||
@@ -111,7 +114,7 @@ def _startPlot(type):
|
||||
TEY.append(aK1)
|
||||
TEY.append(aK2)
|
||||
TEY.append(aK3)
|
||||
TEY.append(pol_str)
|
||||
TEY.append(pol_str)
|
||||
if (abs(e-cur)) > 0.1:
|
||||
v = abs((keithley_2a.read() / ((keithley_1a if (type==1) else keithley_3a).read() )))
|
||||
s.appendData(e,v)
|
||||
@@ -123,7 +126,7 @@ def _startPlot(type):
|
||||
output_file_TEY = output_path+"TEY_"+file_prefix+"_" + suffix + ".dat"
|
||||
TEYout = open(output_file_TEY, "a+")
|
||||
sTEY = sep.join(str(x) for x in TEY) #+ line_sep # MCP1.write("%s" + sep % i)
|
||||
sTEYout = "rbkenergy" + sep + "ID1_en" + sep + "ID2_en" + sep + "TEY_norm" + sep + "Keithley1" + sep + "Keithley2" + sep + "Keithley3"+ sep + "Polarisation"
|
||||
sTEYout = sep + "rbkenergy" + sep + "ID1_en" + sep + "ID2_en" + sep + "TEY_norm" + sep + "Keithley1" + sep + "Keithley2" + sep + "Keithley3"+ sep + "Polarisation"
|
||||
sTEYout = sTEYout + line_sep + sTEY
|
||||
TEYout.write(sTEYout)
|
||||
TEYout.close()
|
||||
@@ -266,6 +269,15 @@ for scan_no in range(number_of_scans):
|
||||
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)
|
||||
|
||||
'''output_file_Log = output_path+"Log_"+file_prefix+".dat"
|
||||
Logout = open(output_file_Log, "a+")
|
||||
#sLog = sep.join(str(x) for x in Log)
|
||||
sLogout = sep + "Scan_number" + sep + file_prefix + "_" + suffix + sep + "ID1_en" + sep + "ID2_en" + sep + "TEY_norm" + sep + "Keithley1" + sep + "Keithley2" + sep + "Keithley3"+ sep + "Polarisation"
|
||||
sTEYout = sTEYout + line_sep + sTEY
|
||||
TEYout.write(sTEYout)
|
||||
TEYout.close()
|
||||
print "Log file updated"'''
|
||||
|
||||
if RUNTYPE in ["+/-", "LH/LV"]:
|
||||
if polswitch == 1:
|
||||
switchpol(2, RUNTYPE) # tune ID2 --> polarization: C- or LV
|
||||
|
||||
Reference in New Issue
Block a user