reggae ====== .. py:module:: reggae Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/reggae/__main__/index /autoapi/reggae/asymptotic/index /autoapi/reggae/dipolestar/index /autoapi/reggae/psdmodel/index /autoapi/reggae/qtconsole/index /autoapi/reggae/reggae/index /autoapi/reggae/theta/index /autoapi/reggae/utils/index /autoapi/reggae/version/index Classes ------- .. autoapisummary:: reggae.DipoleStar Package Contents ---------------- .. py:class:: DipoleStar(s=None, f=None) Generalisation of pbjam.star to assist in determination of dipole mixed-mode parameters. .. py:attribute:: labels :value: ['$\\Delta\\Pi_0$ (relative)', '$L_0$', '$D_0$', '$\\epsilon_g$', '$\\log... .. py:attribute:: _extra_ndims :value: 1 .. py:attribute:: _psd_model .. py:attribute:: s :value: None .. py:attribute:: f :value: None .. py:method:: from_pbjam(star) :classmethod: 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. .. py:method:: __call__(dynamic=False, **kwargs) .. py:method:: summarise(sampler=None) .. py:method:: 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. .. py:method:: 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. .. py:method:: model(theta) Construct the model for the likelihood evaluation Parameters ---------- theta: jnp.array Array of model parameters. Returns ------- mod: jnp.array Spectrum model. .. py:method:: 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. .. py:method:: get_bounds() Set bounds for model parameter priors. Returns ------- bounds: list List of bounds. .. py:method:: 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. .. py:method:: _prepare_theta_asy(star) :staticmethod: 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. .. py:method:: make_pbjam_model(star, n_samples=50) :staticmethod: 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. .. py:method:: 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. .. py:method:: 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.