Binder badge

How to remove K2 motion systematics with SFF?

You can use lightkurve to remove the motion from K2 data. Targets in K2 data move over multiple pixels during the exposure due to thruster firings. This can be corrected using the self flat fielding method (SFF), which you can read more about here On this page we will show a short tutorial demonstrating how you can apply the method on your light curves.

Let’s download a K2 light curve of an exoplanet host star. Remember that for K2 data, we can use the same Kepler functions KeplerTargetPixelFile and KeplerLightCurveFile as they are the same instrument.

[1]:
from lightkurve import search_lightcurvefile
lcf = search_lightcurvefile(247887989).download()  # returns a KeplerLightCurveFile
lc = lcf.PDCSAP_FLUX                               # returns a KeplerLightCurve

#Remove nans and outliers
lc = lc.remove_nans().remove_outliers()

#Remove long term trends
lc = lc.flatten(window_length=401)
[2]:
lc.scatter();
../_images/tutorials_04-how-to-detrend_3_0.png

This light curve is of the object K2-133b, which has a period of 3.0712 days. Let’s plot the folded version of it to see what it looks like.

[3]:
lc.fold(period=3.0712).scatter();
../_images/tutorials_04-how-to-detrend_5_0.png

We can see the hint of an exoplanet transit close to the center, but the motion of the spacecraft has made it difficult to make out above the noise. We can use the correct function on the lightcurve to remove this motion. An in-depth look into how the algorithm works can be found here. You can pass the following keywords to the correct function:

This tutorial will teach you more about how to tune these parameters. For this problem, we will use the defaults, but increase the number of windows to 20.

[5]:
corr_lc = lc.to_corrector("sff").correct(windows=20)

Now when we compare the two light curves we can see the clear signal from the exoplanet.

[6]:
ax = lc.fold(period=3.0712).scatter(color='red', alpha=0.5, label='With Motion')
ax = corr_lc.fold(period=3.0712).scatter(ax=ax, color='blue', alpha=0.5, label='Motion Corrected');
../_images/tutorials_04-how-to-detrend_9_0.png

Created with ♥ by the Lightkurve collaboration. Please cite us or join us on GitHub.