API

Prior functions

class lightspot.priors.Dirac(x0)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.LogNormal(logmu=0.0, logsd=1.0, ndim=1)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.LogUniform(logxmin=0.0, logxmax=1.0, ndim=1)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.Normal(mu=0.0, sd=1.0, ndim=1)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.Polygon(poly)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.Prior

Bases: object

sample(*args)
class lightspot.priors.Quadratic(amin=0.0, amax=2.0, bmin=- 1.0, bmax=1.0)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.SameAs(prior)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.SineUniform(sinxmin=0.0, sinxmax=1.0, ndim=1)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.ThreeParam

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.Triangular(triangle)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.TruncNormal(mu=0.0, sd=1.0, xmin=0.0, xmax=1.0, ndim=1)

Bases: lightspot.priors.Prior

sample(*args)
class lightspot.priors.Uniform(xmin=0.0, xmax=1.0, ndim=1)

Bases: lightspot.priors.Prior

sample(*args)
lightspot.priors.constrain_Pvec(Pmin=0, Pmax=50, sinimin=0, sinimax=1, vmin=1e-09, vmax=1000000000.0, rmin=1e-09, rmax=1000000000.0)

Modeler classes

class lightspot.model.SpotModel(t, y, nspots, dy=None, use_gpu=False, Pvec=None, k2=None, k4=None, c=None, d=None, same_limb=False, lon=None, lat=None, alpha=None, fspot=None, tmax=None, life=None, ingress=None, egress=None, U=None, B=None, tstart=None, tend=None)

Bases: object

Modeler class

t
Type

time array

y
Type

flux array

nspots
Type

number of spots

dy
Type

flux uncertainties (optional)

Pvec
Type

2-D array containing rotation period at equator and stellar inclination

k2
Type

2nd-order differential rotation coefficient

k4
Type

4th-order differential rotation coefficient

c
Type

stellar limb-darkening coefficients

d
Type

spot limb-darkening coefficients

same_limb
Type

whether to always assume c==d in the model

lon
Type

spot longitudes (rad)

lat
Type

spot latitudes (rad)

alpha
Type

spot radius (rad)

fspot
Type

spot-to-photosphere intensity ratio

tmax
Type

time of greatest spot area

life
Type

spot lifetimes

ingress
Type

spot ingress times

egress
Type

spot egress times

U
Type

unspotted surface flux value

B
Type

instrumental blending factor

tstart
Type

start time for each of the stitched curves

tend
Type

end time for each of the stitched curves

chi(theta)

Chi squared of parameters given a set of observations

Parameters

theta (array-like with shape (N,)) – full parameter vector (physical units)

Returns

sse – sum of squared errors weighted by observation uncertainties

Return type

float

property inst_pars
loglike(x)
multinest(sampling_efficiency=0.01, const_efficiency_mode=True, n_live_points=4000, **kwargs)
property parameters
predict(t, theta)

Calculates the model flux for given parameter values

Parameters
  • t (array-like with shape (n,)) – time samples where the flux function should be evaluated

  • theta (array-like with shape (N,)) – full parameter vector (physical units)

Returns

yf – model flux

Return type

array-like with shape (n,)

reduced_chi(theta)
run(nlive=1000, cores=None, filename=None, **kwargs)
sample(x)
property spot_pars
property star_pars