Transit modeling

class gerbls.LDModel(b=0.0, mag0=1.0, P=0.0, r=0.0, t0=0.0, target=None)[source]

Transit model with quadratic limb darkening. The parameters below are stored as public properties; for example, LDModel.b retrieves the currently stored impact parameter value. Use print(LDModel) for an overview of all stored parameters.

Parameters:
  • b (float, optional) – Impact parameter, by default 0.

  • mag0 (float, optional) – Out-of-transit flux, by default 1.

  • P (float, optional) – Orbital period, by default 0.

  • r (float, optional) – Planet-to-star radius ratio, by default 0.

  • t0 (float, optional) – Time of mid-transit, by default 0.

  • target (Optional[gerbls.pyTarget], optional) – Data structure containing stellar parameters, by default None

property dur: float

Calculated transit duration. self.target must be set.

eval(time)[source]

Evaluate the model flux at a given array of input times.

Parameters:

time (npt.ArrayLike) – Input times.

Return type:

ndarray

fit(phot, u_fixed=False)[source]

Fit a limb-darkened model to the data. Currently stored parameter values are used as initial guesses for the solution. The fitting is done using scipy.optimize.curve_fit.

Parameters:
  • phot (gerbls.pyDataContainer) – Input data.

  • u_fixed (bool, optional) – Whether to keep the limb darkening parameters fixed, by default False. If True, values for u1 and/or u2 must be set.

Return type:

None

Raises:

ValueError – Raises an error if u_fixed == True but u1 and u2 have not been set.

property fitted: bool

Indicates whether a transit model fit has been run.

classmethod from_BLS(bls, target=None)[source]

Set up a limb-darkened model from a BLS result.

Parameters:
Return type:

gerbls.LDModel

static get_chi2_const(phot)

Calculate the chi-squared parameter of a constant-flux fit to the data (no transit).

Parameters:

phot (gerbls.pyDataContainer) – Input data.

Return type:

float