Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
rodolakis
Macros_29id
Commits
62f1bffa
Commit
62f1bffa
authored
Apr 12, 2022
by
rodolakis
Browse files
add scanq, dscanq, scanqE
parent
a925a9bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
ScanFunctions_IEX.py
View file @
62f1bffa
...
...
@@ -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;
f
alse just fills in the scanRecord
run = True (default) starts the scan;
F
alse 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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment