pylbo.visualisation.continua
Module Contents
Classes
Handler to draw continua regions on the plots and make them interactive. |
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
Calculates the different continua for a given dataset. |
|
Calculates the squared Alfvén continuum. |
|
Calculates the Doppler shift as the dot product between the wave vector and the |
|
Calculates the squared slow continuum. |
|
Calculates the thermal and slow continua. |
|
Calculates the thermal continuum analytically, when the slow continuum is zero. |
Solves the third-order polynomial that couples the slow and thermal continua. |
|
|
|
|
|
Attributes
- pylbo.visualisation.continua.CONTINUA_COLORS = ['red', 'red', 'cyan', 'cyan', 'green', 'grey'][source]
- pylbo.visualisation.continua._is_zero(values: numpy.ndarray, zero_tol: float = _DEFAULT_ZERO_TOL) bool [source]
- pylbo.visualisation.continua._is_nonadiabatic(ds: pylbo.data_containers.LegolasDataSet) bool [source]
- pylbo.visualisation.continua._get_parallel_wave_vector(ds: pylbo.data_containers.LegolasDataSet) float [source]
- pylbo.visualisation.continua._get_squared_sound_speed(ds: pylbo.data_containers.LegolasDataSet) numpy.ndarray [source]
- pylbo.visualisation.continua._get_squared_isothermal_sound_speed(ds: pylbo.data_containers.LegolasDataSet) numpy.ndarray [source]
- pylbo.visualisation.continua._get_squared_Alfven_speed(ds: pylbo.data_containers.LegolasDataSet) numpy.ndarray [source]
- pylbo.visualisation.continua.calculate_continua(ds: pylbo.data_containers.LegolasDataSet) dict [source]
Calculates the different continua for a given dataset. The Alfvén and flow continua are always analytical. Depending on the background and physical effects the slow and thermal continua are either all analytical, or coupled through a third-order polynomial. In case of the latter this polynomical is numerically solved through numpy.roots.
- Parameters:
ds (LegolasDataSet) – The Legolas dataset.
- Returns:
Dictionary containing the various continua. The keys are the names of the continua, the values are the corresponding frequencies as numpy arrays. Returns None if the dataset has no background.
- Return type:
dict, None
- pylbo.visualisation.continua.get_squared_alfven_continuum(ds: pylbo.data_containers.LegolasDataSet) numpy.ndarray [source]
Calculates the squared Alfvén continuum.
- Returns:
The squared Alfvén continuum.
- Return type:
np.ndarray
- pylbo.visualisation.continua.get_doppler_shift(ds: pylbo.data_containers.LegolasDataSet) numpy.ndarray [source]
Calculates the Doppler shift as the dot product between the wave vector and the background velocity.
- Returns:
The Doppler shift.
- Return type:
np.ndarray
- pylbo.visualisation.continua.get_squared_slow_continuum(ds: pylbo.data_containers.LegolasDataSet) numpy.ndarray [source]
Calculates the squared slow continuum.
- Returns:
The squared slow continuum.
- Return type:
np.ndarray
- pylbo.visualisation.continua._get_thermal_and_slow_continua(ds: pylbo.data_containers.LegolasDataSet) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray] [source]
Calculates the thermal and slow continua.
- Returns:
A tuple containing the slow-, slow+ and thermal continua, in this order.
- Return type:
Tuple[np.ndarray, np.ndarray, np.ndarray]
- pylbo.visualisation.continua._get_thermal_continuum_analytical(ds: pylbo.data_containers.LegolasDataSet) numpy.ndarray [source]
Calculates the thermal continuum analytically, when the slow continuum is zero.
- Returns:
The thermal continuum.
- Return type:
np.ndarray
- pylbo.visualisation.continua._get_slow_and_thermal_continuum_coupled(ds: pylbo.data_containers.LegolasDataSet) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray] [source]
- pylbo.visualisation.continua._solve_coupled_continuum_polynomial(coeff3: numpy.ndarray, coeff2: numpy.ndarray, coeff1: numpy.ndarray, coeff0: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray] [source]
Solves the third-order polynomial that couples the slow and thermal continua. The thermal continuum corresponds to the purely imaginary solution.
- Parameters:
coeff3 (np.ndarray) – The coefficient corresponding to the term \(\omega^3\).
coeff2 (np.ndarray) – The coefficient corresponding to the term \(\omega^2\).
coeff1 (np.ndarray) – The coefficient corresponding to the term \(\omega^1\).
coeff0 (np.ndarray) – The coefficient corresponding to the constant term.
- Returns:
A tuple containing the slow-, slow+ and thermal continua, in this order.
- Return type:
Tuple[np.ndarray, np.ndarray, np.ndarray]
- pylbo.visualisation.continua._extract_solutions_from_roots(roots: numpy.ndarray, i: int = 0)[source]
- pylbo.visualisation.continua._log_slow_continuum_zero_warning(roots: numpy.ndarray, i: int)[source]
- class pylbo.visualisation.continua.ContinuaHandler(interactive)[source]
Bases:
pylbo.visualisation.legend_handler.LegendHandler
Handler to draw continua regions on the plots and make them interactive.
- Parameters:
interactive (bool) – If True, makes the legend pickable and continuum plotting interactive.