Commit 62f1bffa authored by rodolakis's avatar rodolakis
Browse files

add scanq, dscanq, scanqE

parent a925a9bf
......@@ -3571,11 +3571,12 @@ def Scan_Energy_Go(scanDIM,start,stop,step,ID_offset=0,ID_parked=None,coef=1,set
############################## Kappa - Motor Scan Setting ##############################
##############################################################################################################
def scanth2th(tth_start,tth_stop,tth_step,th_offset,ct,**kwargs):
"""
Used for a linear (not table) scan where th = tth /2 + th_offset
**kwargs
run = True (default) starts the scan; false just fills in the scanRecord
run = True (default) starts the scan; False just fills in the scanRecord
scanIOC = BL_ioc (default)
scanDIM = 1 (default)
settling_time = 0.1 (default)
......@@ -3614,6 +3615,47 @@ def scanth2th(tth_start,tth_stop,tth_step,th_offset,ct,**kwargs):
# Need to clear positionner!
Clear_Scan_Positioners(scanIOC)
def scanq(tth_start,tth_stop,tth_step,th_offset,ct,**kwargs):
scanth2th(tth_start,tth_stop,tth_step,th_offset,ct,**kwargs)
def dscanq(tth_rel_start, tth_rel_stop, tth_step):
thRBV='29idKappa:Euler_ThetaRBV'
thVAL='29idKappa:Euler_Theta'
tthRBV='29idKappa:m9.RBV'
tthVAL='29idKappa:m9.VAL'
th0=caget(thRBV)
tth0=caget(tthRBV)
tth_start=tth0+tth_rel_start
tth_stop=tth0+tth_rel_stop
th_offset=th0-tth0/2
scanth2th(tth_start,tth_stop,tth_step,th_offset,ct,**kwargs)
def scanqE(listE,listq,omega,ct):
listE=list(Scan_MakeTable(listE))
start,stop,step=listq
energy(listE[0])
sleep(10)
find_gain(1)
for i,e in enumerate(listE):
if i>0: energy(e)
#mono(e)
uan(start,start/2+omega)
sleep(10)
find_gain(4)
find_gain(2)
sleep(10)
## just to be safe:
find_gain(4)
find_gain(2)
sleep(10)
scanq(start,stop,step,omega,ct)
n=LastMDA()
mytitle='scan# '+str(n)+' - E = '+str(e)+' eV'
plot_mda(n,34,n,34,log='log',color='b',title=mytitle)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment