How to open a light curve in Excel?#
By the end of this tutorial, you will:
Learn how to search and download TESS light curves.
Make a quick plot of a light curve you found.
Understand how to load the data into Excel.
This tutorial is aimed at first time users who may not have used Lightkurve before.
First we must install and import the Lightkurve package. We can do this as follows:
# This step is not necessary if you have already installed Lightkurve !pip install lightkurve --quiet
%matplotlib inline import lightkurve as lk
1. Downloading a TESS light curve#
The light curves of stars created by the TESS mission are stored at the Mikulksi Archive for Space Telescopes (MAST) archive, along with metadata about the observations, such as which CCD channel was used at each time.
Lightkurve’s built-in tools allow us to search for light curve files in the archive, and download them and their metadata. In this example, we will start by downloading one sector of TESS data for a star named V1357 Cyg, also known as Cygnus X-1. V1357 Cyg is a galactic X-ray source in the constellation Cygnus.
Using Lightkurve’s search_lightcurve function, we can find an itemized list of light curves produced by different data analysis pipelines:
search_result = lk.search_lightcurve("V1357 Cyg") search_result
By clicking on each of the “author” links above, you will obtain a description of the product and how each one is different from the other. The acronym SPOC refers to the TESS data calibration pipeline provided by NASA Ames, and QLP refers to the Quiclook Pipeline in use by the mission team at MIT.
We can download the first data product by specifying its index number in rectangular brackets:
lc = search_result.download()
2. Plotting a light curve#
Before loading the light curve data into Excel, it can be useful to have a quick look at the data using Lightkurve’s plot function:
3. Download the light curve as an Excel spreadsheet#
If you are new to Python, it is likely that you feel more comfortable inspecting and analyzing a light curve in Excel than in Python. That is fine! We can save the light curve data as an Excel spreadsheet named “V1357Cyg.xlsx” as follows:
This file will be available on your local drive. If you run this notebook in a Google Colab environment, you can download the file as follows:
from google.colab import files files.download("V1357Cyg.xlsx")