pylbo.visualisation.modes.cartesian_3d

Classes

CartesianSlicePlot3D

Class for handling Cartesian 3D plots of the eigenmode solution.

Module Contents

class pylbo.visualisation.modes.cartesian_3d.CartesianSlicePlot3D(data: pylbo.visualisation.modes.mode_data.ModeVisualisationData, u2: numpy.ndarray, u3: numpy.ndarray, time: float, slicing_axis: str, figsize: tuple[int, int], vmin: float = None, vmax: float = None, **kwargs)

Bases: pylbo.visualisation.modes.cartesian_2d.CartesianSlicePlot2D

Class for handling Cartesian 3D plots of the eigenmode solution.

Parameters:
  • data (ModeVisualisationData) – The data for the visualisation.

  • u2 (np.ndarray) – The y coordinate of the eigenmode solution.

  • u3 (np.ndarray) – The z coordinate of the eigenmode solution.

  • time (float) – The time at which the eigenmode solution is calculated.

  • slicing_axis (str) – The axis along which the eigenmode solution is sliced.

  • figsize (tuple[int, int]) – The size of the figure.

  • vmin (float) – The minimum value of the colourbar. If None, the minimum value of the solution is used.

  • vmax (float) – The maximum value of the colourbar. If None, the maximum value of the solution is used.

vmin
vmax
_view
_create_figure_layout(figsize: tuple[int, int]) tuple[matplotlib.figure.Figure, dict]

Create the figure layout for the visualisation. Two panels are created: the top one for the eigenfunction and the bottom one for the visualisation.

Parameters:

figsize (tuple[int, int]) – The size of the figure.

Returns:

  • fig (~matplotlib.figure.Figure) – The figure to use for the visualisation.

  • axes (dict) – The axes to use for the visualisation.

_create_cbar_axes(width: float) matplotlib.axes.Axes

Creates the axes for the colorbar.

Parameters:

width (float) – The width of the colorbar axes.

Returns:

The axes for the colorbar.

Return type:

matplotlib.axes.Axes

_validate_u2(u2: numpy.ndarray, *args, **kwargs) numpy.ndarray

Validates the combination of u2 and slicing axis.

Parameters:
  • u2 (float) – The u2 coordinate.

  • slicing_axis (str) – The slicing axis.

  • axis (str) – The coordinate axis corresponding to u2.

Returns:

The validated u2 coordinate.

Return type:

float

_validate_u3(u3: numpy.ndarray, *args, **kwargs) numpy.ndarray

Validates the combination of u3 and slicing axis.

Parameters:
  • u3 (float) – The u3 coordinate.

  • slicining_axis (str) – The slicing axis.

  • axis (str) – The coordinate axis corresponding to u3.

Returns:

The validated u3 coordinate.

Return type:

float

set_plot_arrays() None

Sets the arrays used for plotting. This should implement setting of u1_data, u2_data, u3_data, t_data and ef_data.

calculate_mode_solution(efdata: numpy.ndarray, u2: numpy.ndarray, u3: numpy.ndarray, t: numpy.ndarray) numpy.ndarray

Calculates the mode solution.

Parameters:
  • efdata (dict) – The data for the eigenfunction. This should be a dictionary with the keys 'ef' and 'omega', with 'ef'``containing the eigenfunction and ``'omega' the corresponding eigenvalue.

  • u2 (Union[float, np.ndarray]) – The data for the u2 coordinate.

  • u3 (Union[float, np.ndarray]) – The data for the u3 coordinate.

  • t (Union[float, np.ndarray]) – The data for the time.

Returns:

The mode solution.

Return type:

np.ndarray

draw_eigenfunction() None

Draws the eigenfunction(s) to the figure.

draw_solution() None
add_axes_labels() None
draw_textboxes() None
_clear_contours() None
_update_view(updated_solution: numpy.ndarray) None

Updates the axes with the new solution. If a contour plot is used, the contour lines are cleared and redrawn. If an image plot is used, the image is updated.

Parameters:

updated_solution (np.ndarray) – The new solution.

_update_view_clims(solution: numpy.ndarray) None
_set_t_txt(t)