diff --git a/ScanFunctions_IEX.py b/ScanFunctions_IEX.py index c500704e90c7c17cac64d9c4a8b75cae3374dae9..3a84a4f66c83eea62706e7f97d8363a09cf94c3b 100755 --- a/ScanFunctions_IEX.py +++ b/ScanFunctions_IEX.py @@ -52,7 +52,7 @@ from Macros_29id.ScanFunctions_LakeShore import * #MPA_ROI_SetUp calls: from ScanFunctions_AD import AD_ROI_SetUp -#from ScanFunctions_plot import fit_mda, mda_1D,fit_gauss + #import matplotlib.pyplot as plt @@ -4767,9 +4767,17 @@ def StartOfTheWeek(GRT,branch,wait=False,**kwargs): print(scan+" is not a valid scan scanType=['slit1','wire','flux','monoVslit']") return - def beamsteering(x,y): - D={} - return + def beamsteering(h,v): + D={'V':[' urad up',' urad down'], 'H':[' urad outboard',' urad inboard']} + hrad=round(h*10/0.25,0) + vrad=round(v*10/0.25,0) + if h<0: ih=0 + else: ih=1 + if v<0: iv=0 + else: iv=1 + H1=str(hrad)+D['H'][ih] + V1=str(vrad)+D['V'][iv] + return H1,V1 ### checking diode settings: @@ -4877,6 +4885,10 @@ def StartOfTheWeek(GRT,branch,wait=False,**kwargs): print(' - horizontal: '+str(slit1h)) print(' - vertical: '+str(slit1v)) print('\n') + + a,b=beamsteering(slit1h,slit1v) + print(a+' ; '+b) + except: print('Unable to fit position; try to tweak xrange or FWHM:') print('fit_mda('+str(m)+','+str(detCA4)+',1,"gauss",xrange=[-1,1])')