PEPITA Documentation

The exoInfoMatrix class

class pepita.exoInfoMatrix.exoInfoMatrix(exptime, oversample=100)[source]

Bases: object

Information Analysis Matrix class.

To initalize, use the exposure time (cadence) of the lightcurve in seconds. For example:

info_matrix = exoInfoMatrix(20) # 20 second cadence

Then define the parameters of the fiducial model

info_matrix.set_data(

time_array, period_val, t0_val, ror_val, b_val, u1_val, u2_val, m_star_val, r_star_val, )

To calculate the covariance matrix, passing the error of the measurements into it

cov_matrix = info_matrix.eval_cov(sigma)

erase_priors()[source]

Used to erase all priors

eval_cov(sigma=None)[source]

Used to evaluate the covariance matrix

Parameters:

sigma (float or array) – Error in the flux measurements. Either a single float value to be used for all points or an array of size len(time_array) with individual errors for each timestamps

Returns:

Covariance matrix

Return type:

array

eval_deriv_matrix()[source]

Evaluates the matrix of derivatives for all timestamps in time_array

Returns:

Matrix of derivatives

Return type:

array

Raises:

ValueError – If fiducial model parameters have not been defined

eval_fisher(sigma)[source]

Used to evaluate the information matrix

Parameters:

sigma (float or array) – Error in the flux measurements. Either a single float value to be used for all points or an array of size len(time_array) with individual errors for each timestamps

Returns:

Information matrix

Return type:

array

eval_point(tval)[source]

Evaluates the derivatives at a given point

Parameters:

tval (float) – Time at which to evaluate the derivatives, in same units as time_array

Returns:

array of derivatives

Return type:

array

Raises:

ValueError – If values of the fiducial model have not been set.

get_approx_transit_duration(n_points=10000)[source]

Approximate the duration of the transit. Not efficient and used only for testing purposes

Parameters:

n_points (int, optional) – number of points for calculating appproximation, by default 10000

Returns:

Approximate duration of the transit

Return type:

float

get_in_transit()[source]

Get the number of data points which are in-transit

Returns:

Number of points in transit

Return type:

int

plot_derivs(fig_ax=None)[source]

Plots the derivatives of the transit model.

Parameters:

fig_ax ((figure, axes), optional) – If derivatives should be plotted in given figure and axes. Note that this is meant to be used for plotting different model derivatives on top of eachother and so (figure, axis) should be the output of calling plot_derivs() in other model.

Returns:

figure and axes

Return type:

(figure, axes)

setExptime(exptime)[source]

Changes the exposure time (cadence) of the model. Will force redefinition of parameters

Parameters:

exptime (float) – The new cadence in seconds.

set_data(time_array, period_val, t0_val, ror_val, b_val, u1_val, u2_val, m_star_val, r_star_val)[source]

Set the data for the fiducial model. The fiducial model is used to evaluate the derivatives and can be a first approximation of the planet parameters from the maximum likelihood set of parameters or from previous fits.

Parameters:
  • time_array (array[float]) – Timestamps of the lightcurve. In days.

  • period_val (float) – Period of the planet in days

  • t0_val (float) – Reference time for the middle of one of the planet transits. In days.

  • ror_val (float) – Radius ratio of the planet and star

  • b_val (float) – Impact parameter of the planet

  • u1_val (float) – First limb-darkening parameter for a quadratic limb-darkening model

  • u2_val (float) – Second limb-darkening parameter for a quadratic limb-darkening model

  • m_star_val (float) – Mass of the star in solar masses

  • r_star_val (float) – Radius of star in solar radii

set_priors(period_prior=nan, t0_prior=nan, ror_prior=nan, b_prior=nan, u1_prior=nan, u2_prior=nan, m_star_prior=nan, r_star_prior=nan)[source]

Used to define priors for the parameters

Parameters:
  • period_prior (float) – Prior for planet period in days

  • t0_prior (float) – Prior for t0 in days

  • ror_prior (float) – Prior for planet ratio

  • b_prior (float) – Prior for impact parameter

  • u1_prior (float) – Prior for first quadratic limb darkening parameter

  • u2_prior (float) – Prior for second quadratic limb darkening parameter

  • m_star_prior (float) – Prior for mass of the star

  • r_star_prior (float) – Prior for radius of the star

Returns:

Priors matrix

Return type:

array

set_t(time_array)[source]

Change the time array of the model

Parameters:

time_array (array) – New timestamps for the data