Skip to content

Commit

Permalink
Merge pull request Eomys#104 from EOMYS-Public/GUI
Browse files Browse the repository at this point in the history
[BC] Solving issue related to animation
  • Loading branch information
helene-t authored May 2, 2022
2 parents 76271c8 + 255ff7f commit 82197ea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions SciDataTool/Functions/Plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"speed": "rpm",
"Rotation speed": "rpm",
"modes": "",
"designs": "",
}

axis_norm_dict = {
Expand Down
2 changes: 2 additions & 0 deletions SciDataTool/GUI/DDataPlotter/DDataPlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ def set_cursor(event):
x_min, x_max = self.ax.get_xlim()
dx = (x_max - x_min) / 50
if X is not None and Y is not None:
if isinstance(X, str):
X = ind
label = format_coord(X, Y, Z, sep="\n", ind=ind)
if legend is not None:
label = legend + "\n" + label
Expand Down
2 changes: 1 addition & 1 deletion SciDataTool/Methods/DataND/export_along.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def export_along(
)
second_line = format_matrix(
np.insert(
results[axes_list_new[1].name].astype("str"),
results[axes_list_new[1].name].astype("<U64"),
0,
A2_cell,
),
Expand Down
12 changes: 9 additions & 3 deletions SciDataTool/Methods/DataND/plot_3D_Data_Animated.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from numpy import arange, nanmax, nanmin, frombuffer
import imageio
from ...GUI.DDataPlotter.DDataPlotter import PARAM_2D
from ...Functions.Plot import ifft_dict


def plot_3D_Data_Animated(
Expand Down Expand Up @@ -31,9 +32,14 @@ def plot_3D_Data_Animated(

# Detecting if animated axis is a DataPattern, if true changing the input given to the function
for ax_obj in self.get_axes():
if ax_obj.name == animated_axis.split("[")[0]:
animated_axis_obj = ax_obj
break
if ax_obj.name in ifft_dict:
if ifft_dict[ax_obj.name] == animated_axis.split("[")[0]:
animated_axis_obj = ax_obj
break
else:
if ax_obj.name == animated_axis.split("[")[0]:
animated_axis_obj = ax_obj
break

if isinstance(animated_axis_obj, DataPattern):
# Removing one_period as it is not available with a DataPattern
Expand Down

0 comments on commit 82197ea

Please sign in to comment.