API¶
catwoman has two main classes: TransitModel and TransitParams.
-
class
catwoman.TransitParams¶ Object to store the physical parameters of the transit.
Parameters: - t0 (float) – Time of inferior conjunction.
- t_secondary (float, optional) – Time of secondary eclipse center.
- per (float) – Orbital period.
- rp (float) – Planet radius 1 (in stellar radii).
- rp2 (float) – Planet radius 2 (in stellar radii)
- a (float) – Semi-major axis (in stellar radii).
- inc (float) – Orbital inclination (in degrees).
- ecc (float) – Orbital eccentricity.
- w (float) – Argument of periapse (in degrees)
- u (array_like) – List of limb darkening coefficients.
- limb_dark (str) – Limb darkening model (choice of “nonlinear”, “quadratic”, “exponential”, “logarithmic”, “squareroot”, “linear”, “uniform”, “power2”, or “custom”).
- fp (float, optional) – Planet-to-star flux ratio (for secondary eclipse models).
- phi (float) – Rotation angle of planet, relative to horizontal (in degrees)
Note
- Units for the orbital period and ephemeris can be anything as long as they are consistent (e.g. both in days).
Example: >>> import catwoman >>> params = catwoman.TransitParams() >>> params.t0 = 0. #time of inferior conjunction >>> params.per = 1. #orbital period >>> params.rp = 0.1 #planet radius 1 (in units of stellar radii) >>> params.rp2 = 0.1005 #planet radius 2 (in units of stellar radii) >>> params.a = 15. #semi-major axis (in units of stellar radii) >>> params.inc = 87. #orbital inclination (in degrees) >>> params.ecc = 0. #eccentricity >>> params.w = 90. #longitude of periastron (in degrees) >>> params.u = [0.1, 0.3] #limb darkening coefficients >>> params.limb_dark = "quadratic" #limb darkening model >>> params.phi = 90. #rotation angle of planet
-
class
catwoman.TransitModel(params, t, max_err=1.0, nthreads=1, fac=None, transittype='primary', supersample_factor=1, exp_time=0.0)¶ Class for generating model asymmetric transit light curves.
Parameters: - params (a TransitParams instance) – A
TransitParamsobject containing the physical parameters of the transit - t (ndarray) – Array of times at which to calculate the model.
- max_err (float, optional) – Error tolerance/truncation error (in parts per million) for the model.
- fac (float, optional) – Scale factor for integration step size
- supersample_factor (integer, optional) – Number of points subdividing exposure
- exp_time (double, optional) – Exposure time (in same units as t)
Example: >>> model = catwoman.TransitModel(params, t, max_err = 1.0)
-
calc_err(plot=False)¶ Calculate maximum error for a specific transit light curve calculation.
Parameters: plot (bool) – If True, plots the error in the light curve model against the separation of centres, d.Returns: Truncation error (in parts per million) Return type: float
-
light_curve(params)¶ Calculates and returns a model asymmetric light curve.
Parameters: params (A TransitParams instance) – Transit parameters Returns: Relative flux Return type: ndarray Example: >>> flux = model.light_curve(params)
- params (a TransitParams instance) – A