TransitModel#
The base class every PyTransit transit model derives from. It implements set_data, which is therefore shared by all the models, and declares the evaluate interface the subclasses implement.
See The transit model interface and Data setup for the narrative description.
- class pytransit.models.transitmodel.TransitModel[source]#
Bases:
objectBase class for the PyTransit exoplanet transit light curve models.
TransitModel defines the data-setup half of the interface that every PyTransit transit model shares, and declares the evaluation half that the subclasses implement. Using any model follows the same three steps
create the model, giving it any model-specific settings,
call set_data to tell the model when the observations were made, and
call evaluate to compute the fluxes for a set of physical parameters.
The data setup is separated from the evaluation because the observation times change rarely while the parameters change constantly. Everything that can be precomputed from the times alone – index arrays, supersampling offsets, and so on – is computed once in set_data and reused by every subsequent evaluate call. This is what makes the models efficient inside an optimiser or a sampler.
- Variables:
time (ndarray) – Mid-exposure times, set by set_data.
lcids (ndarray) – Light curve index for each exposure, one per element of time.
pbids (ndarray) – Passband index for each light curve, one per light curve.
epids (ndarray) – Epoch index for each light curve, one per light curve.
nsamples (ndarray) – Number of supersamples per exposure, one per light curve.
exptimes (ndarray) – Exposure time in days, one per light curve.
npt (int) – Number of exposures.
nlc (int) – Number of light curves.
npb (int) – Number of passbands.
Notes
This class is not meant to be used directly. See
RoadRunnerModelfor the recommended general-purpose model.- set_data(time, lcids=None, pbids=None, nsamples=None, exptimes=None, epids=None)[source]#
Set the data for the transit model.
- Parameters:
time (array-like) – Array of mid-exposure times for which the model will be evaluated.
lcids (array-like, optional) – Array of integer light curve indices. Must have the same size as the time array.
pbids (array-like, optional) – Array of passband indices, one per light curve. Must satisfy pbids.size == unique(lcids).size.
nsamples (int or array-like, optional) – Number of samples per exposure. Can either be an integer, in which case all the light curves will have the same supersampling rate, or an array of integers, in which case each light curve can have a different rate.
exptimes (float or array-like, optional) – Exposure times, again either for all the modelled data, or one value per light curve.
epids (array-like, optional) – Epoch indices that can be used to link a light curve to a specific zero epoch and period (for TTV calculations).
- Returns:
bool – Whether the data were set. False if the call was a no-op because time is the array the model already holds and nothing else was given, which lets a subclass skip the work it derives from the data.
Limb darkening model interface#
LDModel is the interface for limb darkening profiles that come from a stellar atmosphere model
rather than an analytic law. RoadRunnerModel accepts
an instance of a subclass in place of a law name.