Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iexcode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
29id
iexcode
Commits
b098952c
Commit
b098952c
authored
2 years ago
by
29iduser
Browse files
Options
Downloads
Patches
Plain Diff
fixed BE in scanEA, scanEA_hv needs checked
parent
c5bde9b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iexcode/instruments/electron_analyzer.py
+70
-50
70 additions, 50 deletions
iexcode/instruments/electron_analyzer.py
with
70 additions
and
50 deletions
iexcode/instruments/electron_analyzer.py
+
70
−
50
View file @
b098952c
...
...
@@ -359,74 +359,54 @@ def scanEA(EAlist,**kwargs):
kwargs
.
setdefault
(
'
execute
'
,
True
)
kwargs
.
setdefault
(
"
debug
"
,
False
)
if
EAlist
[
0
]
==
"
KE
"
or
EAlist
[
0
]
==
"
BE
"
:
#checking parameters - BE/KE
if
EAlist
[
0
].
upper
()
==
"
KE
"
or
EAlist
[
0
].
upper
()
==
"
BE
"
:
pass
else
:
print
(
"
need to specify BE or KE
"
)
return
if
EAlist
[
-
1
]
==
'
BS
'
:
sweeps
=
EAlist
[
-
2
]
#getting number of sweeps
if
type
(
EAlist
[
-
1
])
==
str
:
if
EAlist
[
-
1
].
upper
()
==
'
BS
'
:
sweeps
=
EAlist
[
-
2
]
EAlist
[
-
1
]
=
'
BS
'
else
:
sweeps
=
EAlist
[
-
1
]
sweeps
=
EAlist
[
-
1
]
if
kwargs
[
'
debug
'
]:
print
(
"
sweeps:
"
+
str
(
sweeps
))
#check KEs within limit
#
convert BE to KE and
check KEs within limit
s
if
EAlist
[
0
]
==
"
KE
"
:
KElist
=
np
.
array
(
EAlist
[
1
:
-
3
])
elif
EAlist
[
0
]
==
"
BE
"
:
KElist
=
energy_get
()
-
np
.
array
(
EAlist
[
1
:
-
3
])
if
type
(
EAlist
[
-
1
])
==
str
:
KElist
=
KElist
[
0
:
-
1
]
if
kwargs
[
'
debug
'
]:
print
(
"
KElist:
"
+
str
(
KElist
))
#swept mode range check
if
len
(
KElist
)
>
2
:
if
KElist
[
0
]
>
KElist
[
1
]:
print_warning_message
(
'
EA scans from low to high in kinetic energy
'
)
return
KEmin
,
KEmax
=
AllowedEnergyRange
(
EAlist
[
-
3
],
'
Angular
'
)
KE_0
,
KE_1
,
KE_step
=
tuple
(
KElist
)
if
KE_0
>
KE_1
:
print_warning_message
(
'
EA scans from low to high in kinetic energy, fixing order
'
)
KElist
=
[
min
(
KE_0
,
KE_1
),
max
(
KE_0
,
KE_1
),
KE_step
]
#check if KEs are within range
try
:
if
type
(
EAlist
[
-
1
])
==
str
:
KEmin
,
KEmax
=
AllowedEnergyRange
(
EAlist
[
-
4
],
'
Angular
'
)
else
:
KEmin
,
KEmax
=
AllowedEnergyRange
(
EAlist
[
-
3
],
'
Angular
'
)
except
:
print_warning_message
(
"
Not a valid pass Energy - LensMode combination
"
)
print
(
AllowedEnergyRange
())
if
KElist
[
0
]
<
KEmin
:
print_warning_message
(
'
kinetic energy belowed minimum allowed energy
'
)
print
(
AllowedEnergyRange
())
return
if
EAlist
[
0
]
==
"
BE
"
:
if
len
(
EAlist
)
==
5
:
#Fixed
pvCalcOut1
=
_BE2KE_setupCalc
(
EAlist
[
1
],
"
BE_center
"
,
10
,
"
29idcScienta:HV:fixedEnergy.VAL
"
)
EAlist
[
1
]
=
caget
(
pvCalcOut1
+
'
.VAL
'
)
arrayP1
=
list
(
np
.
full
(
sweeps
,
EAlist
[
1
]))
scan_fillin_table
(
pvCalcOut1
+
'
.PROC
'
,
""
,
arrayP1
)
scan_positioner_after_set
(
positioner_after_scan
=
"
STAY
"
)
EAlist
[
1
]
=
arrayP1
[
0
]
if
kwargs
[
'
debug
'
]:
print
(
'
\n
pvCalcOut1:
'
,
pvCalcOut1
)
print
(
'
Pos1 table:
'
,
arrayP1
)
elif
len
(
EAlist
)
==
6
:
#Baby-Swept
pvCalcOut1
=
_BE2KE_setupCalc
(
EAlist
[
1
],
"
BE_center
"
,
10
,
"
29idcScienta:HV:babySweepCenter.VAL
"
)
EAlist
[
1
]
=
caget
(
pvCalcOut1
+
'
.VAL
'
)
arrayP1
=
list
(
np
.
full
(
sweeps
,
EAlist
[
1
]))
scan_fillin_table
(
pvCalcOut1
+
'
PROC
'
,
""
,
arrayP1
)
scan_positioner_after_set
(
positioner_after_scan
=
"
STAY
"
)
print
(
'
\n
pvCalcOut1:
'
,
pvCalcOut1
)
print
(
'
Pos1 table:
'
,
arrayP1
)
elif
len
(
EAlist
)
==
7
:
#Sweep
pvCalcOut1
=
_BE2KE_setupCalc
(
EAlist
[
1
],
"
BE_start
"
,
9
,
"
29idcScienta:HV:sweepStartEnergy.VAL
"
)
pvCalcOut2
=
_BE2KE_setupCalc
(
EAlist
[
2
],
"
BE_stop
"
,
10
,
"
29idcScienta:HV:sweepStopEnergy.VAL
"
)
EAlist
[
1
]
=
caget
(
pvCalcOut1
+
'
.VAL
'
)
EAlist
[
2
]
=
caget
(
pvCalcOut2
+
'
.VAL
'
)
arrayP1
=
list
(
np
.
full
(
sweeps
,
EAlist
[
1
]))
arrayP2
=
list
(
np
.
full
(
sweeps
,
EAlist
[
2
]))
scan_fillin_table
(
pvCalcOut1
+
'
.PROC
'
,
""
,
arrayP1
)
scan_fillin_table
(
pvCalcOut2
+
'
.PROC
'
,
""
,
arrayP2
)
scan_positioner_after_set
(
positioner_after_scan
=
"
STAY
"
)
if
kwargs
[
'
debug
'
]:
print
(
"
\n
pvCalcOut1
"
,
pvCalcOut1
)
print
(
"
\n
pvCalcOut2
"
,
pvCalcOut2
)
print
(
'
Pos1 table:
'
,
arrayP1
)
print
(
'
Pos2 table:
'
,
arrayP2
)
EAlist
[
0
]
==
'
KE
'
else
:
_BE2KE_setupCalc
(
0
,
""
,
9
,
""
)
_BE2KE_setupCalc
(
0
,
""
,
10
,
""
)
#everything checks out convert to KE
for
i
,
KE
in
enumerate
(
KElist
):
EAlist
[
1
+
i
]
=
KElist
[
i
]
if
kwargs
[
'
debug
'
]:
print
(
'
/n EAlist =>
'
,
EAlist
)
...
...
@@ -566,6 +546,46 @@ def mvth_interp(RoughPositions, thVal,**kwargs):
#print("Pos = ",Pos)
EA
.
Motors
.
mvsample
(
Pos
)
"""
def _removed_from_scanEA():
if EAlist[0]==
"
BE
"
:
if len(EAlist)==5: #Fixed
pvCalcOut1=_BE2KE_setupCalc(EAlist[1],
"
BE_center
"
,10,
"
29idcScienta:HV:fixedEnergy.VAL
"
)
EAlist[1]=caget(pvCalcOut1+
'
.VAL
'
)
arrayP1=list(np.full(sweeps, EAlist[1]))
scan_fillin_table(pvCalcOut1+
'
.PROC
'
,
""
,arrayP1)
scan_positioner_after_set(positioner_after_scan=
"
STAY
"
)
EAlist[1]=arrayP1[0]
if kwargs[
'
debug
'
]:
print(
'
\n
pvCalcOut1:
'
,pvCalcOut1)
print(
'
Pos1 table:
'
,arrayP1)
elif len(EAlist)==6: #Baby-Swept
pvCalcOut1=_BE2KE_setupCalc(EAlist[1],
"
BE_center
"
,10,
"
29idcScienta:HV:babySweepCenter.VAL
"
)
EAlist[1]=caget(pvCalcOut1+
'
.VAL
'
)
arrayP1=list(np.full(sweeps, EAlist[1]))
scan_fillin_table(pvCalcOut1+
'
PROC
'
,
""
,arrayP1)
scan_positioner_after_set(positioner_after_scan=
"
STAY
"
)
print(
'
\n
pvCalcOut1:
'
,pvCalcOut1)
print(
'
Pos1 table:
'
,arrayP1)
elif len(EAlist)==7: #Sweep
pvCalcOut1=_BE2KE_setupCalc(EAlist[1],
"
BE_start
"
,9,
"
29idcScienta:HV:sweepStartEnergy.VAL
"
)
pvCalcOut2=_BE2KE_setupCalc(EAlist[2],
"
BE_stop
"
,10,
"
29idcScienta:HV:sweepStopEnergy.VAL
"
)
EAlist[1]=caget(pvCalcOut1+
'
.VAL
'
)
EAlist[2]=caget(pvCalcOut2+
'
.VAL
'
)
arrayP1=list(np.full(sweeps, EAlist[1]))
arrayP2=list(np.full(sweeps, EAlist[2]))
scan_fillin_table(pvCalcOut1+
'
.PROC
'
,
""
,arrayP1)
scan_fillin_table(pvCalcOut2+
'
.PROC
'
,
""
,arrayP2)
scan_positioner_after_set(positioner_after_scan=
"
STAY
"
)
if kwargs[
'
debug
'
]:
print(
"
\n
pvCalcOut1
"
,pvCalcOut1)
print(
"
\n
pvCalcOut2
"
,pvCalcOut2)
print(
'
Pos1 table:
'
,arrayP1)
print(
'
Pos2 table:
'
,arrayP2)
EAlist[0]==
'
KE
'
else:
_BE2KE_setupCalc(0,
""
,9,
""
)
_BE2KE_setupCalc(0,
""
,10,
""
)
"""
def
scanEA_hv
(
EAlist
,
hv_lists
,
**
kwargs
):
"""
triggers and EAscan for each photon energy in *hvs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment