Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
JupyLabBook
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SIRIUS Beamline
Notebooks
JupyLabBook
Commits
35ba3254
Commit
35ba3254
authored
3 months ago
by
Arnaud HEMMERLE
Browse files
Options
Downloads
Patches
Plain Diff
Continue Ewald correction, on v3.2.3 basis
parent
17f53617
Branches
v3.2.3-EWALD
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/backend/gixs.py
+20
-9
20 additions, 9 deletions
lib/backend/gixs.py
lib/frontend/process_widgets/wgixs.py
+14
-4
14 additions, 4 deletions
lib/frontend/process_widgets/wgixs.py
lib/params/params_init.json
+1
-1
1 addition, 1 deletion
lib/params/params_init.json
with
35 additions
and
14 deletions
lib/backend/gixs.py
+
20
−
9
View file @
35ba3254
...
...
@@ -25,7 +25,7 @@ def process_gixs_scan(
selected_sensors
=
None
,
absorbers
=
''
,
is_gixs_logz
=
True
,
map_gixs
=
'
viridis
'
,
path_to_save_dir
=
''
,
is_print_stamps
=
False
,
is_plot
=
False
,
is_save_sum
=
False
,
is_save_each
=
False
,
is_print_info
=
False
):
is_save_sum
=
False
,
is_save_each
=
False
,
is_print_info
=
False
,
is_ewald
=
False
):
"""
Call functions for extracting, plotting, and saving a GIXS scan.
...
...
@@ -86,6 +86,8 @@ def process_gixs_scan(
Save each individual image and the sum.
is_print_info : bool, optional
Verbose mode.
is_ewald : bool, optional
Apply the Ewald sphere correction.
Returns
-------
...
...
@@ -101,7 +103,7 @@ def process_gixs_scan(
List of qz in the profile.
"""
images
,
images_sum
,
qxy_grid
,
qz_grid
,
integ_qxy
,
integ_qz
,
\
images
,
images_sum
,
images_sum_ewald
,
qxy_grid
,
qz_grid
,
integ_qxy
,
integ_qz
,
\
qxy_list
,
qz_list
,
gamma_str
,
delta_str
,
thetai_str
,
time_str
,
sensors_str
,
\
stamps_0d
,
data_0d
=
\
extract_gixs_scan
(
...
...
@@ -123,6 +125,14 @@ def process_gixs_scan(
is_save_sum
=
False
if
is_plot
:
if
is_ewald
:
fig
=
plot_gixs_scan
(
images_sum_ewald
,
roi_2d
,
clim
,
qxy_grid
,
qz_grid
,
qxy_list
,
qz_list
,
nxs_name
,
absorbers
,
is_gixs_logz
,
map_gixs
,
gamma_str
,
delta_str
,
thetai_str
,
time_str
,
sensors_str
)
else
:
fig
=
plot_gixs_scan
(
images_sum
,
roi_2d
,
clim
,
qxy_grid
,
qz_grid
,
qxy_list
,
qz_list
,
nxs_name
,
absorbers
,
is_gixs_logz
,
map_gixs
,
...
...
@@ -130,6 +140,7 @@ def process_gixs_scan(
sensors_str
)
if
is_save_each
:
# Save the sum and each individual image in a dedicated folder
save_gixs_scan
(
...
...
@@ -149,7 +160,7 @@ def process_gixs_scan(
)
# Do not return `images`, as this might be a very big object
return
images_sum
,
integ_qxy
,
integ_qz
,
qxy_list
,
qz_list
return
images_sum
,
images_sum_ewald
,
integ_qxy
,
integ_qz
,
qxy_list
,
qz_list
def
extract_gixs_scan
(
...
...
This diff is collapsed.
Click to expand it.
lib/frontend/process_widgets/wgixs.py
+
14
−
4
View file @
35ba3254
...
...
@@ -31,7 +31,7 @@ def display_widgets_gixs(expt):
'
distance_detec
'
,
'
pixel_poni_x
'
,
'
pixel_poni_y
'
,
'
fgamma
'
,
'
fdelta
'
,
'
fthetai
'
,
'
pixel_size
'
,
'
wavelength
'
,
'
x_min
'
,
'
size_x
'
,
'
y_min
'
,
'
size_y
'
,
'
clim_min
'
,
'
clim_max
'
,
'
map_gixs
'
,
'
selected_sensors_str
'
'
selected_sensors_str
'
,
'
is_ewald
'
]
)
...
...
@@ -74,7 +74,8 @@ def display_widgets_gixs(expt):
"
is_plot=%s,
"
"
is_save_sum=%s,
"
"
is_save_each=%s,
"
"
is_print_info=%s
"
"
is_print_info=%s,
"
"
is_ewald=%s
"
"
)
"
%
(
scan
.
nxs_name
,
'
paths[
\'
dir_nxs
\'
]
'
,
...
...
@@ -104,7 +105,8 @@ def display_widgets_gixs(expt):
expt
.
params
[
'
is_plot
'
],
expt
.
params
[
'
is_save_sum
'
],
expt
.
params
[
'
is_save_each
'
],
expt
.
params
[
'
is_print_info
'
]
expt
.
params
[
'
is_print_info
'
],
expt
.
params
[
'
is_ewald
'
]
)
)
...
...
@@ -313,6 +315,13 @@ def display_widgets_gixs(expt):
layout
=
iwid
.
Layout
(
width
=
'
800px
'
),
description
=
'
Sensors to add (sep. with
\"
;
\"
)
'
)
# Use the Ewald sphere correction
dw
[
'
is_ewald
'
]
=
iwid
.
Checkbox
(
value
=
expt
.
get_default_param_value
(
'
is_ewald
'
,
alt
=
False
),
style
=
style
,
layout
=
iwid
.
Layout
(
width
=
'
200px
'
),
description
=
'
Ewald sphere
'
)
# Proceed
button
=
iwid
.
Button
(
description
=
'
Insert plot
'
,
style
=
{
"
button_color
"
:
"
lightgreen
"
})
...
...
@@ -333,7 +342,8 @@ def display_widgets_gixs(expt):
])
lvl_2
=
iwid
.
HBox
([
dw
[
'
is_force_gamma
'
],
dw
[
'
fgamma
'
],
dw
[
'
is_force_delta
'
],
dw
[
'
fdelta
'
],
dw
[
'
is_force_thetai
'
],
dw
[
'
fthetai
'
]
dw
[
'
is_force_gamma
'
],
dw
[
'
fgamma
'
],
dw
[
'
is_force_delta
'
],
dw
[
'
fdelta
'
],
dw
[
'
is_force_thetai
'
],
dw
[
'
fthetai
'
],
dw
[
'
is_ewald
'
]
])
lvl_3
=
iwid
.
HBox
([
...
...
This diff is collapsed.
Click to expand it.
lib/params/params_init.json
+
1
−
1
View file @
35ba3254
{
"wavelength"
:
0.155
,
"is_plot"
:
true
,
"is_save"
:
true
,
"is_gixd_logx"
:
false
,
"is_gixd_logy"
:
false
,
"is_gixd_logz"
:
false
,
"is_compute_qz"
:
true
,
"is_force_gamma"
:
false
,
"is_print_stamps"
:
false
,
"is_print_info"
:
false
,
"is_print_abs"
:
false
,
"channel0"
:
607.0
,
"thetaz_factor"
:
0.000243
,
"thetac"
:
0.0028
,
"fgamma"
:
0.0
,
"bin_size"
:
10
,
"nb_levels"
:
50
,
"moy_to_create"
:
"10, 20, 40"
,
"map_gixd"
:
"jet"
,
"is_params_loaded"
:
true
,
"xas_signal_label"
:
"mon4"
,
"xas_norm_label"
:
"mon2"
,
"xas_standard_name"
:
"XAS_ref_Ni.txt"
,
"xas_energy_min"
:
8.2
,
"xas_energy_max"
:
8.6
,
"xas_energy_shift"
:
0.009
,
"energy_current"
:
8.333
,
"bragg_current"
:
13.7745
,
"is_identify_peaks"
:
false
,
"arr_peaks"
:
[[
null
,
null
]],
"is_plot_spectrogram"
:
true
,
"is_plot_first_last"
:
true
,
"is_plot_sum"
:
true
,
"is_xrf_log"
:
true
,
"is_use_ev"
:
false
,
"sdd_elements"
:
"4"
,
"channel_xrf_first"
:
0
,
"channel_xrf_last"
:
2047
,
"sdd_gain"
:
10.0
,
"sdd_ev0"
:
0.0
,
"first_point_plot"
:
0
,
"last_point_plot"
:
-1
,
"is_save_sum"
:
true
,
"is_save_each"
:
false
,
"is_gixs_logz"
:
true
,
"is_force_delta"
:
false
,
"is_force_thetai"
:
false
,
"distance_detec"
:
1000.0
,
"pixel_poni_x"
:
0.0
,
"pixel_poni_y"
:
0.0
,
"fdelta"
:
0.0
,
"fthetai"
:
0.0
,
"pixel_size"
:
0.172
,
"qxy_min"
:
0.0
,
"qxy_max"
:
1.0
,
"qz_min"
:
0.0
,
"qz_max"
:
1.0
,
"map_gixs"
:
"viridis"
,
"direct_scan_name"
:
"SIRIUS_2022_02_23_4080.nxs"
,
"is_track_beam"
:
true
,
"is_bckg_up"
:
true
,
"is_bckg_down"
:
true
,
"is_bckg_left"
:
false
,
"is_bckg_right"
:
false
,
"is_force_direct"
:
false
,
"is_plot_m4pitch"
:
true
,
"is_plot_twotheta"
:
true
,
"is_plot_qz"
:
true
,
"is_plot_pos_y_beam"
:
false
,
"fdirect"
:
1.0
,
"m4pitch0"
:
-0.035
,
"roi_x0"
:
150
,
"roi_y0"
:
123
,
"roi_size_x"
:
80
,
"roi_size_y"
:
11
,
"summation_roi_size_y"
:
5
,
"type_xrr"
:
"solid"
,
"is_area_detector_logz"
:
true
,
"x_min"
:
-1
,
"size_x"
:
-1
,
"y_min"
:
-1
,
"size_y"
:
-1
,
"map_area_detector"
:
"viridis"
,
"is_raster"
:
true
,
"x0_soller"
:
510
,
"size_x_soller"
:
130
,
"y0_soller"
:
350
,
"size_y_soller"
:
692
,
"clim_min"
:
-1
,
"clim_max"
:
-1
}
{
"wavelength"
:
0.155
,
"is_plot"
:
true
,
"is_save"
:
true
,
"is_gixd_logx"
:
false
,
"is_gixd_logy"
:
false
,
"is_gixd_logz"
:
false
,
"is_compute_qz"
:
true
,
"is_force_gamma"
:
false
,
"is_print_stamps"
:
false
,
"is_print_info"
:
false
,
"is_print_abs"
:
false
,
"channel0"
:
607.0
,
"thetaz_factor"
:
0.000243
,
"thetac"
:
0.0028
,
"fgamma"
:
0.0
,
"bin_size"
:
10
,
"nb_levels"
:
50
,
"moy_to_create"
:
"10, 20, 40"
,
"map_gixd"
:
"jet"
,
"is_params_loaded"
:
true
,
"xas_signal_label"
:
"mon4"
,
"xas_norm_label"
:
"mon2"
,
"xas_standard_name"
:
"XAS_ref_Ni.txt"
,
"xas_energy_min"
:
8.2
,
"xas_energy_max"
:
8.6
,
"xas_energy_shift"
:
0.009
,
"energy_current"
:
8.333
,
"bragg_current"
:
13.7745
,
"is_identify_peaks"
:
false
,
"arr_peaks"
:
[[
null
,
null
]],
"is_plot_spectrogram"
:
true
,
"is_plot_first_last"
:
true
,
"is_plot_sum"
:
true
,
"is_xrf_log"
:
true
,
"is_use_ev"
:
false
,
"sdd_elements"
:
"4"
,
"channel_xrf_first"
:
0
,
"channel_xrf_last"
:
2047
,
"sdd_gain"
:
10.0
,
"sdd_ev0"
:
0.0
,
"first_point_plot"
:
0
,
"last_point_plot"
:
-1
,
"is_save_sum"
:
true
,
"is_save_each"
:
false
,
"is_gixs_logz"
:
true
,
"is_force_delta"
:
false
,
"is_force_thetai"
:
false
,
"distance_detec"
:
1000.0
,
"pixel_poni_x"
:
0.0
,
"pixel_poni_y"
:
0.0
,
"fdelta"
:
0.0
,
"fthetai"
:
0.0
,
"pixel_size"
:
0.172
,
"qxy_min"
:
0.0
,
"qxy_max"
:
1.0
,
"qz_min"
:
0.0
,
"qz_max"
:
1.0
,
"map_gixs"
:
"viridis"
,
"direct_scan_name"
:
"SIRIUS_2022_02_23_4080.nxs"
,
"is_track_beam"
:
true
,
"is_bckg_up"
:
true
,
"is_bckg_down"
:
true
,
"is_bckg_left"
:
false
,
"is_bckg_right"
:
false
,
"is_force_direct"
:
false
,
"is_plot_m4pitch"
:
true
,
"is_plot_twotheta"
:
true
,
"is_plot_qz"
:
true
,
"is_plot_pos_y_beam"
:
false
,
"fdirect"
:
1.0
,
"m4pitch0"
:
-0.035
,
"roi_x0"
:
150
,
"roi_y0"
:
123
,
"roi_size_x"
:
80
,
"roi_size_y"
:
11
,
"summation_roi_size_y"
:
5
,
"type_xrr"
:
"solid"
,
"is_area_detector_logz"
:
true
,
"x_min"
:
-1
,
"size_x"
:
-1
,
"y_min"
:
-1
,
"size_y"
:
-1
,
"map_area_detector"
:
"viridis"
,
"is_raster"
:
true
,
"x0_soller"
:
510
,
"size_x_soller"
:
130
,
"y0_soller"
:
350
,
"size_y_soller"
:
692
,
"clim_min"
:
-1
,
"clim_max"
:
-1
,
"is_ewald"
:
false
}
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