Quadratic model#
QuadraticModel implements the analytic transit model of
Mandel & Agol (ApJ 580, L171, 2002) for a star with quadratic limb darkening,
This is the classical transit model and the most widely used one in the field. Its value today is mostly that: it is thoroughly tested, and results computed with it are directly comparable to two decades of literature.
For new work, RoadRunner with the 'quadratic' law computes the same model
while leaving the door open to any other limb darkening law.
Usage#
from numpy import pi, linspace
from pytransit import QuadraticModel
time = linspace(-0.1, 0.1, 1000)
tm = QuadraticModel()
tm.set_data(time)
flux = tm.evaluate(k=0.1, ldc=[0.2, 0.1], t0=0.0, p=1.0, a=3.0, i=0.5*pi)
Interpolation#
The analytic solution involves elliptic integrals, which are expensive. interpolate=True
switches to the interpolation scheme of Parviainen (MNRAS 450, 3233, 2015): the model is
precomputed on a grid of radius ratios and projected distances and interpolated at evaluation time.
tm = QuadraticModel(interpolate=True, klims=(0.05, 0.15), nk=512, nz=512)
Warning
The interpolated model is only defined inside klims. Evaluating it with a radius ratio outside the range the table was built for gives a wrong answer rather than an error, so set klims from the priors of your fit, with margin.
nk and nz set the radius ratio and distance grid sizes. Larger grids are more accurate and cost more memory and initialisation time.
Converting to OpenCL#
to_opencl() returns a QuadraticModelCL with the same
klims and the current data setup already applied. See The OpenCL backend for the caveats,
particularly the single-precision one.
Examples#
API#
- class pytransit.models.ma_quadratic.QuadraticModel(interpolate=False, klims=(0.01, 0.5), nk=256, nz=256)[source]#
Bases:
TransitModelTransit model with quadratic limb darkening (Mandel & Agol, ApJ 580, L171-L175 2002).
- __init__(interpolate=False, klims=(0.01, 0.5), nk=256, nz=256)[source]#
Transit model with quadratic limb darkening (Mandel & Agol, ApJ 580, L171-L175 2002).
- Parameters:
interpolate (bool, optional) – Use the interpolation method presented in Parviainen (2015) if true.
klims (tuple, optional) – Radius ratio limits (kmin, kmax) for the interpolated model.
nk (int, optional) – Radius ratio grid size for the interpolated model.
nz (int, optional) – Normalized distance grid size for the interpolated model.
- evaluate(k, ldc, t0, p, a, i, e=None, w=None, copy=True)[source]#
Evaluate the transit model for a set of scalar or vector parameters.
- Parameters:
k – Radius ratio(s) either as a single float, 1D vector, or 2D array.
ldc – Limb darkening coefficients as a 1D or 2D array.
t0 – Transit center(s) as a float or a 1D vector.
p – Orbital period(s) as a float or a 1D vector.
a – Orbital semi-major axis (axes) divided by the stellar radius as a float or a 1D vector.
i – Orbital inclination(s) as a float or a 1D vector.
e (optional) – Orbital eccentricity as a float or a 1D vector.
w (optional) – Argument of periastron as a float or a 1D vector.
Notes
The model can be evaluated either for one set of parameters or for many sets of parameters simultaneously. In the first case, the orbital parameters should all be given as floats. In the second case, the orbital parameters should be given as a 1D array-like.
- Returns:
ndarray – Modelled flux either as a 1D or 2D ndarray.