This commit is contained in:
+30
-10
@@ -147,6 +147,15 @@ def is_id_error():
|
||||
def check_id_error():
|
||||
if is_id_error():
|
||||
raise Exception ("ID error: check ID status")
|
||||
|
||||
def gude1(pwr):
|
||||
caput("PEEM-GUDE:CH1SET",pwr)
|
||||
def gude2(pwr):
|
||||
caput("PEEM-GUDE:CH2SET",pwr)
|
||||
def gude3(pwr):
|
||||
caput("PEEM-GUDE:CH3SET",pwr)
|
||||
def gude4(pwr):
|
||||
caput("PEEM-GUDE:CH4SET",pwr)
|
||||
|
||||
###################################################################################################
|
||||
#Default scan callbacks
|
||||
@@ -468,13 +477,13 @@ def assert_beamline_ok():
|
||||
checkbeamline=0
|
||||
message=[ "PLC error","Encoder error", "Feedforward error","Operator control", "Moving timeout", "Interlock"]
|
||||
ID = get_setting("ID")
|
||||
if ID == "PGM_ID1":
|
||||
if ID in ("PGM_ID1", "ID1"):
|
||||
id1_status=get_id_status(1)
|
||||
id2_status=0
|
||||
elif ID == "PGM_ID2":
|
||||
elif ID in ("PGM_ID2", "ID2"):
|
||||
id1_status=0
|
||||
id2_status=get_id_status(2)
|
||||
if ID == "PGM_ID1_ID2":
|
||||
else: # if ID in ("PGM_ID1_ID2", "ID1_ID2") :
|
||||
id1_status=get_id_status(1)
|
||||
id2_status=get_id_status(2)
|
||||
if id1_status >= 1:
|
||||
@@ -759,12 +768,15 @@ def apply_beamline_setup(id,en=None,pol1=None,alp1=None,har1=None,off1=None,pol2
|
||||
# Monochromator part
|
||||
if grat is not None:
|
||||
if grat=='G1_300':
|
||||
print "Grat G1"
|
||||
Grating.write("0")
|
||||
Grating_ch.write("0")
|
||||
elif grat=='G2_1200':
|
||||
print "Grat G2"
|
||||
Grating.write("1")
|
||||
Grating_ch.write("1")
|
||||
elif grat =='G3_600':
|
||||
print "Grat G3"
|
||||
Grating.write("2")
|
||||
Grating_ch.write("2")
|
||||
if order is not None:
|
||||
@@ -840,9 +852,6 @@ def peem_optics_default_15kV():
|
||||
start_voltage.write(0)
|
||||
# fov.write(100)
|
||||
microscope.send_receive("sep 100um")
|
||||
microscope.send_receive("mmp 7 -9044.7", 60000)
|
||||
microscope.send_receive("mmp 2 -5998.6", 60000)
|
||||
microscope.send_receive("mmp 1 0.0", 60000)
|
||||
|
||||
def peem_optics_default_10kV():
|
||||
objective.write(1220)
|
||||
@@ -852,9 +861,6 @@ def peem_optics_default_10kV():
|
||||
obj_align_y.write(0)
|
||||
start_voltage.write(0)
|
||||
microscope.send_receive("sep 100um")
|
||||
microscope.send_receive("mmp 7 -9044.7", 60000)
|
||||
microscope.send_receive("mmp 2 -5998.6", 60000)
|
||||
microscope.send_receive("mmp 1 0.0", 60000)
|
||||
|
||||
|
||||
|
||||
@@ -878,7 +884,11 @@ def neutralize_position(retries = 3):
|
||||
log("neutralize_position error - retrying: " + sys.exc_info()[1])
|
||||
time.sleep(1)
|
||||
microscope.home_tilt('H')
|
||||
microscope.home_tilt('V')
|
||||
microscope.home_tilt('V')
|
||||
microscope.send_receive("mmp 7 -9044.7", 60000)
|
||||
microscope.send_receive("mmp 2 -5998.6", 60000)
|
||||
microscope.send_receive("mmp 1 0.0", 60000)
|
||||
close_vg10()
|
||||
###################################################################################################
|
||||
#Maths
|
||||
###################################################################################################
|
||||
@@ -983,3 +993,13 @@ def auto_intensity(roi=None, exposure=None):
|
||||
return scan_intensity(roi)
|
||||
finally:
|
||||
restore_eiger()
|
||||
|
||||
###################################################################################################
|
||||
# System utilities
|
||||
###################################################################################################
|
||||
|
||||
def memory():
|
||||
import java.lang.Runtime as Runtime
|
||||
r=Runtime.getRuntime()
|
||||
print "Used: ", r.totalMemory()
|
||||
print "Max : ", r.maxMemory()
|
||||
Reference in New Issue
Block a user