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

Correct bug with selected sensors

parent c2e3d925
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,7 @@ def process_vineyard(nxs_name, path_to_nxs_dir,
bin_size=10, is_force_gamma=False, fgamma=0.,
is_gixd_logx=False, is_gixd_logy=False, is_gixd_logz=False,
nb_levels=50, map_gixd='jet', roi_soller=[510, 350, 130, 692],
selected_sensors = None,
is_print_stamps=False, is_plot=False, is_print_info=False, is_raster=False):
"""
Extract the nexus file, plot and return the channel of the Vineyard's peak.
......@@ -132,6 +133,8 @@ def process_vineyard(nxs_name, path_to_nxs_dir,
Colormap of the image.
roi_soller : list of int, optional
ROI of the Soller's slits.
selected_sensors : list of str, optional
List of aliases of sensors, for their mean value to be added to the plot.
is_print_stamps : bool, optional
Print the list of sensors contained in the nexus file.
is_plot : bool, optional
......@@ -145,13 +148,14 @@ def process_vineyard(nxs_name, path_to_nxs_dir,
Vertical channel corresponding to the Vineyard's peak.
"""
x, y, x_label, y_label, time_str, _,\
x, y, x_label, y_label, time_str, sensors_str, _,\
integ_rod, integ_rod_top, integ_rod_bottom, integ_rod_first_quarter,\
mat, mat_binned, _, mean_pi, _, mean_gamma, _, _ = extract_gixd_scan(
nxs_name, path_to_nxs_dir,
0., 1., 1., 1.,
bin_size, False,
is_force_gamma, fgamma, roi_soller,
selected_sensors,
is_print_stamps, is_print_info
)
......@@ -161,7 +165,7 @@ def process_vineyard(nxs_name, path_to_nxs_dir,
if is_plot:
plot_gixd_scan(
x, y, x_label, y_label, time_str,
x, y, x_label, y_label, time_str, sensors_str,
integ_rod, integ_rod_top, integ_rod_bottom, integ_rod_first_quarter,
mat_binned, mean_pi, mean_gamma,
nxs_name, '', is_gixd_logx, is_gixd_logy, is_gixd_logz,
......
......@@ -294,8 +294,9 @@ def extract_direct_xrr_liquid(
"""
# Extract the sum of all images in the time scan
_, image_direct, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
direct_scan_name, path_to_nxs_dir, is_print_stamps=False, is_print_info=False)
_, image_direct, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
direct_scan_name, path_to_nxs_dir, selected_sensors=None,
is_print_stamps=False, is_print_info=False)
# Replace the intensity of the dead zones with a value of 0
image_direct = np.where(image_direct<0., 0., image_direct)
......@@ -569,8 +570,8 @@ def extract_xrr_liquid_scan(
time_end = epoch_time[-1]
# Extract the sum of all images in the time scan
_, image, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
nxs_name, path_to_nxs_dir,
_, image, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
nxs_name, path_to_nxs_dir, selected_sensors=None,
is_print_stamps=False, is_print_info=False)
# Replace the intensity of the dead zones with a value of 0
......@@ -1350,14 +1351,14 @@ def extract_direct_xrr_solid(
if sensor_list[0] == 'zs':
# If the direct is a height scan, take only the five first points
images_direct, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
direct_scan_name, path_to_nxs_dir,
images_direct, _, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
direct_scan_name, path_to_nxs_dir, selected_sensors=None,
is_print_stamps=False, is_print_info=False)
image_direct = np.mean(images_direct[0:5], axis = 0)
else:
# Extract the sum of all images in the time scan
_, image_direct, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
direct_scan_name, path_to_nxs_dir,
_, image_direct, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
direct_scan_name, path_to_nxs_dir,selected_sensors=None,
is_print_stamps=False, is_print_info=False)
image_direct = image_direct/nbpts
......@@ -1596,8 +1597,8 @@ def extract_xrr_solid_scan(
####################################################
# Extract individual images
images, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
nxs_name, path_to_nxs_dir,
images, _, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
nxs_name, path_to_nxs_dir, selected_sensors=None,
is_print_stamps=False, is_print_info=is_print_info)
for image in images:
......
......@@ -401,6 +401,7 @@ def display_widgets_identify_peaks(expt, dw):
sdd_gain=expt.params['sdd_gain'],
sdd_ev0=expt.params['sdd_ev0'],
arr_peaks=expt.params['arr_peaks'],
selected_sensors = None,
is_use_ev=expt.params['is_use_ev'],
is_xrf_log=expt.params['is_xrf_log'],
absorbers='',
......
......@@ -187,8 +187,8 @@ def preview_indiv_scan_xrr(nxs_name, expt):
"""
# Extract the sum of all images in the time scan
_, images_sum, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
nxs_name, expt.paths['dir_nxs'],
_, images_sum, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
nxs_name, expt.paths['dir_nxs'], selected_sensors=None,
is_print_stamps=False, is_print_info=False)
# Replace the intensity of the dead zones with a value of 0
......@@ -269,23 +269,26 @@ def preview_direct_xrr(expt):
if sensor_list[0] == 'zs':
# Extract each individual image from the height scan
images_direct, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
images_direct, _, _, _, _, _, _, _ ,_ = area_detector.extract_area_detector_scan(
expt.params['direct_scan_name'], expt.paths['dir_nxs'],
selected_sensors=None,
is_print_stamps=False, is_print_info=False)
# Take the average over the first five images to get the direct
image_direct = np.mean(images_direct[0:5], axis = 0)
else:
# Extract the sum of all images in the time scan
_, image_direct, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
_, image_direct, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
expt.params['direct_scan_name'], expt.paths['dir_nxs'],
selected_sensors=None,
is_print_stamps=False, is_print_info=False)
elif expt.params['type_xrr'] == 'liquid':
# Extract the sum of all images in the time scan
_, image_direct, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
_, image_direct, _, _, _, _, _, _, _ = area_detector.extract_area_detector_scan(
expt.params['direct_scan_name'], expt.paths['dir_nxs'],
selected_sensors=None,
is_print_stamps=False, is_print_info=False)
# Replace the intensity of the dead zones with a value of 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment