basecamp.py - The Everest base class

The everest engine. All everest models inherit from Basecamp.

class everest.basecamp.Basecamp
X(i, j=slice(None, None, None))

Computes the design matrix at the given PLD order and the given indices. The columns are the PLD vectors for the target at the corresponding order, computed as the product of the fractional pixel flux of all sets of n pixels, where n is the PLD order.

apply_mask(x=None)

Returns the outlier mask, an array of indices corresponding to the non-outliers.

Parameters:x (numpy.ndarray) – If specified, returns the masked version of x instead. Default None
cdpps

The string version of the current value of the CDPP in ppm. This displays the CDPP for each segment of the light curve individually (if breakpoints are present).

compute()

Compute the model for the current value of lambda.

compute_joint()

Compute the model in a single step, allowing for a light curve-wide transit model. This is a bit more expensive to compute.

dir

Returns the directory where the raw data and output for the target is stored.

fcor

The CBV-corrected de-trended flux.

flux

The corrected/de-trended flux. This is computed by subtracting the linear model from the raw SAP flux.

get_cdpp(flux=None)

Returns the scalar CDPP for the light curve.

get_cdpp_arr(flux=None)

Returns the CDPP value in ppm for each of the chunks in the light curve.

get_chunk(b, x=None, pad=True)

Returns the indices corresponding to a given light curve chunk.

Parameters:
  • b (int) – The index of the chunk to return
  • x (numpy.ndarray) – If specified, applies the mask to array x. Default None
get_masked_chunk(b, x=None, pad=True)

Same as get_chunk(), but first removes the outlier indices. :param int b: The index of the chunk to return :param numpy.ndarray x: If specified, applies the mask to array x. Default None

get_norm()

Computes the PLD normalization. In the base class, this is just the sum of all the pixel fluxes.

get_weights()

Computes the PLD weights vector w.

..warning :: Deprecated and not thoroughly tested.

lnlike(model, refactor=False, pos_tol=2.5, neg_tol=50.0, full_output=False)

Return the likelihood of the astrophysical model model.

Returns the likelihood of model marginalized over the PLD model.

Parameters:
  • model (ndarray) – A vector of the same shape as self.time corresponding to the astrophysical model.
  • refactor (bool) – Re-compute the Cholesky decomposition? This typically does not need to be done, except when the PLD model changes. Default False.
  • pos_tol (float) – the positive (i.e., above the median) outlier tolerance in standard deviations.
  • neg_tol (float) – the negative (i.e., below the median) outlier tolerance in standard deviations.
  • full_output (bool) – If True, returns the maximum likelihood model amplitude and the variance on the amplitude in addition to the log-likelihood. In the case of a transit model, these are the transit depth and depth variance. Default False.
logfile

Returns the full path to the log file for the current run.

mask

The array of indices to be masked. This is the union of the sets of outliers, bad (flagged) cadences, transit cadences, and NaN cadences.

norm

The PLD normalization. Typically, this is just the simple aperture photometry flux (i.e., the sum of all the pixels in the aperture).

overfit(tau=None, plot=True, clobber=False, w=9, **kwargs)

Compute the masked & unmasked overfitting metrics for the light curve.

This routine injects a transit model given by tau at every cadence in the light curve and recovers the transit depth when (1) leaving the transit unmasked and (2) masking the transit prior to performing regression.

Parameters:
  • tau – A function or callable that accepts two arguments, time and t0, and returns an array corresponding to a zero-mean, unit depth transit model centered at t0 and evaluated at time. The easiest way to provide this is to use an instance of everest.transit.TransitShape. Default is everest.transit.TransitShape(dur=0.1), a transit with solar-like limb darkening and a duratio of 0.1 days.
  • plot (bool) – Plot the results as a PDF? Default True
  • clobber (bool) – Overwrite the results if present? Default False
  • w (int) – The size of the masking window in cadences for computing the masked overfitting metric. Default 9 (about 4.5 hours for K2 long cadence).
Returns:

An instance of everest.basecamp.Overfitting.

plot_aperture(axes, labelsize=8)

Plots the aperture and the pixel images at the beginning, middle, and end of the time series. Also plots a high resolution image of the target, if available.

plot_info(dvs)

Plots miscellaneous de-trending information on the data validation summary figure.

Parameters:dvs – A dvs.DVS figure instance
search(pos_tol=2.5, neg_tol=50.0, clobber=False, name='search', **kwargs)
season

Return the current observing season.

For K2, this is the observing campaign, while for Kepler, it is the current quarter.

transit_model
weights

The PLD weights vector. The model may be computed by dotting the design matrix X with this vector. Note that these are computed just for plotting purpoeses – the actual weights are never explicitly computed during the de-trending, since it can be rather slow.

class everest.basecamp.Overfitting(O1, O2, O3, O4, O5, pdf)

Stores information on the overfitting metrics for a light curve.

masked(depth=0.01)

Return the masked overfitting metric for a given transit depth.

show()

Show the overfitting PDF summary.

unmasked(depth=0.01)

Return the unmasked overfitting metric for a given transit depth.