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
68de74e5
Commit
68de74e5
authored
1 year ago
by
Your Name
Browse files
Options
Downloads
Patches
Plain Diff
doc string and AD/cams
parent
0aea1e30
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Main merge jmcchesn-main-patch branch with main
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
iexcode/instruments/AD_utilities.py
+13
-0
13 additions, 0 deletions
iexcode/instruments/AD_utilities.py
iexcode/instruments/xrays.py
+9
-8
9 additions, 8 deletions
iexcode/instruments/xrays.py
iexcode/macros/cam_macros.py
+21
-3
21 additions, 3 deletions
iexcode/macros/cam_macros.py
with
43 additions
and
11 deletions
iexcode/instruments/AD_utilities.py
+
13
−
0
View file @
68de74e5
...
...
@@ -332,6 +332,19 @@ def ADplugin_ScanSetup(ADplugin, **kwargs):
print
(
"
WARNING: you need to need to disable saving and clear the trigger by hand after the scan
"
)
print
(
"
\t
AD_FreeRun(
"
+
ADplugin
+
"
); scan_triggers_clear()
"
)
def
AD_attributes_set
(
ADplugin
,
filepath
):
"""
filepath is the full path to the xml file
filepath =
'
/xorApps/epics/synApps_6_1/ioc/29idcScienta/iocBoot/ioc29idcScienta/HDF5Attributes.xml
'
filepath =
'
/home/beams/29IDUSER/Documents/User_Macros/Macros_29id/AD_Attributes/DiaGon_Attributes.xml
'
"""
current_xml
=
caget
(
ADplugin
+
"
NDAttributesFile
"
,
as_string
=
True
)
print
(
'
Changed attributes file from
'
,
current_xml
)
caput
(
ADplugin
+
"
NDAttributesFile
"
,
filepath
)
sleep
(
1
)
print
(
'
To:
'
,
caget
(
ADplugin
+
"
NDAttributesStatus
"
,
as_string
=
True
))
def
AD_ROI_setup
(
AD
,
ROInum
,
xcenter
=
500
,
ycenter
=
500
,
xsize
=
50
,
ysize
=
50
,
binX
=
1
,
binY
=
1
):
"""
AD =
"
29id_ps4
"
...
...
This diff is collapsed.
Click to expand it.
iexcode/instruments/xrays.py
+
9
−
8
View file @
68de74e5
...
...
@@ -294,23 +294,24 @@ def apertures_set(c_2B=1,c_1A=1,verbose=True):
slit2B_set
(
Size2B
[
0
],
Size2B
[
1
],
center
=
(
H2_center
,
V2_center
),
verbose
=
verbose
)
def
mvID
(
val
):
def
mvID
(
energy_eV
):
"""
Sets the ID absolute set point (not optimized , mono & apertures stay fixed).
Sets the ID absolute set point in eV
Note: flux is not optimized and mono & apertures stay fixed
to go to most flux use energy
"""
ID_set_eV
(
val
)
ID_set_eV
(
energy_eV
)
def
mvID_calibrated
(
val
):
def
mvID_calibrated
(
energy_eV
):
"""
Sets the ID peak to
val
(calibrated).
Sets the ID peak to
eV
(calibrated).
Note: mono & apertures stay fixed
"""
ID_energy_set_eV
(
val
)
ID_energy_set_eV
(
energy_eV
)
def
scan
_
ID
(
ID_sp_start
,
ID_sp_stop
,
ID_sp_step
,
**
kwargs
):
def
scanID
(
ID_sp_start
,
ID_sp_stop
,
ID_sp_step
,
**
kwargs
):
"""
scan the ID set point
"""
...
...
This diff is collapsed.
Click to expand it.
iexcode/macros/cam_macros.py
+
21
−
3
View file @
68de74e5
import
time
from
os
import
join
from
epics
import
caget
,
caput
,
PV
import
iexcode.instruments.cfg
as
iex
from
iexcode.instruments.AD_utilities
import
*
from
iexcode.instruments.IEX_cameras
import
cam_pv_dictionary
from
iexcode.instruments.scanRecord
import
mda_fileNum
from
iexplot.mda_quick_plot
import
*
from
iexplot.mda_quick_plot
import
plot_image
##############################################################################################################
...
...
@@ -49,8 +51,11 @@ def cam_scan_setup(cam_num,savePlugin='TIFF1:',**kwargs):
(e.g. filepath=
"
/net/s29data/export/data_29id
"
+folder+
"
/
"
+run+
"
/
"
+userName+
"
/
"
+df)
dtype = taken from ADplugin
FileTemplate=
"
%s%s_%4.4d.
"
+dtype; format for filename first %s = filepath, second %s = prefix
prefix = dtype by default
prefix = MDAscan+mda_fileNum
'
with nzeros=4
"""
kwargs
.
setdefault
(
'
nzeros
'
,
4
)
kwargs
.
setdefault
(
'
prefix
'
,
"
MDAscan
"
+
str
.
zfill
(
str
(
mda_fileNum
()),
kwargs
[
"
nzeros
"
]))
ADplugin
=
cam_pv_dictionary
()[
cam_num
]
+
savePlugin
ADplugin_ScanSetup
(
ADplugin
,
**
kwargs
)
...
...
@@ -79,6 +84,19 @@ def cam_save_setup(cam_num,savePlugin='TIFF1:',**kwargs):
ADplugin
=
cam_pv_dictionary
()[
cam_num
]
+
savePlugin
AD_SaveFileSetup
(
ADplugin
,
**
kwargs
)
def
cam_attributes_set
(
cam_num
,
filename
,
savePlugin
=
'
TIFF1:
'
,
**
kwargs
):
"""
filename of attributes.xml
**kwargs:
path =
'
/home/beams/29IDUSER/Documents/User_Macros/Macros_29id/AD_Attributes/
'
"""
kwargs
.
setdefault
(
'
path
'
,
'
/home/beams/29IDUSER/Documents/User_Macros/Macros_29id/AD_Attributes/
'
)
filepath
=
join
(
kwargs
[
'
path
'
],
filename
)
savePlugin
=
'
TIFF1:
'
ADplugin
=
cam_pv_dictionary
()[
cam_num
]
+
savePlugin
AD_attributes_set
(
ADplugin
,
filepath
)
def
cam_last_filepath
(
cam_num
,
savePlugin
=
'
TIFF1:
'
,
verbose
=
True
):
"""
returns the full path for the last saved image
...
...
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