pylbo.visualisation.modes.mode_data
Classes
Class that contains the data used for eigenmode visualisations. |
Functions
|
|
|
Check if all datasets in the dataseries have the same grid. |
Module Contents
- pylbo.visualisation.modes.mode_data._handle_expected_input_value(ds: pylbo.data_containers.LegolasDataSeries, value) list[list[complex]]
- pylbo.visualisation.modes.mode_data._check_grid_dataseries(ds: pylbo.data_containers.LegolasDataSeries) bool
Check if all datasets in the dataseries have the same grid.
- Parameters:
ds (LegolasDataSeries) – The dataseries to check.
- Returns:
True if all datasets have the same grid, False otherwise.
- Return type:
- class pylbo.visualisation.modes.mode_data.ModeVisualisationData(ds: pylbo.data_containers.LegolasDataSet | pylbo.data_containers.LegolasDataSeries, omega: complex | list[complex] | numpy.ndarray | list[list[complex]] | list[numpy.ndarray], ef_name: str = None, use_real_part: bool = True, complex_factor: complex | list[complex] | numpy.ndarray | list[list[complex]] | list[numpy.ndarray] = None, add_background: bool = False)
Class that contains the data used for eigenmode visualisations.
- Parameters:
ds (LegolasDataSet/LegolasDataSeries) – The data set/series containing the eigenfunctions, having the same equilibria.
omega (list[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 (list[list[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 dataseries containing the eigenfunctions and modes to visualise.
- Type:
- complex_factor
The complex factors to multiply the eigenmode solution with.
- ds
- complex_factor = None
- ds_bg
- use_real_part = True
- 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’.
- _validate_complex_factor(complex_factor: list[list[complex]]) list[list[complex]]
Validates the complex factors.
- get_mode_solution(ef: numpy.ndarray, omega: complex, complex_factor: complex, u2: float | numpy.ndarray, u3: float | numpy.ndarray, t: float | numpy.ndarray, k2: float, k3: float) 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.
complex_factor (complex,) – The complex factor to multiply with.
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.
k2 (float) – The x2 wavenumber of the mode.
k3 (float) – The x3 wavenumber of the mode.
- 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 or derived eigenfunction that is not the magnetic field.