# Using Kepler Light Curve Products with Lightkurve#

## Learning Goals#

By the end of this tutorial, you will:

• Understand how NASA’s Kepler Mission collected and released light curve data products.

• Be able to download and plot light curve files from the data archive using Lightkurve.

• Be able to access light curve metadata.

• Understand the time and brightness units.

## Introduction#

The Kepler, K2, and TESS telescopes observe stars for long periods of time, from just under a month to four years. By doing so they observe how the brightness of stars change over time. A series of these brightness observations is referred to as a light curve of a star.

Light curves of stars observed by the Kepler, K2, or TESS missions are created from the raw images collected by these telescopes using software built for this purpose by the mission teams. In this tutorial, we will learn how to use the Lightkurve package to download these preprocessed light curves from Kepler’s data archive, plot them, and understand their properties and units.

Much of the explanation below is inspired by Kinemuchi et al. (2012), an excellent paper introducing and explaining the terminology surrounding the Kepler mission and its data. You can find detailed information on the mission and its data products in the official Kepler Instrument Handbook and the Kepler Data Processing Handbook.

We will use the Kepler mission as the main example, but these tools are extensible to TESS and K2 as well. For example, while in this tutorial we will learn to work with Lightkurve’s KeplerLightCurve objects, there are also TessLightCurve objects that work in the same way.

## Imports#

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

import lightkurve as lk
%matplotlib inline

## 1. About NASA’s Photometric Space Telescopes#

In order to understand the data produced by NASA’s Kepler, K2, and TESS missions, it is useful to understand a little about how these data were obtained.

### 1.1. Kepler#

During its nominal mission, the Kepler telescope made observations using 21 pairs of rectangular charge-coupled device (CCD) camera chips (also called modules), each consisting of four 1100 x 2048 pixel channels. Each observed star fell on one of these 84 CCD channels. Recording the channel numbers for each star was important, because the Kepler spacecraft rotated by 90 degrees roughly four times a year. These rotations divide what are referred to as observing quarters. While the same star may be observed in multiple quarters, it may fall on a different CCD channel each time.

Kepler observed a single field in the sky, although not all stars in this field were recorded as light curves. Instead, pixels were selected around a predetermined list of target stars, which were then downloaded. These downloaded measurements are stored in target pixel files (TPFs). By adding up the flux (a measurement of an object’s brightness per unit time) measured by the pixels in which a target star appears, the total brightness of a star can be measured. If you make this measurement at different times, you obtain a light curve.

Kepler recorded the brightness measurements at two different cadences: a Short Cadence (SC, 58.85 seconds) and a Long Cadence (LC, 29.4 minutes). For more details, read: Kepler Instrument Handbook, Section 2.1. Mission Overview and 2.6. Pixels of Interest, and the Kepler Archive Manual Chapter 2: Kepler Data Products.

Figure: The field of view of the Kepler mission. The rectangles represent the CCD modules described above.

### 1.2. K2#

The Kepler mission ended in 2013 following the loss of two reaction wheels, leaving the spacecraft unable to stay fixed on one portion of the sky. Instead, it changed its focus to the ecliptic plane, and performed 80-day observing campaigns of 19 separate fields. K2 data are very similar to Kepler data, but are subject to higher levels of instrument noise due to the increased instability of the spacecraft. For more details read the K2 Handbook, specifically Section 2: What’s New in K2.

### 1.3. TESS#

The Transiting Exoplanet Survey Satellite (TESS) succeeded Kepler in 2018. The data it collects are very similar to those from Kepler and K2, but TESS covers a much larger area of the sky at a lower resolution. TESS observes large sectors of the sky for 27 days at a time. The overlap of these sectors means that stars near the ecliptic poles will receive a year of uninterrupted data, while those near the ecliptic receive only ~27 days. Compared to Kepler, TESS observes in several different cadence modes, including 20 seconds, 120 seconds, 10 minutes, and 30 minutes. For more details, see the Mission Overview and the TESS Instrument Handbook, specifically Section 2: Introduction to TESS.

Some stars that have been observed by TESS will also have been observed by Kepler, and in some rare cases K2.

The light curves of stars created by the Kepler 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 quarter of Kepler data for a star named Kepler-8, a star somewhat larger than the Sun, and the host of a hot Jupiter planet.

Using Lightkurve’s search_lightcurve function, we can find an itemized list of different light curve file products available for Kepler-8:

search_result = lk.search_lightcurve("Kepler-8", mission="Kepler")
search_result
SearchResult containing 50 data products.
#missionyearauthorexptimetarget_namedistance
sarcsec
0Kepler Quarter 032009Kepler60kplr0069222440.0
1Kepler Quarter 022009Kepler60kplr0069222440.0
2Kepler Quarter 022009Kepler60kplr0069222440.0
3Kepler Quarter 022009Kepler60kplr0069222440.0
4Kepler Quarter 032009Kepler60kplr0069222440.0
5Kepler Quarter 032009Kepler60kplr0069222440.0
6Kepler Quarter 002009Kepler1800kplr0069222440.0
7Kepler Quarter 012009Kepler1800kplr0069222440.0
8Kepler Quarter 022009Kepler1800kplr0069222440.0
.....................
40Kepler Quarter 132012Kepler60kplr0069222440.0
41Kepler Quarter 112012Kepler60kplr0069222440.0
42Kepler Quarter 122012Kepler1800kplr0069222440.0
43Kepler Quarter 112012Kepler1800kplr0069222440.0
44Kepler Quarter 132012Kepler1800kplr0069222440.0
45Kepler Quarter 142012Kepler1800kplr0069222440.0
46Kepler Quarter 152013Kepler1800kplr0069222440.0
47Kepler Quarter 172013Kepler1800kplr0069222440.0
48Kepler Quarter 162013Kepler1800kplr0069222440.0
49Kepler Quarter2009KBONUS-BKG1765Gaia DR3 21167309949659052800.0
Length = 50 rows

In this list, each row represents a different observing period. We find that Kepler recorded the maxmimum of 18 quarters of data for this target 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 you pass a radius argument to the search_lightcurve function to search for targets within a given search radius around a set of coordinates.

The search_lightcurve function takes several additional arguments, such as the quarter number or the mission name. You can find examples of its use in the online documentation for this function.

The search function returns a SearchResult object which has several convenient operations. For example, we can select the fourth data product in the list as follows:

search_result[4]
SearchResult containing 1 data products.
#missionyearauthorexptimetarget_namedistance
sarcsec
0Kepler Quarter 032009Kepler60kplr0069222440.0

This instruction is identical to the following line:

/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/lightkurve/search.py:424: LightkurveWarning: Warning: 5 files available to download. Only the first file has been downloaded. Please use download_all() or specify additional criteria (e.g. quarter, campaign, or sector) to limit your search.
warnings.warn(

The klc variable we have obtained in this way is a KeplerLightCurve object. This object contains time, flux, and flux error information, as well as a whole lot of data about spacecraft systematics. We can view all of them by calling the object by itself:

klc
KeplerLightCurve length=45453 LABEL="KIC 6922244" QUARTER=4 AUTHOR=Kepler FLUX_ORIGIN=pdcsap_flux
electron / selectron / sdpixpixelectron / selectron / selectron / selectron / selectron / selectron / spixpixpixpixpixpixpixpixpixpix
Timefloat32float32int32float32float64float64int32float32float32float32float32float32float32int32float64float32float64float32float64float32float64float32float32float32
352.3664488646464——————0-1.410475e-03682.69289190.132033458804.3726242e+043.6275974e+011.6734445e+034.6769428e-01——————0————————————682.692891.0144709e-03190.132039.9874916e-043.3346944e-02-6.0084205e-02
352.3671298512636——————0-1.410489e-03682.69073190.133963458814.3655164e+043.6252655e+011.6733635e+034.6769321e-01——————0————————————682.690731.0160099e-03190.133969.9957502e-043.3344790e-02-6.0088485e-02
352.3678110378751——————0-1.410502e-03682.69084190.133003458824.3717223e+043.6270748e+011.6732825e+034.6769220e-01——————0————————————682.690841.0143395e-03190.133009.9824253e-043.3342637e-02-6.0092766e-02
352.3684921244858——————0-1.410516e-03682.69058190.133253458834.3703078e+043.6267101e+011.6732014e+034.6769118e-01——————0————————————682.690581.0146485e-03190.133259.9842646e-043.3340488e-02-6.0097046e-02
352.3691732110965——————0-1.410529e-03682.69140190.133613458844.3723355e+043.6269840e+011.6731204e+034.6769017e-01——————0————————————682.691401.0143060e-03190.133619.9832180e-043.3338334e-02-6.0101327e-02
352.3698542977145——————0-1.410542e-03682.69096190.132753458854.3685207e+043.6261799e+011.6730396e+034.6768913e-01——————0————————————682.690961.0147295e-03190.132759.9886989e-043.3336181e-02-6.0105603e-02
352.37053548420954——————0-1.410556e-03682.69484190.133043458864.3664211e+043.6259644e+011.6729585e+034.6768811e-01——————0————————————682.694841.0161689e-03190.133049.9954498e-043.3334032e-02-6.0109887e-02
352.37121657082025——————0-1.410569e-03682.69182190.133103458874.3707324e+043.6272911e+011.6728774e+034.6768710e-01——————0————————————682.691821.0137684e-03190.133109.9839014e-043.3331878e-02-6.0114164e-02
352.37189765743096——————0-1.410583e-03682.69024190.132903458884.3683859e+043.6262623e+011.6727965e+034.6768609e-01——————0————————————682.690241.0152882e-03190.132909.9945720e-043.3329725e-02-6.0118444e-02
...........................................................................
383.419129341957165.2782652e+044.4167023e+010-1.669498e-03682.62134190.207123914714.3668578e+043.6299347e+011.8282554e+034.7019076e-015.2782652e+044.4167023e+010————————————682.621341.0168595e-03190.207121.0044262e-03-3.1875137e-025.5173732e-02
383.41981054428475.2661902e+044.4139805e+0110000000000000-1.669496e-03682.61917190.205983914724.3568410e+043.6276890e+011.8282578e+034.7020048e-015.2661902e+044.4139805e+0110000000000000————————————682.619171.0187188e-03190.205981.0068327e-03-3.1876769e-025.5169649e-02
383.42049164661155.2626367e+044.4141659e+010-1.669493e-03682.61776190.208513914734.3538859e+043.6278774e+011.8282603e+034.7021016e-015.2626367e+044.4141659e+010————————————682.617761.0192173e-03190.208511.0073108e-03-3.1878401e-025.5165570e-02
383.421172748821855.2563688e+044.4115524e+010-1.669491e-03682.61879190.207653914744.3486820e+043.6257210e+011.8282627e+034.7021988e-015.2563688e+044.4115524e+010————————————682.618791.0203815e-03190.207651.0089858e-03-3.1880032e-025.5161487e-02
383.42185385115595.2747863e+044.4166237e+010-1.669489e-03682.62037190.208093914754.3639332e+043.6299995e+011.8282651e+034.7022960e-015.2747863e+044.4166237e+010————————————682.620371.0178068e-03190.208091.0057518e-03-3.1881664e-025.5157408e-02
383.42253495348275.2657980e+044.4134235e+010-1.669487e-03682.62037190.208143914764.3564754e+043.6273499e+011.8282676e+034.7023928e-015.2657980e+044.4134235e+010————————————682.620371.0193521e-03190.208141.0065644e-03-3.1883292e-025.5153325e-02
383.423216055809465.2668676e+044.4135952e+010-1.669484e-03682.61726190.208053914774.3573520e+043.6275234e+011.8282699e+034.7024900e-015.2668676e+044.4135952e+010————————————682.617261.0184434e-03190.208051.0060391e-03-3.1884924e-025.5149242e-02
383.423897158136245.2707305e+044.4150673e+010-1.669482e-03682.62236190.208663914784.3605430e+043.6287853e+011.8282723e+034.7025868e-015.2707305e+044.4150673e+010————————————682.622361.0184314e-03190.208661.0059420e-03-3.1886555e-025.5145163e-02
383.42457836046385.2612375e+044.4130764e+010-1.669480e-03682.61672190.210993914794.3526680e+043.6271461e+011.8282748e+034.7026840e-015.2612375e+044.4130764e+010————————————682.616721.0195442e-03190.210991.0075792e-03-3.1888187e-025.5141080e-02

This object provides a convenient way to interact with the data file that has been returned by the archive, which contains both the light curve data and metadata about the observations.

Before diving into the properties of the light curve file, we can plot the data, also using Lightkurve.

%matplotlib inline
klc.plot();

On this plot, the y-axis is flux in electrons per second. This unit may appear counterintutive, as flux is a measure of brightness. The CCD cameras measure an electrical charge, and so light is recorded as electrons, not photons as you might expect. On the x-axis we have time in Barycentric Kepler Julian Date (BKJD). In short, the x-axis values are days since the start of the Kepler mission. The repeating dips in brightness are transits, the effect of a planet orbiting Kepler-8 and passing between us and the star.

### Note#

You can also download light curve FITS files from the archive by hand, store them on your local disk, and open them using the lk.read(<filename>) function. This function will return a KeplerLightCurve object just as in the above example. You can find out where Lightkurve stored a light curve file using the filename attribute:

klc.filename

## 3. The SAP and PDCSAP Light Curves#

As you can see in the Table above, there are two different types of flux stored in the KeplerLightCurve object. These correspond to different levels of data treatment performed for this star by NASA’s Kepler Data Processing Pipeline: the simple aperture photometry (SAP) flux, and the presearch data conditioning SAP (PDCSAP) flux.

By default, a KeplerLightCurve will set the PDCSAP flux to its .flux property.

To compare the PDCSAP and the SAP flux, we can use the column keyword while plotting.

Note: alternatively, you can replace the flux column with the sap_flux column by using klc.flux = klc['sap_flux'].

ax = klc.plot(column='pdcsap_flux', label='PDCSAP Flux', normalize=True)
klc.plot(column='sap_flux', label='SAP Flux', normalize=True, ax=ax);

In brief:

• The SAP light curve is calculated by summing together the brightness of pixels that fall within an aperture set by the Kepler mission. This is often referred to as the optimal aperture, but in spite of its name can sometimes be improved upon! Because the SAP light curve is a sum of the brightness in chosen pixels, it is still subject to systematic artifacts of the mission.

• The PDCSAP light curve is subject to more treatment than the SAP light curve, and is specifically intended for detecting planets. The PDCSAP pipeline attempts to remove systematic artifacts while keeping planetary transits intact.

Looking at the figure we made above, you can see that the SAP light curve has a long-term change in brightness that has been removed in the PDCSAP light curve, while keeping the transits at the same depth. For most inspections, a PDCSAP light curve is what you want to use, but when looking at astronomical phenomena that aren’t planets (for example, long-term variability), the SAP flux may be preferred.

For now, let’s continue to use the PDCSAP flux only. Because this is the default .flux property of our light curve object, we don’t need to change anything.

### Note#

The plot() methods in Lightkurve always return a Matplotlib object. This is useful because it lets us manipulate the plot using standard Matplotlib functions. For example, we can set the title as follows:

ax = klc.plot()
ax.set_title("PDCSAP light curve of Kepler-8");

And the figure can be saved as follows:

ax.figure.savefig('blatmp.png')

When downloading data from MAST, that data usually comes in the format of a FITS file. These FITS files carry a wealth of metadata about the observation. When these are loaded in to Lightkurve to create a KeplerLightCurve, all of the metadata are stored in the .meta property of the object.

We can view these metadata by calling this property, as follows:

klc.meta
{'INHERIT': True,
'EXTNAME': 'PRIMARY',
'EXTVER': 1,
'TELESCOP': 'Kepler',
'INSTRUME': 'Kepler Photometer',
'OBJECT': 'KIC 6922244',
'KEPLERID': 6922244,
'RA_OBJ': 281.28812,
'DEC_OBJ': 42.45108,
'EQUINOX': 2000.0,
'EXPOSURE': 28.59382564,
'TIMEREF': 'SOLARSYSTEM',
'TASSIGN': 'SPACECRAFT',
'TIMESYS': 'TDB',
'BJDREFI': 2454833,
'BJDREFF': 0.0,
'TIMEUNIT': 'd',
'TELAPSE': 31.05881061,
'LIVETIME': 28.59382564,
'TSTART': 352.36610831,
'TSTOP': 383.42491892,
'LC_START': 55184.86785934,
'LC_END': 55215.92624784,
'TIMEPIXR': 0.5,
'TIERRELA': 5.78e-07,
'TIERABSO': <astropy.io.fits.card.Undefined at 0x7efd809d5d10>,
'INT_TIME': 6.01980290327,
'FRAMETIM': 6.538751429414,
'NUM_FRM': 9,
'TIMEDEL': 0.000681119940564,
'DATE-OBS': '2009-12-19T20:49:13.622Z',
'DATE-END': '2010-01-19T22:14:17.237Z',
'BACKAPP': True,
'VIGNAPP': True,
'GAIN': 115.49,
'TIMSLICE': 1,
'MEANBLCK': 715,
'LCFXDOFF': 419400,
'SCFXDOFF': 219400,
'CDPP3_0': <astropy.io.fits.card.Undefined at 0x7efd809d5d10>,
'CDPP6_0': <astropy.io.fits.card.Undefined at 0x7efd809d5d10>,
'CDPP12_0': <astropy.io.fits.card.Undefined at 0x7efd809d5d10>,
'CROWDSAP': 1.0,
'FLFRCSAP': 0.8286,
'NSPSDDET': 0,
'NSPSDCOR': 0,
'PDCVAR': 1.0116586685180664,
'PDCMETHD': 'quickMap',
'NUMBAND': 1,
'FITTYPE1': 'prior',
'PR_GOOD1': 0.9999775886535645,
'PR_WGHT1': 0.022915253415703773,
'PDC_TOT': 0.9629505276679993,
'PDC_TOTP': 28.58700942993164,
'PDC_COR': 0.9999974370002747,
'PDC_CORP': 50.0,
'PDC_VAR': 0.9998998641967773,
'PDC_VARP': 71.4129867553711,
'PDC_NOI': 0.8930104970932007,
'PDC_NOIP': 28.58700942993164,
'PDC_EPT': <astropy.io.fits.card.Undefined at 0x7efd809d5d10>,
'PDC_EPTP': <astropy.io.fits.card.Undefined at 0x7efd809d5d10>,
'CHECKSUM': 'J9CFJ99CJ9CCJ99C',
'SIMPLE': True,
'BITPIX': 8,
'NAXIS': 0,
'EXTEND': True,
'NEXTEND': 2,
'ORIGIN': 'NASA/Ames',
'DATE': '2016-05-18',
'CREATOR': '1193565 FluxExporter2PipelineModule',
'PROCVER': 'svn+ssh://murzim/repo/soc/tags/release/9.3.46 r61343',
'FILEVER': '6.1',
'TIMVERSN': 'OGIP/93-003',
'CHANNEL': 31,
'SKYGROUP': 31,
'MODULE': 10,
'OUTPUT': 3,
'QUARTER': 4,
'SEASON': 2,
'DATA_REL': 25,
'MISSION': 'Kepler',
'TTABLEID': 29,
'PMRA': 0.0,
'PMDEC': 0.0,
'PMTOTAL': 0.0,
'PARALLAX': None,
'GLON': 71.6589,
'GLAT': 19.012749,
'GMAG': 13.886,
'RMAG': 13.511,
'IMAG': 13.424,
'ZMAG': 13.413,
'D51MAG': 13.7,
'JMAG': 12.576,
'HMAG': 12.323,
'KMAG': 12.292,
'KEPMAG': 13.563,
'GRCOLOR': 0.375,
'JKCOLOR': 0.284,
'GKCOLOR': 1.594,
'TEFF': 6225,
'LOGG': 4.169,
'FEH': -0.04,
'EBMINUSV': 0.096,
'AV': 0.297,
'TMINDEX': 262064792,
'SCPID': 262064792,
'LABEL': 'KIC 6922244',
'RA': 281.28812,
'DEC': 42.45108,
'FLUX_ORIGIN': 'pdcsap_flux',
'AUTHOR': 'Kepler',
'TARGETID': 6922244,
'QUALITY_MASK': array([ True,  True,  True, ...,  True,  True,  True])}

As you can see, there is a lot here if you don’t know what you are looking for! These metadata don’t just include information about the observations, but also data from the Kepler Input Catalogue (KIC) used to select observing targets, such as their magnitudes and temperature.

The .meta property is a Python dictionary, which has some convenient features. For example, we can retrieve the value of an individual keyword as follows (keep in mind that dictionary keywords are case sensitive):

klc.meta['QUARTER']
4

Alternatively, we can use the .get() method, which accounts for queries that aren’t in the dictionary.

klc.meta.get('mission')

A feature of the KeplerLightCurve object is that the metadata can also be accessed via user-friendly object properties for convenience. For example, the Kepler Quarter number is directly accessible via the quarter property:

klc.quarter
4

## 5. Understanding the Data Arrays and Units#

As we saw above, the KeplerLightCurve object is a table that contains many arrays other than the PDCSAP and SAP fluxes. Detailed information on each of these can be found in the Kepler Archive Manual, Section 2.3.1. Light Curve Files.

The first six columns appear in all KeplerLightCurve objects, and contain the most commonly used information. These are:

• time: the time measurements at each cadence.

• flux: the flux of the target star at each time measurement. This is populated with PDCSAP flux by default.

• flux_err: the statistical uncertainty on each flux data point.

• quality: information on the data quality at each time measurement.

• centroid_col & centroid_row: the position of the target star on the CCD at each observation. This changes over time due to, for example, small jitters of the spacecraft.

The remaining columns are more detailed information on the observation. Some of these are duplicated in the first five columns described above:

• timecorr: correction values that allow users to revert back to non-barycentric timestamps.

• cadenceno: these are mission-specific identifiers of each exposure.

• sap_flux & sap_flux_err: the SAP flux and associated error.

• sap_bkg & sap_bkg_err: the calculated background (and associated error) inside the aperture used to calculate the SAP flux.

• pdcsap_flux & pdcsap_flux_err: the PDCSAP flux and associated error. Duplicated by default in flux and flux_err.

• sap_quality: information on the data quality at each time measurement. Duplicated in quality.

• psf_centr1 & psf_centr2 (and errors): the column and row centroid positions of a PSF model fit to the target star.

• mom_centr1 & mom_centr2 (and errors): the column and row centroid positions of the target star, weighted by flux. Duplicated in centroid_col and centroid_row respectively.

• pos_corr1 & pos_corr2: the column and row components of the calculated image motion.

These columns can be accessed as properties of the KeplerLightCurve , for example, as follows:

klc.sap_bkg
$[1673.4445,~1673.3635,~1673.2825,~\dots,~1828.2699,~1828.2723,~1828.2748] \; \mathrm{\frac{e^{-}}{s}}$

The unit information of the arrays are stored using Astropy’s astropy.units module, which means that they are an Astropy Quantity object. We can view the units as follows:

print(f'Centroid column unit: {klc.centroid_col.unit}')
print(f'Flux unit: {klc.flux.unit}')
Centroid column unit: pix
Flux unit: electron / s

You can access the data in the form of a standard NumPy array using the value attribute:

klc.centroid_col.value
682.61725999, 682.62236336, 682.61672471], dtype='>f8')

We can also plot the data using the KeplerLightCurve’s plot() method by passing a column keyword argument:

ax = klc.plot(column='mom_centr1', label='Flux-weighted column position')
klc.plot(ax=ax, column='psf_centr1', label='PSF centroid column position');

Finally, the .time property is a little different. Instead of an Astropy Quantity object, it is an Astropy Time object, and has some additional time scale and format information.

klc.time
<Time object: scale='tdb' format='bkjd' value=[352.36644886 352.36712985 352.36781104 ... 383.42321606 383.42389716
383.42457836]>
print(f'Time scale: {klc.time.scale}')
print(f'Time format: {klc.time.format}')
Time scale: tdb
Time format: bkjd

Here, the time format is the unit of time, in this case Barycentric Kepler Julian Date (BKJD). The time scale indicates how the time is measured, in this case by taking the Barycentric Dynamical Time (TDB). This detailed information may be important when comparing observations of a periodic event (such as a planet transit) with observations made with other telescopes on Earth.

## Exercises#

Some stars, such as Kepler-10, have been observed both with Kepler and TESS. In this exercise, download and plot the TESS PDCSAP flux only. You can do this by either selecting it from the SearchResult returned by search_lightcurve() or by using the mission keyword argument when searching.

#search_result = lk.search_lightcurvefile(...)
# Solution:
search_result = lk.search_lightcurve('Kepler-10', mission='TESS')
search_result
SearchResult containing 43 data products.
#missionyearauthorexptimetarget_namedistance
sarcsec
0TESS Sector 142019SPOC1203777807900.0
1TESS Sector 402021SPOC203777807900.0
2TESS Sector 412021SPOC203777807900.0
3TESS Sector 412021SPOC1203777807900.0
4TESS Sector 402021SPOC1203777807900.0
5TESS Sector 552022SPOC203777807900.0
6TESS Sector 542022SPOC203777807900.0
7TESS Sector 532022SPOC203777807900.0
8TESS Sector 552022SPOC1203777807900.0
.....................
33TESS Sector 142019TASOC18003777807900.0
34TESS Sector 152019CDIPS18003777807900.0
35TESS Sector 262020TASOC18003777807900.0
36TESS Sector 262020CDIPS18003777807900.0
37TESS Sector 262020TASOC18003777807900.0
38TESS Sector 412021CDIPS18003777807900.0
39TESS Sector 402021CDIPS18003777807900.0
40TESS Sector 552022CDIPS18003777807900.0
41TESS Sector 542022CDIPS18003777807900.0
42TESS Sector 532022CDIPS18003777807900.0
Length = 43 rows
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/lightkurve/search.py:424: LightkurveWarning: Warning: 43 files available to download. Only the first file has been downloaded. Please use download_all() or specify additional criteria (e.g. quarter, campaign, or sector) to limit your search.
warnings.warn(