Script execution

This commit is contained in:
gac-x03da
2019-03-04 23:30:40 +01:00
parent e756b210b1
commit 4d727184ff

View File

@@ -0,0 +1,70 @@
"""
Estart = 1290.0
Estop = 1340.0
OTFtime = 10.0
"""
# grating has to be grating 2
# Exit slit 100.0
Estart = 1065.0
Estop = 1095.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
############################################