API#
Prior functions#
- class lightspot.priors.ConstrainPvec(pmin=0, pmax=50, sinimin=0, sinimax=1, vmin=1e-09, vmax=1000000000.0, rmin=1e-09, rmax=1000000000.0, **kwargs)#
Bases:
Prior
Modeler classes#
- class lightspot.sampler.AbstractModel(defaults, t, y, dy=None, priors=None)#
Bases:
object- _latexify(name, i=None)#
- _post_processing(results)#
- _validate_params(priors)#
- chi(theta)#
Chi squared of parameters given a set of observations
- Parameters:
theta (array-like with shape (jmax,)) – Full parameter vector (physical units).
- Returns:
sse – Sum of squared errors weighted by observation uncertainties.
- Return type:
- loglike(theta)#
- mcmc(n_walkers, n_steps, burn, use_prior=True)#
- minimize()#
- nested_sample(resume=True, log_dir=None, n_slice=0, popsize=0, **kwargs)#
- plot_fit(t_grid, color='k')#
- predict(t, theta)#
Base method to be overridden by the actual model. Should be vectorized, i.e., return a 2d ndarray with shape (theta.shape[0], t.size)
- prior_transform(cube)#
- reduced_chi(theta)#
- run(nlive=1000, cores=None, filename=None, seed=42, **kwargs)#
- class lightspot.sampler.SimpleSpotModel(t, y, nspots, dy=None, priors=None)#
Bases:
AbstractModel- chi(theta)#
Chi squared of parameters given a set of observations
- Parameters:
theta (array-like with shape (jmax,)) – Full parameter vector (physical units).
- Returns:
sse – Sum of squared errors weighted by observation uncertainties.
- Return type:
- eff_var(theta)#
- loglike(theta)#
- predict(t, theta)#
Base method to be overridden by the actual model. Should be vectorized, i.e., return a 2d ndarray with shape (theta.shape[0], t.size)
- class lightspot.sampler.SpotModel(t, y, nspots, dy=None, priors=None, tstart=None, tend=None)#
Bases:
AbstractModel- chi(theta)#
Chi squared of parameters given a set of observations
- Parameters:
theta (array-like with shape (jmax,)) – Full parameter vector (physical units).
- Returns:
sse – Sum of squared errors weighted by observation uncertainties.
- Return type:
- eff_var(theta)#
- loglike(theta)#
- predict(t, theta)#
Calculates the model flux for given parameter values
- Parameters:
t (array-like with shape (ndata,)) – time samples where the flux function should be evaluated
theta (array-like with shape (jmax,)) – full parameter vector (physical units)
- Returns:
yf – model flux
- Return type:
array-like with shape (ndata,)