Combining Multiple Quarters of Kepler Data with Lightkurve#

Learning Goals#

By the end of this tutorial, you will:

  • Understand a Kepler Quarter.

  • Understand how to download multiple quarters of data at once.

  • Learn how to normalize Kepler data.

  • Understand how to combine multiple quarters of data.


The Kepler, K2, and TESS telescopes observe stars for long periods of time. These long, time series observations are broken up into separate chunks, called quarters for the Kepler mission, campaigns for K2, and sectors for TESS.

Building light curves with as much data as is available is useful when searching for small signals, such as planetary transits or stellar pulsations. In this tutorial, we will learn how to use Lightkurve’s tools to download and stitch together multiple quarters of Kepler observations.

It is recommended to first read the tutorial discussing how to use Kepler light curve products with Lightkurve. That tutorial will introduce you to some specifics of how Kepler, K2, and TESS make observations, and how these are displayed as light curves. It also introduces some important terms and concepts that are referred to in this tutorial.

This tutorial demonstrates how to access and combine multiple quarters of data from the Kepler space telescope, using the Lightkurve package.

When accessing Kepler data through MAST, it will be stored in three-month chunks, corresponding to a quarter of observations. By combining and normalizing these separate observations, you can form a single light curve that spans all observed quarters. Utilizing all of the data available is especially important when looking at repeating signals, such as planet transits and stellar oscillations.

We will use the Kepler mission as an example, but these tools are extensible to TESS and K2 as well.


This tutorial requires the Lightkurve package, which in turn uses matplotlib for plotting.

import lightkurve as lk
%matplotlib inline

What is a Kepler Quarter?#

In order to search for planets around other stars, the Kepler space telescope performed near-continuous monitoring of a single field of view, from an Earth-trailing orbit. However, this posed a challenge. If the space telescope is trailing Earth and maintaining steady pointing, its solar panels would slowly receive less and less sunlight.

In order to make sure the solar panels remained oriented towards the Sun, Kepler performed quarterly rolls, one every 93 days. The infographic below helps visualize this, and shows the points in the orbit where the rolls took place.

After each roll, Kepler retained its fine-pointing at the same field of view. Because the camera rotated by 90 degrees, all of the target stars fell on different parts of the charge-coupled device (CCD) camera. This had an effect on the amount of flux recorded for the same star, because different CCD pixels have different sensitivities. The way in which the flux from the same stars was distributed on the CCD (called the point spread function or PSF) also changed after each roll, due to focus changes and other instrumental effects. As a result, the aperture mask set for a star had to be recomputed after each roll, and may capture slightly different amounts of flux.

The data obtained between rolls is referred to as a quarter. While there are changes to the flux systematics, not much else changes quarter to quarter, and the majority of the target list remains identical. This means that, after removing systematic trends (such as was done for the presearch data conditioning simple aperture photometry (PDCSAP) flux), multiple quarters together can form one continuous observation.

Figure: Infographic showcasing the necessity of Kepler’s quarterly rolls and its Earth-trailing orbit. Source: Kepler Science Center.

Note: Observations by K2 and TESS are also broken down into chunks of a month or more, called campaigns (for K2) and sectors (for TESS). While not discussed in this tutorial, the tools below work for these data products as well.

Downloading Multiple KeplerLightCurve Objects at Once#

To start, we can use Lightkurve’s search_lightcurve() function to see what data are available for our target star on the Mikulski Archive for Space Telescopes (MAST) archive. We will use the star Kepler-8, a star somewhat larger than the Sun, and the host of a hot Jupiter planet.

#Temporarily using KOI-10 to get around a software bug. KOI-10 is the same object as Kepler-8
search_result = lk.search_lightcurve("KOI-10", mission="Kepler")

In this list, each row represents a different observing quarter, for a total of 18 quarters across four years. The observation column lists the Kepler Quarter. The target_name represents the Kepler Input Catalogue (KIC) ID of the target, and the productFilename column is the name of the FITS files downloaded from MAST. The distance column shows the separation on the sky between the searched coordinates and the downloaded objects — this is only relevant when searching for specific coordinates in the sky, and not when looking for individual objects.

Instead of downloading a single quarter using the download() function, we can use the download_all() function to access all 18 quarters at once (this might take a while).

lc_collection = search_result.download_all()

All of the downloaded data are stored in a LightCurveCollection. This object acts as a wrapper for 18 separate KeplerLightCurve objects, listed above.

We can access the KeplerLightCurve objects and interact with them as usual through the LightCurveCollection.

lc_Q4 = lc_collection[4] 

Note: The example given above also works for downloading target pixel files (TPFs). This will produce a TargetPixelFileCollection object instead.

Investigating the Data#

Let’s first have a look at how these observations differ from one another. We can plot the simple aperture photometry (SAP) flux of all of the observations in the LightCurveCollection to see how they compare.

ax = lc_collection[0].plot(column='sap_flux', label=None)
for lc in lc_collection[1:]:
    lc.plot(ax=ax, column='sap_flux', label=None)

In the figure above, each quarter of data looks strikingly different, with global patterns repeating every four quarters as Kepler has made a full rotation.

The change in flux within each quarter is in part driven by changes in the telescope focus, which are caused by changes in the temperature of Kepler’s components as the spacecraft orbits the Sun. The changes are also caused by an effect called differential velocity aberration (DVA), which causes stars to drift over the course of a quarter, depending on their distance from the center of Kepler’s field of view.

While the figure above looks messy, all the systematic effects mentioned above are well understood, and have been detrended in the PDCSAP flux. For a more detailed overview, see the Kepler Data Characteristics Handbook, specifically: Section 5. Ongoing Phenomena.

Normalizing a Light Curve#

If we want to see the actual variation of the targeted object over the course of these observations, the plot above isn’t very useful to us. It is also not useful to have flux expressed in physical units, because it is affected by the observing conditions such as telescope focus and pointing (see above).

Instead, it is a common practice to normalize light curves by dividing by their median value. This means that the median of the newly normalized light curve will be equal to 1, and that the relative size of signals in the observation (such as transits) will be maintained.

A normalization can be performed using the normalize() method of a KeplerLightCurve, for example:


In the figure above, we have plotted the normalized PDCSAP flux for Quarter 4. The median normalized flux is at 1, and the transit depths lie around 0.991, indicating a 0.9% dip in brightness due to the planet transiting the star.

The LightCurveCollection also has a plot() method. We can use it to plot the PDCSAP flux. The method automatically normalizes the flux in same way we did for a single quarter above.


As the above figure shows, this method only normalizes the flux on a “per quarter” basis. It is convenient, but it does not normalize all quarters to the same value. We’ll explore how to create a uniform light curve in the section below.

Combining Multiple Observations into a Single Light Curve#

Finally, we can combine these different light curves into a single KeplerLightCurve object. This is done using the stitch() method. This method concatenates all quarters in our LightCurveCollection together, and normalizes them at the same time, in the manner we saw above.

lc_stitched = lc_collection.stitch()

This returns a single KeplerLightCurve! It is in all ways identical to KeplerLightCurve of a single quarter, just longer. We can plot it the usual way.


In this final normalized light curve, the interesting observational features of the star are more clear. Specifically: repeating transits that can be used to characterize planets and a noisy stellar flux that can be used to study brightness variability through asteroseismology.

Normalizing individual Kepler Quarters before combining them to form a single light curve isn’t the only way to make sure different quarters are consistent with one another. For a breakdown of other available methods and their benefits, see Section 6. Stitching Kepler Quarters Together in Kinemuchi et al. 2012.

About this Notebook#

Authors: Oliver Hall (, Geert Barentsen

Updated On: 2020-09-15

Citing Lightkurve and Astropy#

If you use lightkurve or astropy for published research, please cite the authors. Click the buttons below to copy BibTeX entries to your clipboard.

Space Telescope Logo