pylbo.visualisation.modes.api
Module Contents
Functions
Plot the temporal evolution of a 1D eigenmode solution, i.e. |
|
|
Plot a 2D spatial view of the eigenmode solution, i.e. |
|
Plot a 3D spatial view of the eigenmode solution, i.e. |
|
Prepares for a VTK file export of the eigenmode solution in three dimensions. |
- pylbo.visualisation.modes.api.plot_1d_temporal_evolution(ds: pylbo.data_containers.LegolasDataSet, omega: complex | list[complex] | numpy.ndarray, ef_name: str, u2: float, u3: float, time: list | numpy.ndarray, figsize: tuple[int, int] = None, add_background: bool = False, use_real_part: bool = True, complex_factor: complex = None, show_ef_panel: bool = True, **kwargs) pylbo.visualisation.modes.temporal_1d.TemporalEvolutionPlot1D [source]
Plot the temporal evolution of a 1D eigenmode solution, i.e.
\(f(u_1, u_2, u_3, t) = f_1(u_1) \exp\left(ik_2u_2 + ik_3u_3 - i\omega t\right)\),
for a particular set of coordinates \((u_2, u_3)\) over a time interval.
- Parameters:
ds (LegolasDataSet) – The data set containing the eigenfunction.
omega (complex, list[complex], np.ndarray) – The (approximate) eigenvalue of the mode(s) to visualise.
ef_name (str) – The name of the eigenfunction to visualise.
u2 (float) – The y or \(\theta\) coordinate of the eigenmode solution.
u3 (float) – The z coordinate of the eigenmode solution.
time (list or np.ndarray) – The time interval to visualise.
add_background (bool) – Whether to add the equilibrium background to the plot.
use_real_part (bool) – Whether to use the real part of the eigenmode solution.
complex_factor (complex) – A complex factor to multiply the eigenmode solution with.
show_ef_panel (bool) – Whether to show the eigenfunction panel.
kwargs (dict) – Additional keyword arguments to pass to
imshow()
.
- Returns:
The plot object.
- Return type:
- pylbo.visualisation.modes.api.plot_2d_slice(ds: pylbo.data_containers.LegolasDataSet, omega: complex | list[complex] | numpy.ndarray, ef_name: str, u2: float | numpy.ndarray, u3: float | numpy.ndarray, time: float, slicing_axis: str, figsize: tuple[int, int] = None, add_background: bool = False, use_real_part: bool = True, complex_factor: complex = None, show_ef_panel: bool = True, polar: bool = False, **kwargs) pylbo.visualisation.modes.cartesian_2d.CartesianSlicePlot2D [source]
Plot a 2D spatial view of the eigenmode solution, i.e.
\(f(u_1, u_2, u_3, t) = f_1(u_1) \exp\left(ik_2u_2 + ik_3u_3 - i\omega t\right)\),
for a particular set of coordinates. If slicing_axis = ‘z’ then a 2D view is created for a given slicing point along the ‘z’-axis (hence a ‘xy’-view), for slicing_axis = ‘y’ a ‘xz’-view will be created. The given spatial coordinates u2 and u3 must be consistent with the slicing axis. For cylindrical geometries slices in both Cartesian and polar coordinates can be created.
- Parameters:
ds (LegolasDataSet) – The data set containing the eigenfunction.
omega (complex, list[complex], np.ndarray) – The (approximate) eigenvalue of the mode(s) to visualise.
ef_name (str) – The name of the eigenfunction to visualise.
u2 (float, np.ndarray) – The y or \(\theta\) coordinate of the eigenmode solution.
u3 (float, np.ndarray) – The z coordinate of the eigenmode solution.
time (float) – The time at which to visualise the eigenmode solution.
slicing_axis (str) – The axis to slice the 2D view along, either ‘z’, ‘y’ or ‘theta’
add_background (bool) – Whether to add the equilibrium background to the plot.
use_real_part (bool) – Whether to use the real part of the eigenmode solution.
complex_factor (complex) – A complex factor to multiply the eigenmode solution with.
show_ef_panel (bool) – Whether to show the eigenfunction panel.
polar (bool) – Whether to use polar coordinates for the 2D view. Only used if the dataset geometry is cylindrical. Default is False.
kwargs (dict) – Additional keyword arguments to pass to the plotting function.
- Returns:
p – The plot object.
- Return type:
- pylbo.visualisation.modes.api.plot_3d_slice(ds: pylbo.data_containers.LegolasDataSet, omega: complex | list[complex] | numpy.ndarray, ef_name: str, u2: float | numpy.ndarray, u3: float | numpy.ndarray, time: float, slicing_axis: str, figsize: tuple[int, int] = None, add_background: bool = False, use_real_part: bool = True, complex_factor: complex = None, **kwargs) pylbo.visualisation.modes.cartesian_3d.CartesianSlicePlot3D [source]
Plot a 3D spatial view of the eigenmode solution, i.e.
\(f(u_1, u_2, u_3, t) = f_1(u_1) \exp\left(ik_2u_2 + ik_3u_3 - i\omega t\right)\),
for a particular set of coordinates. Several 2D slices are superimposed on each other for every value of \(u_3\).
- Parameters:
ds (LegolasDataSet) – The data set containing the eigenfunction.
omega (complex, list[complex], np.ndarray) – The (approximate) eigenvalue of the mode(s) to visualise.
ef_name (str) – The name of the eigenfunction to visualise.
u2 (float, np.ndarray) – The y or \(\theta\) coordinate of the eigenmode solution.
u3 (float, np.ndarray) – The z coordinate of the eigenmode solution.
time (float) – The time at which to visualise the eigenmode solution.
slicing_axis (str) – The axis to slice the 2D view along, either ‘z’, ‘y’ or ‘theta’
add_background (bool) – Whether to add the equilibrium background to the plot.
use_real_part (bool) – Whether to use the real part of the eigenmode solution.
complex_factor (complex) – A complex factor to multiply the eigenmode solution with.
kwargs (dict) – Additional keyword arguments to pass to the plotting function.
- Returns:
p – The plot object.
- Return type:
- pylbo.visualisation.modes.api.prepare_vtk_export(ds: pylbo.data_containers.LegolasDataSet, omega: complex | list[complex] | numpy.ndarray, u2: numpy.ndarray, u3: numpy.ndarray, use_real_part: bool = True, complex_factor: complex = None) pylbo.visualisation.modes.vtk_export.VTKCartesianData | pylbo.visualisation.modes.vtk_export.VTKCylindricalData [source]
Prepares for a VTK file export of the eigenmode solution in three dimensions. Returns a
VTKDataCube3D
object which can be used to generate VTK files.- Parameters:
ds (LegolasDataSet) – The data set containing the eigenfunction.
omega (complex, list[complex], np.ndarray) – The (approximate) eigenvalue of the mode(s) to visualise.
u2 (np.ndarray) – The y or \(\theta\) coordinates of the eigenmode solution.
u3 (np.ndarray) – The z coordinates of the eigenmode solution.
use_real_part (bool) – Whether to use the real part of the eigenmode solution.
- Returns:
Object that can be used to generate VTK files.
- Return type: