# PLDCorrector¶

class lightkurve.correctors.PLDCorrector(tpf)

Bases: lightkurve.correctors.corrector.Corrector

Implements the Pixel Level Decorrelation (PLD) systematics removal method.

Pixel Level Decorrelation (PLD) was developed by [R333fd99d762c-1] to remove systematic noise caused by spacecraft jitter for the Spitzer Space Telescope. It was adapted to K2 data by [R333fd99d762c-2] and [R333fd99d762c-3] for the EVEREST pipeline [R333fd99d762c-4].

For a detailed description and implementation of PLD, please refer to these references. Lightkurve provides a reference implementation of PLD that is less sophisticated than EVEREST, but is suitable for quick-look analyses and detrending experiments.

Our simple implementation of PLD is performed by first calculating the noise model for each cadence in time. This function goes up to arbitrary order, and is represented by

$m_i = \alpha + \beta t_i + \gamma t_i^2 + \sum_l a_l \frac{f_{il}}{\sum_k f_{ik}} + \sum_l \sum_m b_{lm} \frac{f_{il}f_{im}}{\left( \sum_k f_{ik} \right)^2} + ...$

where

• $$m_i$$ is the noise model at time $$t_i$$

• $$f_{il}$$ is the flux in the $$l^\text{th}$$ pixel at time $$t_i$$

• $$a_l$$ is the first-order PLD coefficient on the linear term

• $$b_{lm}$$ is the second-order PLD coefficient on the $$l^\text{th}$$, $$m^\text{th}$$ pixel pair

• $$\alpha$$, $$\beta$$, and $$\gamma$$ are the Gaussian Process terms applied to capture long-period variability.

We perform Principal Component Analysis (PCA) to reduce the number of vectors in our final model to limit the set to best capture instrumental noise. With a PCA-reduced set of vectors, we can construct a design matrix containing fractional pixel fluxes.

To solve for the PLD model, we need to minimize the difference squared

$\chi^2 = \sum_i \frac{(y_i - m_i)^2}{\sigma_i^2},$

where $$y_i$$ is the observed flux value at time $$t_i$$, by solving

$\frac{\partial \chi^2}{\partial a_l} = 0.$

References

R333fd99d762c-1

Deming et al. (2015), ads:2015ApJ…805..132D. (arXiv:1411.7404)

R333fd99d762c-2

Luger et al. (2016), ads:2016AJ….152..100L (arXiv:1607.00524)

R333fd99d762c-3

Luger et al. (2018), ads:2018AJ….156…99L (arXiv:1702.05488)

R333fd99d762c-4

EVEREST pipeline webpage, https://rodluger.github.io/everest

Examples

Download the pixel data for GJ 9827 and obtain a PLD-corrected light curve:

>>> import lightkurve as lk
>>> corrector = lk.PLDCorrector(tpf) # doctest: +SKIP
>>> lc = corrector.correct() # doctest: +SKIP
>>> lc.plot() # doctest: +SKIP


However, the above example will over-fit the small transits! It is necessary to mask the transits using corrector.correct(cadence_mask=...).

Methods Summary

 correct(self[, aperture_mask, cadence_mask, …]) Returns a PLD systematics-corrected LightCurve. diagnose(self) interact(self)

Methods Documentation

correct(self, aperture_mask=None, cadence_mask=None, gp_timescale=30, use_gp=True, pld_order=2, n_pca_terms=10, pld_aperture_mask=None)

Returns a PLD systematics-corrected LightCurve.

Parameters
aperture_maskarray-like, ‘pipeline’, ‘all’, ‘threshold’, or None

A boolean array describing the aperture such that True means that the pixel will be used to generate the raw flux light curve. If None or ‘all’ are passed, all pixels will be used. If ‘pipeline’ is passed, the mask suggested by the official pipeline will be returned. If ‘threshold’ is passed, all pixels brighter than 3-sigma above the median flux will be used.

A mask that will be applied to the cadences prior to constructing the detrending model. For example, you can pass a boolean array of length n_cadences where True means that the cadence will be included in the noise model. You may also pass an array of indices. This option enables signals of interest (e.g. planet transits) to be excluded from the noise model, which will prevent over-fitting. By default, no cadences will be masked.

gp_timescalefloat

Gaussian Process time scale length term (tau) used to define length of fit variability in days.

use_gpboolean

Option to turn GP fitting on or off. You would typically only set this to False to speed up the correction (at the cost of precision), or if you suspect the presence of systematic noise at long timescales.

pld_orderint

The order of Pixel Level De-correlation to be performed. First order (n=1) uses only the pixel fluxes to construct the design matrix. Higher order populates the design matrix with columns constructed from the products of pixel fluxes.

n_pca_termsint

Number of terms added to the design matrix from each order of PLD when performing Principal Component Analysis for models higher than first order. Increasing this value may provide higher precision at the expense of computational time.

pld_aperture_maskarray-like, ‘pipeline’, ‘all’, ‘threshold’, or None

A boolean array describing the aperture such that True means that the pixel will be used when selecting the PLD basis vectors. If None or all are passed in, all pixels will be used. If ‘pipeline’ is passed, the mask suggested by the official pipeline will be returned. If ‘threshold’ is passed, all pixels brighter than 3-sigma above the median flux will be used.

Returns
corrected_lightcurveLightCurve

Returns a corrected lightcurve object. Depending on the input, the returned object will be a KeplerLightCurve, TessLightCurve, or general LightCurve object.

diagnose(self)
interact(self)