Skip to content
Snippets Groups Projects
Commit e46eb588 authored by hao.zheng's avatar hao.zheng
Browse files

Ocutpole changes

parent f99ca166
Branches Shutdown_dev
No related tags found
No related merge requests found
......@@ -569,7 +569,7 @@ class ScanRecord:
self.before_scan_set(**kwargs)
self.after_scan_set(**kwargs)
time.sleep(1)
time.sleep(.1)
def reset_all(self):
"""
......@@ -952,8 +952,8 @@ class ScanRecord:
returns limits_ok (True / False)
"""
scan_pv = self.ioc+"scan"+str(scan_dim)
caput(scan_pv+'.CMND',1)
time.sleep(.5)
caput(scan_pv+'.CMND',1,wait=True)
#time.sleep(.5) -JM added wait=True instead
SMSG = caget(scan_pv+'.SMSG',as_string=True)
if verbose:
print(SMSG)
......@@ -1047,10 +1047,10 @@ class ScanRecord:
##############################################################################################################
############################# progress, go and abort ##############################
##############################################################################################################
def progress(self,scan_dim,verbose=True):
def progress(self,scan_dim,verbose=True,wait_time=30):
"""
Checks if a scan is in progress, and sleeps until it is done
wait_time is the time in seconds between checks
pv now includes the full 29idARPES:
Previously: Scan_Progress
"""
......@@ -1059,7 +1059,7 @@ class ScanRecord:
while (check!=0):
if verbose:
print(pv+" in progress - please wait...")
time.sleep(30)
time.sleep(wait_time)
check=caget(pv+".FAZE")
def abort(self):
......
......@@ -5,7 +5,7 @@ import iexcode.instruments.cfg as iex
branch_GVs={
'c':('10'),
'd':('14'),
'e':('18'),
'e':('18','19'),
}
def branch_valve_close(branch=None):
......@@ -13,17 +13,21 @@ def branch_valve_close(branch=None):
closes the endstation valve for the current branch or specified branch
"""
if branch == None:
GV = branch_GVs[iex.BL.branch]
else:
GV = branch_GVs[branch]
valve_close(GV, verbose=True)
branch = [iex.BL.branch]
GVs = branch_GVs[branch]
for GV in GVs:
valve_close(GV, verbose=True)
def branch_valve_open():
"""
closes the endstation valve for the current branch
"""
GV = branch_GVs[iex.BL.branch]
valve_open(GV, verbose=True)
if branch == None:
branch = [iex.BL.branch]
GVs = branch_GVs[branch]
for GV in GVs:
valve_open(GV, verbose=True)
#####################################################
def valve_close(GV, verbose=True):
......@@ -83,4 +87,4 @@ def valve_status(GV,verbose=True):
else:
status = 'error'
return status
\ No newline at end of file
return status
......@@ -749,7 +749,7 @@ def scanXMCDpulse(field_start,field_stop, field_step,**kwargs):
execute: True/False to start the scan => True (default)
"""
kwargs.setdefault('scan_dim',1)
kwargs.setdefault('cts',0.1)
kwargs.setdefault('cts',1)
kwargs.setdefault('execute',True)
det_dit_True = xmcd_detectors()
......@@ -807,9 +807,11 @@ def Octupole_safe_state(**kwargs):
**kwargs
shutter_close = True; closes the D-shutter
valve_close = True; closes the D-valve
field = True; sets the magnetic field to 0
"""
kwargs.setdefault("shutter_close",True)
kwargs.setdefault("valve_close",True)
kwargs.setdefault("magnet",True)
if kwargs['shutter_close']:
branch_shutter_close(branch='d')
......@@ -818,5 +820,7 @@ def Octupole_safe_state(**kwargs):
branch_valve_close(branch='d')
branch_valve_close(branch='e')
if kwargs['magnet']:
field(V)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment