General model#
GeneralModel implements the transit model of Giménez
(A&A 450, 1231, 2006), with the optimisations of Parviainen (MNRAS 450, 3233, 2015), for the
general limb darkening law
The law can be made arbitrarily flexible by adding coefficients, which is why it is called general: the linear, quadratic, and higher-order polynomial laws are all special cases.
The model is evaluated as a series of Jacobi polynomials. The number of polynomials npol sets the accuracy of the transit model and costs computation time directly; the number of limb darkening coefficients nldc sets the flexibility of the limb darkening and costs almost nothing.
Note
The four-coefficient non-linear law of Mandel & Agol (2002) is not implemented separately in PyTransit, because the Giménez law offers the same functionality with arbitrary flexibility.
Tip
RoadRunner supports the general law through its 'general' limb darkening
model and is both faster and more flexible. For new work, prefer it.
Usage#
from numpy import pi, linspace
from pytransit import GeneralModel
time = linspace(-0.1, 0.1, 1000)
tm = GeneralModel(npol=50, nldc=2)
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)
Transmission spectroscopy mode#
mode=1 enables a special evaluation mode that accelerates the model considerably when many
passbands share a single transit geometry, as in transmission spectroscopy.
tm = GeneralModel(npol=50, nldc=2, mode=1)
For new transmission spectroscopy work, TransmissionSpectroscopyModel is the better choice.
API#
- class pytransit.models.general.GeneralModel(npol=50, nldc=2, mode=0)[source]#
Bases:
TransitModelTransit model with general limb darkening (Giménez, A&A 450, 1231–1237, 2006).
Transit model with general limb darkening (Giménez, A&A 450, 1231–1237, 2006) with optimizations described in Parviainen (MNRAS 450, 3233–3238, 2015).
The general limb darkening law is
\[I(\mu) = I(1) \left(1 - \sum_{n=1}^N u_n(1-\mu^n)\right)\]and the model is evaluated as a series of Jacobi polynomials. The number of polynomials npol sets the accuracy of the transit model, while the number of limb darkening coefficients nldc sets the flexibility of the limb darkening law. Increasing nldc costs little, but increasing npol costs computation time directly.
Notes
The four-coefficient non-linear law of Mandel & Agol (2002) is not implemented separately in PyTransit because the Giménez law offers the same functionality with arbitrary flexibility. For new work,
RoadRunnerModelis generally the better choice: it supports the general law among many others and is faster to evaluate.- __init__(npol=50, nldc=2, mode=0)[source]#
- Parameters:
npol (int, optional) – Number of Jacobi polynomials used in the series expansion. Higher values give a more accurate transit model at a directly proportional computational cost.
nldc (int, optional) – Number of limb darkening coefficients the model expects. Increasing this does not significantly increase the evaluation time.
mode (int, optional) – Evaluation mode: 0 for normal evaluation, 1 for the transmission spectroscopy mode that accelerates the evaluation when many passbands share a single transit geometry.
- Raises:
ValueError – If npol is not positive, nldc is not positive, or mode is not 0 or 1.
- 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.