pylbo.visualisation.modes.mode_data

Classes

ModeVisualisationData

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:

LegolasDataSet

omega

The (approximate) eigenvalue(s) of the mode(s) to visualise.

Type:

list[complex]

eigenfunction

The eigenfunction of the mode(s) to visualise.

Type:

list[np.ndarray]

use_real_part

Whether to use the real part of the eigenmode solution.

Type:

bool

complex_factor

The complex factor to multiply the eigenmode solution with.

Type:

complex

add_background

Whether to add the equilibrium background to the eigenmode solution.

Type:

bool

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 k2: float

The k2 wave number of the eigenmode solution.

property k3: float

The k3 wave number of the eigenmode solution.

property part_name: str

Returns the name of the part of the eigenmode solution to use, i.e. ‘real’ or ‘imag’.

get_ef_name_latex() str

Returns the latex representation of the eigenfunction name.

_validate_complex_factor(complex_factor: complex) complex

Validates the complex factor.

Parameters:

complex_factor (complex) – The complex factor to validate.

Returns:

The complex factor if it is valid, otherwise 1.

Return type:

complex

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:
  • shape (tuple[int, ...]) – The shape of the eigenmode solution.

  • name (str) – The name of the background to use. If None, the background name will be inferred from the eigenfunction name.

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:

str

Raises:

ValueError – If the eigenfunction name is a magnetic vector potential component.