StellarOscillatorKernel
StellarOscillatorKernel#
- class gadfly.StellarOscillatorKernel(hyperparameters=None, texp=None, delta=None, name=None, terms=None)[source]#
Bases:
celerite2.terms.TermConvolution
A sum of
SHOTerm
simple harmonic oscillator kernels generated by gadfly to approximate the total solar irradiance power spectrum.StellarOscillatorKernel
inherits fromTermConvolution
.- Parameters
hyperparameters (Hyperparameters) – Iterable of hyperparameters, each passed to the
SHOTerm
constructor.name (str) – Name for this set of hyperparameters
texp (Quantity) – Exposure time, convertible to inverse microhertz.
delta (float (optional)) – Exposure time, in units of inverse microhertz.
terms (list) – Kernel terms to add together. This argument is intended only for internal use.
Attributes Summary
Methods Summary
dot
(x, diag, y)Apply a matrix-vector or matrix-matrix product
get_celerite_matrices
(x, diag, *[, c, a, U, V])Get the matrices needed to solve the celerite system
Compute and return the coefficients for the celerite model
get_psd
(omega)Compute the value of the power spectral density for this process
get_value
(tau0)Compute the value of the kernel as a function of lag
plot
(**kwargs)Plot a power spectrum.
to_dense
(x, diag)Evaluate the dense covariance matrix for this term
Attributes Documentation
- terms#
Methods Documentation
- dot(x, diag, y)#
Apply a matrix-vector or matrix-matrix product
- Parameters
x (shape[N]) – The independent coordinates of the data.
diag (shape[N]) – The diagonal variance of the system.
y (shape[N] or shape[N, K]) – The target of vector or matrix for this operation.
- get_celerite_matrices(x, diag, *, c=None, a=None, U=None, V=None)#
Get the matrices needed to solve the celerite system
Pre-allocated arrays can be provided to the Python interface to be re-used for multiple evaluations.
Note
In-place operations are not supported by the modeling extensions.
- Parameters
x (shape[N]) – The independent coordinates of the data.
diag (shape[N]) – The diagonal variance of the system.
a (shape[N], optional) – The diagonal of the A matrix.
U (shape[N, J], optional) – The first low-rank matrix.
V (shape[N, J], optional) – The second low-rank matrix.
P (shape[N-1, J], optional) – The regularization matrix used for numerical stability.
- Raises
ValueError – When the inputs are not valid.
- get_coefficients()#
Compute and return the coefficients for the celerite model
This should return a 6 element tuple with the following entries:
(ar, cr, ac, bc, cc, dc)
Note
All of the returned objects must be arrays, even if they only have one element.
- get_psd(omega)#
Compute the value of the power spectral density for this process
- Parameters
omega (shape[...]) – The (angular) frequencies where the power should be evaluated.
- get_value(tau0)#
Compute the value of the kernel as a function of lag
- Parameters
tau (shape[...]) – The lags where the kernel should be evaluated.
- plot(**kwargs)[source]#
Plot a power spectrum.
Requires
matplotlib
.- Parameters
ax (
Axes
) –kernel (None or subclass of
Term
) –obs (PowerSpectrum) –
freq (Quantity) –
figsize (list of floats) –
n_samples (int) –
p_mode_inset (bool) –
legend (bool) –
scaling_low_freq (str) –
scaling_p_mode (str) –
inset_xlim (list of floats) –
inset_ylim (list of floats) –
title (str) –
label_inset (str) –
label_obs (str) –
label_kernel (str) –
kernel_kwargs (dict) –
obs_kwargs (dict) –
inset_kwargs (dict) –
create_new_figure (bool) –
inset_bounds (list) –
- Returns
- to_dense(x, diag)#
Evaluate the dense covariance matrix for this term
- Parameters
x (shape[N]) – The independent coordinates of the data.
diag (shape[N]) – The diagonal variance of the system.