From 733dca633c69291e96d871c346145f4fef4e22ce Mon Sep 17 00:00:00 2001 From: helene-t Date: Fri, 24 Jun 2022 10:34:38 +0200 Subject: [PATCH] [BC] reset axes to ifft even if axis is None --- SciDataTool/GUI/WAxisManager/WAxisManager.py | 7 ++++++- SciDataTool/Methods/DataND/plot_2D_Data.py | 9 --------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/SciDataTool/GUI/WAxisManager/WAxisManager.py b/SciDataTool/GUI/WAxisManager/WAxisManager.py index 6d72ad4..f2fe4f8 100644 --- a/SciDataTool/GUI/WAxisManager/WAxisManager.py +++ b/SciDataTool/GUI/WAxisManager/WAxisManager.py @@ -307,7 +307,7 @@ def fft_sync(self, axis_changed, is_refresh=True): self.w_axis_1.axes_list[i] = ifft_dict[axis] self.gen_slice_op(is_refresh=False) - elif axis_changed == "axis 2" and self.w_axis_2.get_axis_selected() != "None": + elif axis_changed == "axis 2": if self.w_axis_2.get_axis_selected() != "None": action_selected = self.w_axis_2.get_current_action_name() self.w_axis_1.set_action(action_selected) @@ -376,6 +376,11 @@ def fft_sync(self, axis_changed, is_refresh=True): or self.w_axis_2.axis_selected in ifft_dict ): self.w_axis_2.axes_list[i] = ifft_dict[axis] + else: + # Make sure that all axes are reset to ifft + for i, axis in enumerate(self.w_axis_2.axes_list): + if axis in ifft_dict: + self.w_axis_2.axes_list[i] = ifft_dict[axis] self.gen_slice_op(is_refresh=False) self.w_axis_1.set_unit() self.w_axis_2.set_unit() diff --git a/SciDataTool/Methods/DataND/plot_2D_Data.py b/SciDataTool/Methods/DataND/plot_2D_Data.py index f771741..0842800 100644 --- a/SciDataTool/Methods/DataND/plot_2D_Data.py +++ b/SciDataTool/Methods/DataND/plot_2D_Data.py @@ -155,15 +155,6 @@ def plot_2D_Data( # Fix axes order arg_list_along = fix_axes_order([axis.name for axis in self.get_axes()], arg_list) - # If fft axes in data but axis not required, request ifft axis - for axis in self.get_axes(): - if ( - axis.name in ifft_dict - and axis.name not in axes_names - and ifft_dict[axis.name] not in axes_names - ): - arg_list_along.append(ifft_dict[axis.name] + "[0]") - # In case of 1D fft, keep only positive wavenumbers for i, arg in enumerate(arg_list_along): if "wavenumber" in arg and "=" not in arg and "[" not in arg: