diff --git a/build/lib/iexcode/instruments/ARPES.py b/build/lib/iexcode/instruments/ARPES.py index ca7dc1133fc173608eae53d0f2e686be47b5f83e..ee2f19b73d12398352c4c57be6870ad38d2faa29 100644 --- a/build/lib/iexcode/instruments/ARPES.py +++ b/build/lib/iexcode/instruments/ARPES.py @@ -93,7 +93,7 @@ def ARPES_init(*userName,**kwargs): #resetting everything if kwargs['reset']: - ARPES_reset(**kwargs) + ARPES_reset() #enable cameras _enable_endstation_cameras() diff --git a/build/lib/iexcode/instruments/Motors.py b/build/lib/iexcode/instruments/Motors.py index 35d863936b25b8853221d24a6bd91ff098a4f37c..8193e565b2015f9db2e95c29e43ee069a109f8cb 100644 --- a/build/lib/iexcode/instruments/Motors.py +++ b/build/lib/iexcode/instruments/Motors.py @@ -171,7 +171,7 @@ class Motors: if motor_pvs: rbv_pv,val_pv,sgm_pv,pv = motor_pvs else:#here - print_warning_message('motor = "'+str(name)+'" is not defined for '+iex.BL.endstation) + print_warning_message('motor = "'+str(name)+'" is not defined for '+iex.BL.endstation_name) return if kwargs['relative']: @@ -258,172 +258,172 @@ class Motors: ### x ### def mvx(val,**kwargs): """ moves x motor in the endstation""" - iex.BL.Motors.move('x',val,**kwargs) + iex.BL.motors.move('x',val,**kwargs) def dmvx(delta): """ relative x motor in the endstation""" - iex.BL.Motors.move('x',delta,relative=True) + iex.BL.motors.move('x',delta,relative=True) def scanx(start,stop,step,**kwargs): """ scans the x motor in the endstation""" - iex.BL.Motors.scan("x",start,stop,step,**kwargs) + iex.BL.motors.scan("x",start,stop,step,**kwargs) def dscanx(start,stop,step): """relative scans of the x motor in the endstation """ - iex.BL.Motors.scan("x",start,stop,step,relative=True) + iex.BL.motors.scan("x",start,stop,step,relative=True) ### y ### def mvy(val,**kwargs): """ moves y motor in the endstation""" - iex.BL.Motors.move('y',val,**kwargs) + iex.BL.motors.move('y',val,**kwargs) def dmvy(delta): """ relative y motor in the endstation""" - iex.BL.Motors.move('y',delta,relative=True) + iex.BL.motors.move('y',delta,relative=True) def scany(start,stop,step,**kwargs): """ scans the y motor in the endstation""" - iex.BL.Motors.scan("y",start,stop,step,**kwargs) + iex.BL.motors.scan("y",start,stop,step,**kwargs) def dscany(start,stop,step): """relative scans of the y motor in the endstation """ - iex.BL.Motors.scan("y",start,stop,step,relative=True) + iex.BL.motors.scan("y",start,stop,step,relative=True) ### z ### def mvz(val,**kwargs): """ moves z motor in the endstation""" - iex.BL.Motors.move('z',val,**kwargs) + iex.BL.motors.move('z',val,**kwargs) def dmvz(delta): """ relative z motor in the endstation""" - iex.BL.Motors.move('z',delta,relative=True) + iex.BL.motors.move('z',delta,relative=True) def scanz(start,stop,step,**kwargs): """ scans the z motor in the endstation""" - iex.BL.Motors.scan("z",start,stop,step,**kwargs) + iex.BL.motors.scan("z",start,stop,step,**kwargs) def dscanz(start,stop,step): """relative scans of the z motor in the endstation """ - iex.BL.Motors.scan("z",start,stop,step,relative=True) + iex.BL.motors.scan("z",start,stop,step,relative=True) ### kth ### def mvkth(val,**kwargs): """ moves kth motor in the endstation""" - iex.BL.Motors.move('kth',val,**kwargs) + iex.BL.motors.move('kth',val,**kwargs) def dmvkth(delta): """ relative kth motor in the endstation""" - iex.BL.Motors.move('kth',delta,relative=True) + iex.BL.motors.move('kth',delta,relative=True) def scankth(start,stop,step,**kwargs): """ scans the kth motor in the endstation""" - iex.BL.Motors.scan("kth",start,stop,step,**kwargs) + iex.BL.motors.scan("kth",start,stop,step,**kwargs) def dscankth(start,stop,step): """relative scans of the kth motor in the endstation """ - iex.BL.Motors.scan("kth",start,stop,step,relative=True) + iex.BL.motors.scan("kth",start,stop,step,relative=True) ### kphi ### def mvkphi(val,**kwargs): """ moves kphi motor in the endstation""" - iex.BL.Motors.move('kphi',val,**kwargs) + iex.BL.motors.move('kphi',val,**kwargs) def dmvkphi(val): """ relative kphi motor in the endstation""" - iex.BL.Motors.move('kphi',val,relative=True) + iex.BL.motors.move('kphi',val,relative=True) def scankphi(start,stop,step,**kwargs): """ scans the kphi motor in the endstation""" - iex.BL.Motors.scan("kphi",start,stop,step,**kwargs) + iex.BL.motors.scan("kphi",start,stop,step,**kwargs) def dscankphi(start,stop,step): """relative scans of the kphi motor in the endstation """ - iex.BL.Motors.scan("kphi",start,stop,step,relative=True) + iex.BL.motors.scan("kphi",start,stop,step,relative=True) ### kap ### def mvkap(val,**kwargs): """ moves kap motor in the endstation""" - iex.BL.Motors.move('kap',val,**kwargs) + iex.BL.motors.move('kap',val,**kwargs) def dmvkap(delta): """ relative kap motor in the endstation""" - iex.BL.Motors.move('kap',delta,relative=True) + iex.BL.motors.move('kap',delta,relative=True) def scankap(start,stop,step,**kwargs): """ scans the kap motor in the endstation""" - iex.BL.Motors.scan("kap",start,stop,step,**kwargs) + iex.BL.motors.scan("kap",start,stop,step,**kwargs) def dscankap(start,stop,step): """relative scans of the kap motor in the endstation """ - iex.BL.Motors.scan("kap",start,stop,step,relative=True) + iex.BL.motors.scan("kap",start,stop,step,relative=True) ### tth ### def mvtth(val,**kwargs): """ moves tth motor in the endstation""" - iex.BL.Motors.move('tth',val,**kwargs) + iex.BL.motors.move('tth',val,**kwargs) def dmvtth(delta): """ relative tth motor in the endstation""" - iex.BL.Motors.move('tth',delta,relative=True) + iex.BL.motors.move('tth',delta,relative=True) def scantth(start,stop,step,**kwargs): """ scans the tth motor in the endstation""" - iex.BL.Motors.scan("tth",start,stop,step,**kwargs) + iex.BL.motors.scan("tth",start,stop,step,**kwargs) def dscantth(start,stop,step): """relative scans of the tth motor in the endstation """ - iex.BL.Motors.scan("tth",start,stop,step,relative=True) + iex.BL.motors.scan("tth",start,stop,step,relative=True) ### th ### def mvth(val,**kwargs): """ moves th motor in the endstation""" - iex.BL.Motors.move('th',val,**kwargs) + iex.BL.motors.move('th',val,**kwargs) def dmvth(delta): """ relative th motor in the endstation""" - iex.BL.Motors.move('th',delta,relative=True) + iex.BL.motors.move('th',delta,relative=True) def scanth(start,stop,step,**kwargs): """ scans the th motor in the endstation""" - iex.BL.Motors.scan("th",start,stop,step,**kwargs) + iex.BL.motors.scan("th",start,stop,step,**kwargs) def dscanth(start,stop,step): """relative scans of the th motor in the endstation """ - iex.BL.Motors.scan("th",start,stop,step,relative=True) + iex.BL.motors.scan("th",start,stop,step,relative=True) ### chi ### def mvchi(val,**kwargs): """ moves chi motor in the endstation""" - iex.BL.Motors.move('chi',val,**kwargs) + iex.BL.motors.move('chi',val,**kwargs) def dmvchi(val): """ relative chi motor in the endstation""" - iex.BL.Motors.move('chi',val,relative=True) + iex.BL.motors.move('chi',val,relative=True) def scanchi(start,stop,step,**kwargs): """ scans the chi motor in the endstation""" - iex.BL.Motors.scan("chi",start,stop,step,**kwargs) + iex.BL.motors.scan("chi",start,stop,step,**kwargs) def dscanchi(start,stop,step): """relative scans of the chi motor in the endstation """ - iex.BL.Motors.scan("chi",start,stop,step,relative=True) + iex.BL.motors.scan("chi",start,stop,step,relative=True) ### phi ### def mvphi(val,**kwargs): """ moves phi motor in the endstation""" - iex.BL.Motors.move('phi',val,**kwargs) + iex.BL.motors.move('phi',val,**kwargs) def dmvphi(delta): """ relative phi motor in the endstation""" - iex.BL.Motors.move('phi',delta,relative=True) + iex.BL.motors.move('phi',delta,relative=True) def scanphi(start,stop,step,**kwargs): """ scans the phi motor in the endstation""" - iex.BL.Motors.scan("phi",start,stop,step,**kwargs) + iex.BL.motors.scan("phi",start,stop,step,**kwargs) def dscanphi(start,stop,step): """relative scans of the phi motor in the endstation """ - iex.BL.Motors.scan("phi",start,stop,step,relative=True) + iex.BL.motors.scan("phi",start,stop,step,relative=True) ######## mprint and mvsample ################### @@ -431,7 +431,7 @@ def mprint(): """ prints current position of the physical motors """ - iex.BL.Motors.mprint() + iex.BL.motors.mprint() def mvsample(position_list): """ @@ -440,4 +440,4 @@ def mvsample(position_list): Previously: sample """ - iex.BL.Motors.mvsample(position_list) \ No newline at end of file + iex.BL.motors.mvsample(position_list) \ No newline at end of file diff --git a/build/lib/iexcode/instruments/VLS_PGM.py b/build/lib/iexcode/instruments/VLS_PGM.py index 8446e1bf6909eb67b546b6b91387715c9fbd9479..6dffc780bd41acfaa9cdbec6db16157fa51082de 100644 --- a/build/lib/iexcode/instruments/VLS_PGM.py +++ b/build/lib/iexcode/instruments/VLS_PGM.py @@ -260,7 +260,7 @@ def mono_status_get(): grating_status = grt_P_status * grt_X_status return mirror_status*grating_status -def mono_grating_change(grating_name,verbose=True): +def mono_grating_set(grating_name,verbose=True): """ Translate between the different grating positions list grating_name: mono_grating_names() @@ -271,7 +271,7 @@ def mono_grating_change(grating_name,verbose=True): """ _mono_optic_change('grating',grating_name, verbose) -def mono_mirror_change(mirror_name,verbose=True): +def mono_mirror_set(mirror_name,verbose=True): """ Translate between the different mirror positions list mirror_name: mono_mirror_names() diff --git a/build/lib/iexcode/instruments/scalers.py b/build/lib/iexcode/instruments/scalers.py index c3cef3bf48a9f7ac23ac76f28811f5e2e99f4ab5..7face9f758783a4662da900be557b0cb3c6fafb0 100644 --- a/build/lib/iexcode/instruments/scalers.py +++ b/build/lib/iexcode/instruments/scalers.py @@ -30,6 +30,20 @@ def Kappa_scaler(time_seconds=0.1,verbose=True): if verbose: print("Integration time set to:", str(time_seconds)) + +def Octupole_scaler(time_seconds=0.1,verbose=True): + """ + Sets the integration time for the scalers in the Kappa chamber + and mpa filter num if mpa is running + """ + scaler_pv="29ideMZ0:scaler1.TP" + + caput(pv,time_seconds) + + if verbose: + print("Integration time set to:", str(time_seconds)) + + class Scaler: def __inti__(self, pv): """ diff --git a/build/lib/iexcode/instruments/scanRecord.py b/build/lib/iexcode/instruments/scanRecord.py index 11f724da53606fee474d5298cd044328b5ee0f91..4e553880611ef5f10d01abc5f804be3e04bb7001 100644 --- a/build/lib/iexcode/instruments/scanRecord.py +++ b/build/lib/iexcode/instruments/scanRecord.py @@ -629,7 +629,7 @@ class ScanRecord: pos_num=str(i) pos_pv=caget(scan_pv+".P"+pos_num+"PV") if pos_pv != '': - pos=PV(pos_pv) + pos=PV(pos_pv); time.sleep(0.1)#smallest sleep to allow for PV traffic if not pos.connected: print("Positioner "+pos_num+" has a BAD PV: "+pos.pvname+" not connected") pos_ok = False diff --git a/build/lib/iexcode/instruments/slits.py b/build/lib/iexcode/instruments/slits.py index 62a17c79a7aca89057cf6ef324ac287f6ecc4d69..f8a3b82764f3ac6fdf28c633e152a464fbde26a0 100644 --- a/build/lib/iexcode/instruments/slits.py +++ b/build/lib/iexcode/instruments/slits.py @@ -28,8 +28,13 @@ def _slits_dictionary(): def slit_name_list(): d=_slits_dictionary() - for key in d.keys(): - print(key) + message = "slit_list = " + for i, key in enumerate(d.keys()): + if i==0: + message += key + else: + message = message+", "+key + print(message) def _slits_wide_open_dictionary(): """ @@ -70,7 +75,7 @@ def slits_pvs(slit_name): size.append((size_val,size_rbv)) center.append((center_val,center_rbv)) else: - print_warning_message('slit_name = '+slit_name+' not a valid slit, choose:') + print_warning_message('slit_name = '+slit_name+' not a valid slit') slit_name_list() return size,center @@ -87,7 +92,7 @@ def slits_synch(slit_name): slit_pv = slit_HV+'sync.PROC' caput(slit_pv,1) else: - print_warning_message('slit_name = '+slit_name+' not a valid slit, choose:') + print_warning_message('slit_name = '+slit_name+' not a valid slit') slit_name_list() def slits_sync_all(): @@ -111,7 +116,7 @@ def slits_get_all(verbose=True): vals[slit_name+'_size'], vals[slit_name+'_center'] = slits_get(slit_name,verbose=verbose) -def slits_set(slit_name,size,center,verbose=True): +def slits_set(slit_name,size,center,verbose=True,wait=True): """ synchs the slit motors and the slit table and then sets the center and size @@ -131,12 +136,12 @@ def slits_set(slit_name,size,center,verbose=True): size_pvs,center_pvs = slits_pvs(slit_name) for i in range(0,len(size_pvs)): - size_val, size_rbv, = size_pvs[i] - center_val,center_rbv = center_pvs[i] + size_rbv, size_val, = size_pvs[i] + center_rbv,center_val = center_pvs[i] if center_rbv != None: - caput(center_val, center[i],timeout=180) + caput(center_val, center[i],wait=wait,timeout=180) if size_rbv != None: - caput(size_val, size[i],timeout=180) + caput(size_val, size[i],wait=wait,timeout=180) if verbose: slits_get(slit_name,verbose=True) @@ -158,8 +163,8 @@ def slits_get(slit_name,verbose=True): size_pvs,center_pvs = slits_pvs(slit_name) for i in range(0,len(size_pvs)): - size_val, size_rbv, = size_pvs[i] - center_val,center_rbv = center_pvs[i] + size_rbv, size_val, = size_pvs[i] + center_rbv,center_val = center_pvs[i] if center_rbv != None: center.append(caget(center_rbv)) else: @@ -173,7 +178,7 @@ def slits_get(slit_name,verbose=True): if len(d[slit_name])>1: print(slit_name + " = ("+str(round(size[0],3))+" x "+str(round(size[1],3))+") @ ("+str(round(center[0],3))+","+str(round(center[1],3))+")") else: - print(slit_name + " = ("+str(round(size[0],3))+") @ ("+str(center[0])+")") + print(slit_name + " = ("+str(round(size[0],3))+") @ ("+str(round(center[0],3))+")") return tuple(size),tuple(center) @@ -185,7 +190,7 @@ def slits_set_size(slit_name,size): size = V for slit3D """ size_current,center = slits_get(slit_name,verbose=False) - slits_set(size,center) + slits_set(slit_name, size=size,center=center) def slits_set_center(slit_name,center): """ @@ -195,7 +200,7 @@ def slits_set_center(slit_name,center): center = V for slit3D """ size,center_current = slits_get(slit_name,verbose=False) - slits_set(size,center) + slits_set(slit_name,size=size,center=center) def slits_scan_size(slit_name,direction,start,stop,step,**kwargs): """ @@ -207,12 +212,13 @@ def slits_scan_size(slit_name,direction,start,stop,step,**kwargs): kwargs.setdefault('center',slits_get(slit_name,verbose=False)[1]) kwargs.setdefault('execute',True) - slit_H,slit_V = _slits_dictionary()[slit_name] - + size,center = slits_pvs(slit_name) if direction == 'H': - (size_rbv,size_val),(center_rbv,center_val) = slits_pvs(slit_H) + size_rbv,size_val = size[0] + center_rbv,center_val = center[0] if direction == 'V': - (size_rbv,size_val),(center_rbv,center_val) = slits_pvs(slit_V) + size_rbv,size_val = size[1] + center_rbv,center_val = center[1] #set slit center slits_set_center(slit_name,kwargs['center']) @@ -233,12 +239,13 @@ def slits_scan_center(slit_name,direction,start,stop,step,**kwargs): kwargs.setdefault('size',slits_get(slit_name,verbose=False)[0]) kwargs.setdefault('execute',True) - slit_H,slit_V = _slits_dictionary()[slit_name] - + size,center = slits_pvs(slit_name) if direction == 'H': - (size_rbv,size_val),(center_rbv,center_val) = slits_pvs(slit_H) + size_rbv,size_val = size[0] + center_rbv,center_val = center[0] if direction == 'V': - (size_rbv,size_val),(center_rbv,center_val) = slits_pvs(slit_V) + size_rbv,size_val = size[1] + center_rbv,center_val = center[1] #set slit center slits_set_size(slit_name,kwargs['size']) @@ -260,7 +267,9 @@ def slit1A_scribe_marks(): """ main_shutter_close() for m in range(9,13): - caput('29idb:m'+str(m)+'.DVAL',0) + caput('29idb:m'+str(m)+'.DVAL',0,wait=True) + + print('At slit1A scribe marks') def slit1A_set(H_size,V_size,verbose=True,**kwargs): """ diff --git a/iexcode/instruments/ARPES.py b/iexcode/instruments/ARPES.py index ca7dc1133fc173608eae53d0f2e686be47b5f83e..ee2f19b73d12398352c4c57be6870ad38d2faa29 100644 --- a/iexcode/instruments/ARPES.py +++ b/iexcode/instruments/ARPES.py @@ -93,7 +93,7 @@ def ARPES_init(*userName,**kwargs): #resetting everything if kwargs['reset']: - ARPES_reset(**kwargs) + ARPES_reset() #enable cameras _enable_endstation_cameras() diff --git a/iexcode/instruments/Motors.py b/iexcode/instruments/Motors.py index 35d863936b25b8853221d24a6bd91ff098a4f37c..8193e565b2015f9db2e95c29e43ee069a109f8cb 100644 --- a/iexcode/instruments/Motors.py +++ b/iexcode/instruments/Motors.py @@ -171,7 +171,7 @@ class Motors: if motor_pvs: rbv_pv,val_pv,sgm_pv,pv = motor_pvs else:#here - print_warning_message('motor = "'+str(name)+'" is not defined for '+iex.BL.endstation) + print_warning_message('motor = "'+str(name)+'" is not defined for '+iex.BL.endstation_name) return if kwargs['relative']: @@ -258,172 +258,172 @@ class Motors: ### x ### def mvx(val,**kwargs): """ moves x motor in the endstation""" - iex.BL.Motors.move('x',val,**kwargs) + iex.BL.motors.move('x',val,**kwargs) def dmvx(delta): """ relative x motor in the endstation""" - iex.BL.Motors.move('x',delta,relative=True) + iex.BL.motors.move('x',delta,relative=True) def scanx(start,stop,step,**kwargs): """ scans the x motor in the endstation""" - iex.BL.Motors.scan("x",start,stop,step,**kwargs) + iex.BL.motors.scan("x",start,stop,step,**kwargs) def dscanx(start,stop,step): """relative scans of the x motor in the endstation """ - iex.BL.Motors.scan("x",start,stop,step,relative=True) + iex.BL.motors.scan("x",start,stop,step,relative=True) ### y ### def mvy(val,**kwargs): """ moves y motor in the endstation""" - iex.BL.Motors.move('y',val,**kwargs) + iex.BL.motors.move('y',val,**kwargs) def dmvy(delta): """ relative y motor in the endstation""" - iex.BL.Motors.move('y',delta,relative=True) + iex.BL.motors.move('y',delta,relative=True) def scany(start,stop,step,**kwargs): """ scans the y motor in the endstation""" - iex.BL.Motors.scan("y",start,stop,step,**kwargs) + iex.BL.motors.scan("y",start,stop,step,**kwargs) def dscany(start,stop,step): """relative scans of the y motor in the endstation """ - iex.BL.Motors.scan("y",start,stop,step,relative=True) + iex.BL.motors.scan("y",start,stop,step,relative=True) ### z ### def mvz(val,**kwargs): """ moves z motor in the endstation""" - iex.BL.Motors.move('z',val,**kwargs) + iex.BL.motors.move('z',val,**kwargs) def dmvz(delta): """ relative z motor in the endstation""" - iex.BL.Motors.move('z',delta,relative=True) + iex.BL.motors.move('z',delta,relative=True) def scanz(start,stop,step,**kwargs): """ scans the z motor in the endstation""" - iex.BL.Motors.scan("z",start,stop,step,**kwargs) + iex.BL.motors.scan("z",start,stop,step,**kwargs) def dscanz(start,stop,step): """relative scans of the z motor in the endstation """ - iex.BL.Motors.scan("z",start,stop,step,relative=True) + iex.BL.motors.scan("z",start,stop,step,relative=True) ### kth ### def mvkth(val,**kwargs): """ moves kth motor in the endstation""" - iex.BL.Motors.move('kth',val,**kwargs) + iex.BL.motors.move('kth',val,**kwargs) def dmvkth(delta): """ relative kth motor in the endstation""" - iex.BL.Motors.move('kth',delta,relative=True) + iex.BL.motors.move('kth',delta,relative=True) def scankth(start,stop,step,**kwargs): """ scans the kth motor in the endstation""" - iex.BL.Motors.scan("kth",start,stop,step,**kwargs) + iex.BL.motors.scan("kth",start,stop,step,**kwargs) def dscankth(start,stop,step): """relative scans of the kth motor in the endstation """ - iex.BL.Motors.scan("kth",start,stop,step,relative=True) + iex.BL.motors.scan("kth",start,stop,step,relative=True) ### kphi ### def mvkphi(val,**kwargs): """ moves kphi motor in the endstation""" - iex.BL.Motors.move('kphi',val,**kwargs) + iex.BL.motors.move('kphi',val,**kwargs) def dmvkphi(val): """ relative kphi motor in the endstation""" - iex.BL.Motors.move('kphi',val,relative=True) + iex.BL.motors.move('kphi',val,relative=True) def scankphi(start,stop,step,**kwargs): """ scans the kphi motor in the endstation""" - iex.BL.Motors.scan("kphi",start,stop,step,**kwargs) + iex.BL.motors.scan("kphi",start,stop,step,**kwargs) def dscankphi(start,stop,step): """relative scans of the kphi motor in the endstation """ - iex.BL.Motors.scan("kphi",start,stop,step,relative=True) + iex.BL.motors.scan("kphi",start,stop,step,relative=True) ### kap ### def mvkap(val,**kwargs): """ moves kap motor in the endstation""" - iex.BL.Motors.move('kap',val,**kwargs) + iex.BL.motors.move('kap',val,**kwargs) def dmvkap(delta): """ relative kap motor in the endstation""" - iex.BL.Motors.move('kap',delta,relative=True) + iex.BL.motors.move('kap',delta,relative=True) def scankap(start,stop,step,**kwargs): """ scans the kap motor in the endstation""" - iex.BL.Motors.scan("kap",start,stop,step,**kwargs) + iex.BL.motors.scan("kap",start,stop,step,**kwargs) def dscankap(start,stop,step): """relative scans of the kap motor in the endstation """ - iex.BL.Motors.scan("kap",start,stop,step,relative=True) + iex.BL.motors.scan("kap",start,stop,step,relative=True) ### tth ### def mvtth(val,**kwargs): """ moves tth motor in the endstation""" - iex.BL.Motors.move('tth',val,**kwargs) + iex.BL.motors.move('tth',val,**kwargs) def dmvtth(delta): """ relative tth motor in the endstation""" - iex.BL.Motors.move('tth',delta,relative=True) + iex.BL.motors.move('tth',delta,relative=True) def scantth(start,stop,step,**kwargs): """ scans the tth motor in the endstation""" - iex.BL.Motors.scan("tth",start,stop,step,**kwargs) + iex.BL.motors.scan("tth",start,stop,step,**kwargs) def dscantth(start,stop,step): """relative scans of the tth motor in the endstation """ - iex.BL.Motors.scan("tth",start,stop,step,relative=True) + iex.BL.motors.scan("tth",start,stop,step,relative=True) ### th ### def mvth(val,**kwargs): """ moves th motor in the endstation""" - iex.BL.Motors.move('th',val,**kwargs) + iex.BL.motors.move('th',val,**kwargs) def dmvth(delta): """ relative th motor in the endstation""" - iex.BL.Motors.move('th',delta,relative=True) + iex.BL.motors.move('th',delta,relative=True) def scanth(start,stop,step,**kwargs): """ scans the th motor in the endstation""" - iex.BL.Motors.scan("th",start,stop,step,**kwargs) + iex.BL.motors.scan("th",start,stop,step,**kwargs) def dscanth(start,stop,step): """relative scans of the th motor in the endstation """ - iex.BL.Motors.scan("th",start,stop,step,relative=True) + iex.BL.motors.scan("th",start,stop,step,relative=True) ### chi ### def mvchi(val,**kwargs): """ moves chi motor in the endstation""" - iex.BL.Motors.move('chi',val,**kwargs) + iex.BL.motors.move('chi',val,**kwargs) def dmvchi(val): """ relative chi motor in the endstation""" - iex.BL.Motors.move('chi',val,relative=True) + iex.BL.motors.move('chi',val,relative=True) def scanchi(start,stop,step,**kwargs): """ scans the chi motor in the endstation""" - iex.BL.Motors.scan("chi",start,stop,step,**kwargs) + iex.BL.motors.scan("chi",start,stop,step,**kwargs) def dscanchi(start,stop,step): """relative scans of the chi motor in the endstation """ - iex.BL.Motors.scan("chi",start,stop,step,relative=True) + iex.BL.motors.scan("chi",start,stop,step,relative=True) ### phi ### def mvphi(val,**kwargs): """ moves phi motor in the endstation""" - iex.BL.Motors.move('phi',val,**kwargs) + iex.BL.motors.move('phi',val,**kwargs) def dmvphi(delta): """ relative phi motor in the endstation""" - iex.BL.Motors.move('phi',delta,relative=True) + iex.BL.motors.move('phi',delta,relative=True) def scanphi(start,stop,step,**kwargs): """ scans the phi motor in the endstation""" - iex.BL.Motors.scan("phi",start,stop,step,**kwargs) + iex.BL.motors.scan("phi",start,stop,step,**kwargs) def dscanphi(start,stop,step): """relative scans of the phi motor in the endstation """ - iex.BL.Motors.scan("phi",start,stop,step,relative=True) + iex.BL.motors.scan("phi",start,stop,step,relative=True) ######## mprint and mvsample ################### @@ -431,7 +431,7 @@ def mprint(): """ prints current position of the physical motors """ - iex.BL.Motors.mprint() + iex.BL.motors.mprint() def mvsample(position_list): """ @@ -440,4 +440,4 @@ def mvsample(position_list): Previously: sample """ - iex.BL.Motors.mvsample(position_list) \ No newline at end of file + iex.BL.motors.mvsample(position_list) \ No newline at end of file diff --git a/iexcode/instruments/VLS_PGM.py b/iexcode/instruments/VLS_PGM.py index 8446e1bf6909eb67b546b6b91387715c9fbd9479..6dffc780bd41acfaa9cdbec6db16157fa51082de 100644 --- a/iexcode/instruments/VLS_PGM.py +++ b/iexcode/instruments/VLS_PGM.py @@ -260,7 +260,7 @@ def mono_status_get(): grating_status = grt_P_status * grt_X_status return mirror_status*grating_status -def mono_grating_change(grating_name,verbose=True): +def mono_grating_set(grating_name,verbose=True): """ Translate between the different grating positions list grating_name: mono_grating_names() @@ -271,7 +271,7 @@ def mono_grating_change(grating_name,verbose=True): """ _mono_optic_change('grating',grating_name, verbose) -def mono_mirror_change(mirror_name,verbose=True): +def mono_mirror_set(mirror_name,verbose=True): """ Translate between the different mirror positions list mirror_name: mono_mirror_names() diff --git a/iexcode/instruments/scanRecord.py b/iexcode/instruments/scanRecord.py index 11f724da53606fee474d5298cd044328b5ee0f91..4e553880611ef5f10d01abc5f804be3e04bb7001 100644 --- a/iexcode/instruments/scanRecord.py +++ b/iexcode/instruments/scanRecord.py @@ -629,7 +629,7 @@ class ScanRecord: pos_num=str(i) pos_pv=caget(scan_pv+".P"+pos_num+"PV") if pos_pv != '': - pos=PV(pos_pv) + pos=PV(pos_pv); time.sleep(0.1)#smallest sleep to allow for PV traffic if not pos.connected: print("Positioner "+pos_num+" has a BAD PV: "+pos.pvname+" not connected") pos_ok = False diff --git a/iexcode/instruments/slits.py b/iexcode/instruments/slits.py index 62a17c79a7aca89057cf6ef324ac287f6ecc4d69..f8a3b82764f3ac6fdf28c633e152a464fbde26a0 100644 --- a/iexcode/instruments/slits.py +++ b/iexcode/instruments/slits.py @@ -28,8 +28,13 @@ def _slits_dictionary(): def slit_name_list(): d=_slits_dictionary() - for key in d.keys(): - print(key) + message = "slit_list = " + for i, key in enumerate(d.keys()): + if i==0: + message += key + else: + message = message+", "+key + print(message) def _slits_wide_open_dictionary(): """ @@ -70,7 +75,7 @@ def slits_pvs(slit_name): size.append((size_val,size_rbv)) center.append((center_val,center_rbv)) else: - print_warning_message('slit_name = '+slit_name+' not a valid slit, choose:') + print_warning_message('slit_name = '+slit_name+' not a valid slit') slit_name_list() return size,center @@ -87,7 +92,7 @@ def slits_synch(slit_name): slit_pv = slit_HV+'sync.PROC' caput(slit_pv,1) else: - print_warning_message('slit_name = '+slit_name+' not a valid slit, choose:') + print_warning_message('slit_name = '+slit_name+' not a valid slit') slit_name_list() def slits_sync_all(): @@ -111,7 +116,7 @@ def slits_get_all(verbose=True): vals[slit_name+'_size'], vals[slit_name+'_center'] = slits_get(slit_name,verbose=verbose) -def slits_set(slit_name,size,center,verbose=True): +def slits_set(slit_name,size,center,verbose=True,wait=True): """ synchs the slit motors and the slit table and then sets the center and size @@ -131,12 +136,12 @@ def slits_set(slit_name,size,center,verbose=True): size_pvs,center_pvs = slits_pvs(slit_name) for i in range(0,len(size_pvs)): - size_val, size_rbv, = size_pvs[i] - center_val,center_rbv = center_pvs[i] + size_rbv, size_val, = size_pvs[i] + center_rbv,center_val = center_pvs[i] if center_rbv != None: - caput(center_val, center[i],timeout=180) + caput(center_val, center[i],wait=wait,timeout=180) if size_rbv != None: - caput(size_val, size[i],timeout=180) + caput(size_val, size[i],wait=wait,timeout=180) if verbose: slits_get(slit_name,verbose=True) @@ -158,8 +163,8 @@ def slits_get(slit_name,verbose=True): size_pvs,center_pvs = slits_pvs(slit_name) for i in range(0,len(size_pvs)): - size_val, size_rbv, = size_pvs[i] - center_val,center_rbv = center_pvs[i] + size_rbv, size_val, = size_pvs[i] + center_rbv,center_val = center_pvs[i] if center_rbv != None: center.append(caget(center_rbv)) else: @@ -173,7 +178,7 @@ def slits_get(slit_name,verbose=True): if len(d[slit_name])>1: print(slit_name + " = ("+str(round(size[0],3))+" x "+str(round(size[1],3))+") @ ("+str(round(center[0],3))+","+str(round(center[1],3))+")") else: - print(slit_name + " = ("+str(round(size[0],3))+") @ ("+str(center[0])+")") + print(slit_name + " = ("+str(round(size[0],3))+") @ ("+str(round(center[0],3))+")") return tuple(size),tuple(center) @@ -185,7 +190,7 @@ def slits_set_size(slit_name,size): size = V for slit3D """ size_current,center = slits_get(slit_name,verbose=False) - slits_set(size,center) + slits_set(slit_name, size=size,center=center) def slits_set_center(slit_name,center): """ @@ -195,7 +200,7 @@ def slits_set_center(slit_name,center): center = V for slit3D """ size,center_current = slits_get(slit_name,verbose=False) - slits_set(size,center) + slits_set(slit_name,size=size,center=center) def slits_scan_size(slit_name,direction,start,stop,step,**kwargs): """ @@ -207,12 +212,13 @@ def slits_scan_size(slit_name,direction,start,stop,step,**kwargs): kwargs.setdefault('center',slits_get(slit_name,verbose=False)[1]) kwargs.setdefault('execute',True) - slit_H,slit_V = _slits_dictionary()[slit_name] - + size,center = slits_pvs(slit_name) if direction == 'H': - (size_rbv,size_val),(center_rbv,center_val) = slits_pvs(slit_H) + size_rbv,size_val = size[0] + center_rbv,center_val = center[0] if direction == 'V': - (size_rbv,size_val),(center_rbv,center_val) = slits_pvs(slit_V) + size_rbv,size_val = size[1] + center_rbv,center_val = center[1] #set slit center slits_set_center(slit_name,kwargs['center']) @@ -233,12 +239,13 @@ def slits_scan_center(slit_name,direction,start,stop,step,**kwargs): kwargs.setdefault('size',slits_get(slit_name,verbose=False)[0]) kwargs.setdefault('execute',True) - slit_H,slit_V = _slits_dictionary()[slit_name] - + size,center = slits_pvs(slit_name) if direction == 'H': - (size_rbv,size_val),(center_rbv,center_val) = slits_pvs(slit_H) + size_rbv,size_val = size[0] + center_rbv,center_val = center[0] if direction == 'V': - (size_rbv,size_val),(center_rbv,center_val) = slits_pvs(slit_V) + size_rbv,size_val = size[1] + center_rbv,center_val = center[1] #set slit center slits_set_size(slit_name,kwargs['size']) @@ -260,7 +267,9 @@ def slit1A_scribe_marks(): """ main_shutter_close() for m in range(9,13): - caput('29idb:m'+str(m)+'.DVAL',0) + caput('29idb:m'+str(m)+'.DVAL',0,wait=True) + + print('At slit1A scribe marks') def slit1A_set(H_size,V_size,verbose=True,**kwargs): """