From 6e365aa2fe0c367406fc4e7c0299aa8dc98915e1 Mon Sep 17 00:00:00 2001 From: gac-x03da Date: Fri, 21 Sep 2018 16:18:39 +0200 Subject: [PATCH] Script execution --- script/users/X-Treme users/Mg_K_edge_XAS.py | 66 +++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 script/users/X-Treme users/Mg_K_edge_XAS.py diff --git a/script/users/X-Treme users/Mg_K_edge_XAS.py b/script/users/X-Treme users/Mg_K_edge_XAS.py new file mode 100644 index 00000000..909cd375 --- /dev/null +++ b/script/users/X-Treme users/Mg_K_edge_XAS.py @@ -0,0 +1,66 @@ +""" +Estart = 1290.0 +Estop = 1340.0 +OTFtime = 10.0 +""" + +Estart = 1290.0 +Estop = 1340.0 +OTFtime = 10.0 + +Eph.write(Estart) + +while True: + erbk = round(MonoEnergy.read(),1) + if abs(erbk - Estart) < 0.3: + break + time.sleep(0.5) + +time.sleep(3.0) +print "done setting energy." + + +################## THIS IS TO OPEN THE VALVES +if caget('X03DA-OP-VG7:OPEN') == 'Not_Open': + caput('X03DA-OP-VG7:WT_SET',0) #open ES vacuum valve + time.sleep(0.2) + caput('X03DA-OP-VG7:WT_SET',1) #open ES vacuum valve + +caput('X03DA-OP-ST1:WT_SET_CLOSE',0) # +caput('X03DA-OP-ST1:WT_SET_OPEN',1) # open ES Shutter + +print "check that shutter is open..." +while True: + if caget('X03DA-OP-ST1:OPEN') == 'Open': + break + time.sleep(0.5) + +print "OK." + +time.sleep(3.0) +############################################# + +caput('X03DA-OTF:E1', Estart) +caput('X03DA-OTF:E2', Estop) +caput('X03DA-OTF:TIME',OTFtime) +print "launch OTF scan." + +caput('X03DA-OTF:RUN','START') +while True: + ret=caget('X03DA-OTF:RUN') + if ret == 'STOP': + break +fname = caget('X03DA-OTF:MSG') + +print "saved data to: ",fname +time.sleep(1.0) + + +################### THIS IS TO CLOSE THE VALVES +caput('X03DA-OP-ST1:WT_SET_CLOSE',1) # close ES Shutter + +if caget('X03DA-OP-VG7:OPEN') == 'Open': + caput('X03DA-OP-VG7:WT_SET',0) #close ES vacuum valve + time.sleep(0.2) + caput('X03DA-OP-VG7:WT_SET',1) #close ES vacuum valve +############################################