Skip to content

Commit

Permalink
[BC] reset axes to ifft even if axis is None
Browse files Browse the repository at this point in the history
  • Loading branch information
helene-t committed Jun 24, 2022
1 parent 087e3a5 commit 733dca6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 6 additions & 1 deletion SciDataTool/GUI/WAxisManager/WAxisManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
9 changes: 0 additions & 9 deletions SciDataTool/Methods/DataND/plot_2D_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 733dca6

Please sign in to comment.