pylbo.visualisation.modes.mode_data
Classes
Class that contains the data used for eigenmode visualisations. |
Module Contents
- class pylbo.visualisation.modes.mode_data.ModeVisualisationData(ds: pylbo.data_containers.LegolasDataSet, omega: list[complex], ef_name: str = None, use_real_part: bool = True, complex_factor: complex = None, add_background: bool = False)
Class that contains the data used for eigenmode visualisations.
- Parameters:
ds (LegolasDataSet) – The dataset containing the eigenfunctions and modes to visualise.
omega (list[complex]) – The (approximate) eigenvalue(s) of the mode(s) to visualise.
ef_name (str) – The name of the eigenfunction to visualise.
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.
add_background (bool) – Whether to add the equilibrium background to the eigenmode solution.
- ds
The dataset containing the eigenfunctions and modes to visualise.
- Type:
- ds
- use_real_part = True
- complex_factor = None
- add_background = False
- _print_bg_info = True
- _ef_name = None
- _ef_name_latex = None
- _all_efs
- omega
- eigenfunction
- property part_name: str
Returns the name of the part of the eigenmode solution to use, i.e. ‘real’ or ‘imag’.
- get_mode_solution(ef: numpy.ndarray, omega: complex, u2: float | numpy.ndarray, u3: float | numpy.ndarray, t: float | numpy.ndarray) numpy.ndarray
Calculates the full eigenmode solution for given coordinates and time. If a complex factor was given, the eigenmode solution is multiplied with the complex factor. If
use_real_part
is True the real part of the eigenmode solution is returned, otherwise the complex part.- Parameters:
ef (np.ndarray) – The eigenfunction to use.
omega (complex) – The eigenvalue to use.
u2 (Union[float, np.ndarray]) – The y coordinate(s) of the eigenmode solution.
u3 (Union[float, np.ndarray]) – The z coordinate(s) of the eigenmode solution.
t (Union[float, np.ndarray]) – The time(s) of the eigenmode solution.
- Returns:
The real or imaginary part of the eigenmode solution for the given set of coordinate(s) and time(s).
- Return type:
np.ndarray
- get_background(shape: tuple[int, Ellipsis], name=None) numpy.ndarray
Returns the background of the eigenmode solution.
- Parameters:
- Returns:
The background of the eigenmode solution, sampled on the eigenfunction grid and broadcasted to the same shape as the eigenmode solution.
- Return type:
np.ndarray
- _sample_background_on_ef_grid(bg: numpy.ndarray) numpy.ndarray
Samples the background array on the eigenfunction grid.
- Parameters:
bg (np.ndarray) – The background array with Gaussian grid spacing
- Returns:
The background array with eigenfunction grid spacing
- Return type:
np.ndarray
- _get_background_name() str
Returns the name of the background.
- Returns:
The closest match between the eigenfunction name and the equilibrium name.
- Return type:
- Raises:
ValueError – If the eigenfunction name is a magnetic vector potential component.