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 [R333fd99d762c1] to remove systematic noise caused by spacecraft jitter for the Spitzer Space Telescope. It was adapted to K2 data by [R333fd99d762c2] and [R333fd99d762c3] for the EVEREST pipeline [R333fd99d762c4].
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 quicklook 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 firstorder PLD coefficient on the linear term
\(b_{lm}\) is the secondorder PLD coefficient on the \(l^\text{th}\), \(m^\text{th}\) pixel pair
\(\alpha\), \(\beta\), and \(\gamma\) are the Gaussian Process terms applied to capture longperiod 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 PCAreduced 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
 R333fd99d762c1
Deming et al. (2015), ads:2015ApJ…805..132D. (arXiv:1411.7404)
 R333fd99d762c2
Luger et al. (2016), ads:2016AJ….152..100L (arXiv:1607.00524)
 R333fd99d762c3
Luger et al. (2018), ads:2018AJ….156…99L (arXiv:1702.05488)
 R333fd99d762c4
EVEREST pipeline webpage, https://rodluger.github.io/everest
Examples
Download the pixel data for GJ 9827 and obtain a PLDcorrected light curve:
>>> import lightkurve as lk >>> tpf = lk.search_targetpixelfile("GJ9827").download() >>> corrector = lk.PLDCorrector(tpf) >>> lc = corrector.correct() >>> lc.plot()
However, the above example will overfit 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 systematicscorrected LightCurve.
diagnose
(self)Returns plots which elucidate the most recent call to
correct()
.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 systematicscorrected LightCurve.
 Parameters
 aperture_maskarraylike, ‘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. IfNone
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 3sigma above the median flux will be used. cadence_maskarraylike
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
whereTrue
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 overfitting. 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 Decorrelation 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_maskarraylike, ‘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. IfNone
orall
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 3sigma above the median flux will be used.
 Returns
 corrected_lightcurve
LightCurve
Returns a corrected lightcurve object. Depending on the input, the returned object will be a
KeplerLightCurve
,TessLightCurve
, or generalLightCurve
object.
 corrected_lightcurve