persephone.kernels#
The kernels submodule provides a set of function dedicated to compute
1- and 2D seismic kernels.
persephone.kernels.rotation#
- persephone.kernels.rotation.compute_general_kernel(r, rho, xi_r, xi_h, l=1, m=1, theta_res=90, unimodular=True, theta_0=0, theta_1=180)#
Compute general 2D kernel term after Christensen-Dalsgaard’s Lecture Notes on Stellar Oscillations Eq. (8.31), (8.33), and (8.35).
Note that by default the kernel is normalised to be unimodular.
- Parameters:
r (ndarray) – Radial coordinates of the eigenfunctions.
rho (ndarray) – Radial density profile.
xi_r (ndarray) – Mode radial eigenfuction.
xi_h (ndarray) – Mode horizontal eigenfuction.
l (int) – Mode spherical degree. Optional, default
1.m (int) – Mode azimuthal degree. Optional, default
1.theta_res (int) – Number of grid point in the latitudinal direction.
unimodular (bool) – Whether to compute a unimodular kernel or not. Optional, default
True.theta_0 (float) – Minimal co-latitude on which to compute the kernel.
theta_1 (float) – Maximal co-latitude on which to compute the kernel.
- Returns:
A tuple of arrays with the 2D-radial grid coordinates,
r, the 2D-latitudinal grid coordinates,theta, thebeta_nlmcoefficient and the 2D-kernel,K_nlm.- Return type:
tuple
- persephone.kernels.rotation.compute_shellular_kernel(r, rho, xi_r, xi_h, l=1)#
Compute beta_nl and K_nl 1D shellular kernels terms after Christensen-Dalsgaard’s Lecture Notes on Stellar Oscillations Eq. (8.42) and Eq. (8.43).
- Parameters:
r (ndarray) – Radial coordinates of the eigenfunctions.
rho (ndarray) – Radial density profile.
xi_r (ndarray) – Mode radial eigenfuction.
xi_h (ndarray) – Mode horizontal eigenfuction.
l (int) – Mode spherical degree. Optional, default
1.
- Returns:
A tuple of arrays with the``beta_nl`` coefficient and the shellular kernel,
K_nl.- Return type:
tuple
- persephone.kernels.rotation.compute_splittings(r, theta, K_nlm, Omega, beta_nlm, m=1)#
Compute rotational splittings in the general perturbative case, after Christensen-Dalsgaard’s Lecture Notes on Stellar Oscillations Eq. (8.35).
- Parameters:
r (ndarray) – Radial coordinates.
K_nlm (ndarray) – 2D radial/latitudinal kernel.
Omega (ndarray) – 2D radial/latitudinal rotation profile.
beta_nlm (ndarray) – Prefactor.
m (int) – Azimuthal number. Optional, default
1.
- Returns:
The rotational splitting.
- Return type:
float
- persephone.kernels.rotation.compute_shellular_splittings(r, K_nl, Omega, beta_nl, m=1)#
Compute rotational splittings in the case of a shellular perturbative rotation, after Christensen-Dalsgaard’s Lecture Notes on Stellar Oscillations Eq. (8.41).
- Parameters:
r (ndarray) – Radial coordinates.
K_nl (ndarray) – Radial kernel.
Omega (ndarray) – Radial rotation profile.
beta_nl (ndarray) – Prefactor.
m (int) – Azimuthal number. Optional, default
1.
- Returns:
The shellular rotational splitting.
- Return type:
float
- persephone.kernels.rotation.plot_2D_kernel(r, theta, K_nlm, cmap='cividis', figsize=(3, 6), levels=None, contour_colors='black', contour_ls='--', contour_lw=1, vmin=None, vmax=None, shading='nearest', colorbar=False, colorbar_label=None, title=None, add_contour=True, contourf_plot=False, surrounding_lines=True)#
Plot 2D kernel.
- Parameters:
r (ndarrray) – 2D grid with radial coordinates.
theta (ndarrray) – 2D grid with latitudinal coordinates.
K_nlm (ndarray) – 2D radial/latitudinal kernel.
cmap (str or Colormap instance) – Color map to use for the kernel. Optional, default
cividis.figsize (tuple) – Figure size. Optional, default
(3,6).levels (array-like) – Contour levels. Optional, default
None.contour_colors (str or Color instance) – Contour color. Optional, default
black.contour_ls (str) – Contour linestyle. Optional, default
"--".contour_lw (str) – Contour linewidth. Optional, default
1.vmin (float) – Minimal value for the colormap. Optional, default
None.vmax (float) – Maximal value for the colormap. Optional, default
None.shading (str) – Shading type. Optional, default
nearest.colorbar (bool) – Whether to show the colorbar or not. Optional, default
False.colorbar_label (str) – Color bar label. Optional, default
None.title (str) – The axes title. Optional, default
None.add_contour (bool) – If set to
True, add contours on the plot. Optional, defaultTrue.contourf_plot (bool.) – If set to
True, produce a contour-filled plot. Optional, defaultFalse.surrounding_lines (bool) – If set to
True, add surrounding lines to the plot. Optional, defaultTrue.
- Returns:
The generated figure.
- Return type:
matplotlib.pyplot.figure
- persephone.kernels.rotation.plot_shellular_kernel(r, K_nl, figsize=(6, 6), xlabel=None, ylabel=None, title=None, **kwargs)#
Plot shellular kernel.
- Parameters:
r (ndarray) – Radial coordinates.
K_nl (ndarray) – Radial kernel.
figsize (tuple) – Figure size. Optional, default
(6,6).xlabel (str) – x-axis label. Optional, default
None.ylabel (str) – y-axis label. Optional, default
None.title (str) – The axes title. Optional, default
None.
- Returns:
The generated figure.
- Return type:
matplotlib.pyplot.figure