Skip to content
Snippets Groups Projects
Commit 35ba3254 authored by Arnaud HEMMERLE's avatar Arnaud HEMMERLE
Browse files

Continue Ewald correction, on v3.2.3 basis

parent 17f53617
Branches v3.2.3-EWALD
No related tags found
No related merge requests found
......@@ -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(
......
......@@ -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([
......
{"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}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment