reggae

Submodules

Classes

DipoleStar

Generalisation of pbjam.star to assist in determination of dipole mixed-mode

Package Contents

class reggae.DipoleStar(s=None, f=None)

Generalisation of pbjam.star to assist in determination of dipole mixed-mode parameters.

labels = ['$\\Delta\\Pi_0$ (relative)', '$L_0$', '$D_0$', '$\\epsilon_g$', '$\\log...
_extra_ndims = 1
_psd_model
s = None
f = None
classmethod from_pbjam(star)

Import and prepare results from PBjam

Takes instances of the either the pbjam.star or pbjam.modeID.modeIDsampler classes and constructs a residual spectrum, by dividing out the l=2,0 (including the background) or just the background respectively.

Parameters

klass: self

reggae.DipoleStar class self.

star: object

Instance of pbjam.star or pbjam.modeID.modeIDsampler classes.

__call__(dynamic=False, **kwargs)
summarise(sampler=None)
ptform(u)

Turns coordinates on the unit cube into θ_reg object

Parameters

u: list

Point location in the unit hypercube.

Returns

x: jnp.array

Point location in model parameter space.

inv_ptform(θ_reg, norm)

Turns θ_reg object into coordinates on the unit cube

Parameters

θ_reg: ThetaReg object or array-like

Point location in model parameters space.

norm: jnp.array

Normalisation

Returns: jnp.array

Point location in the unit hypercube.

model(theta)

Construct the model for the likelihood evaluation

Parameters

theta: jnp.array

Array of model parameters.

Returns

mod: jnp.array

Spectrum model.

ln_like(theta)

Evaluate the model log-likelihood at theta

The log-likelihood is the joint probability of observing the spectrum given the model.

Parameters

theta: jnp.array

Array of model parameters

Returns

lnlike: float

log-likelihood at theta.

get_bounds()

Set bounds for model parameter priors.

Returns

bounds: list

List of bounds.

select_n_g()

Select the relevant radial g-mode orders

Based on prior estimates of the relevant range period spacing and eps_g, computes g-modes that significantly overlap with the envelope.

These will be used to compute the model.

Returns

n_g: jnp.array

List of radial orders for the g-modes.

static _prepare_theta_asy(star)

Get parameters for asymptotic l=2,0+background model.

Parameters

star: object

Either a pbjam.star or pbjam.modeID.modeIDsampler class instance.

Returns

nu_0: jnp.array

l=0 mode frequencies.

nu_2: jnp.array

l=2 mode frequencies.

ThetaAsy: object

ThetaAsy class instance, containing l=2,0 and background model parameters.

static make_pbjam_model(star, n_samples=50)

Construct a spectrum model from PBjam output

Takes either a pbjam.star or pbjam.modeID.modeIDsampler object from a previous PBjam run. This is used to construct a residual spectrum.

In the case of a pbjam.star object being passed, a set of models are drawn and averaged.

Parameters

star: object

Either a pbjam.star or pbjam.modeID.modeIDsampler object.

n_samples: int, optional

Number of samples to use to construct the mean model. Default is 50.

Returns

mod: jnp.array

Spectrum model.

simplex(theta_reg, norm, **kwargs)

Find maximum log-likelihood using Nelder-Mead downhill simplex minimization.

Parameters

theta_reg: dataclass

A ThetaReg dataclass instance

norm: jnp.array

An initial point in model parameter space.

genetic_algorithm(solve_kwargs=None, **kwargs)

Find the maximum likelihood using a genetic algorithm.

Any keyword arguments are passed to the yabox.DE initializatoin.

solve_kwarg: dict, optional

Dictionary of argumentts to pass to the yabox.DE.solve method.