or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

asteroseismology.mdcore-data.mddata-search.mdindex.mdprf-modeling.mdsystematics-correction.mdtime-series-analysis.md
tile.json

tessl/pypi-lightkurve

A friendly package for Kepler & TESS time series analysis in Python.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/lightkurve@2.5.x

To install, run

npx @tessl/cli install tessl/pypi-lightkurve@2.5.0

index.mddocs/

Lightkurve

A comprehensive Python library for analyzing time series data from NASA's Kepler and TESS space telescopes. Lightkurve provides user-friendly tools for downloading, processing, analyzing, and visualizing astronomical flux data, enabling both basic exploratory analysis and sophisticated automated pipelines for exoplanet detection and stellar variability studies.

Package Information

  • Package Name: lightkurve
  • Package Type: pypi
  • Language: Python
  • Installation: pip install lightkurve

Core Imports

import lightkurve as lk

For specific functionality:

from lightkurve import LightCurve, TargetPixelFile, search_lightcurve, read, open

Basic Usage

import lightkurve as lk
import astropy.units as u

# Search for Kepler data
search_result = lk.search_lightcurve('Kepler-10')

# Download the first light curve
lc = search_result[0].download()

# Basic processing
lc = lc.remove_nans().normalize()

# Create a periodogram to find planets
periodogram = lc.to_periodogram()

# Plot the light curve
lc.plot()

# Fold the light curve at a specific period
folded_lc = lc.fold(period=0.84 * u.day)
folded_lc.plot()

Architecture

Lightkurve is built around several core data containers and analysis tools:

  • Data Containers: LightCurve and TargetPixelFile classes represent time series and pixel-level data respectively
  • Collections: Group multiple data files together for batch processing
  • Search Functions: Query and download data from MAST archives
  • Analysis Tools: Periodograms, correctors, and specialized analysis classes
  • Utilities: Time formats, quality flags, and helper functions designed for space telescope data

The library integrates seamlessly with the scientific Python ecosystem, building on NumPy, SciPy, Matplotlib, and Astropy.

Capabilities

Data Search and Access

Search and download time series data from NASA's space telescope archives, including Kepler, K2, and TESS missions with support for multiple data products and pipelines.

def search_lightcurve(target, **kwargs):
    """Search for light curve files in MAST archives"""

def search_targetpixelfile(target, **kwargs):
    """Search for target pixel files in MAST archives"""

def search_tesscut(target, size, **kwargs):
    """Search for TESS full frame image cutouts"""

class SearchResult:
    """Container for search results with download capabilities"""
    def download(self, **kwargs): ...
    def download_all(self, **kwargs): ...

Data Search and Access

Core Data Objects

Light curves and target pixel files are the fundamental data containers, providing rich functionality for time series analysis and visualization.

class LightCurve:
    """Time series data with time, flux, and flux_err columns"""
    def __init__(self, time=None, flux=None, flux_err=None, **kwargs): ...
    def plot(self, **kwargs): ...  
    def remove_outliers(self, **kwargs): ...
    def normalize(self, **kwargs): ...
    def fold(self, period, **kwargs): ...

class TargetPixelFile:
    """Pixel-level time series data from space telescopes"""
    def to_lightcurve(self, **kwargs): ...
    def plot(self, **kwargs): ...
    def interact(self, **kwargs): ...

Core Data Objects

Time Series Analysis

Comprehensive periodogram analysis for detecting periodic signals, including specialized algorithms for transit detection and stellar oscillations.

class Periodogram:
    """Power spectrum representation with peak detection"""
    def plot(self, **kwargs): ...
    def show_properties(self): ...

class LombScarglePeriodogram(Periodogram):
    """Lomb-Scargle periodogram for unevenly sampled data"""

class BoxLeastSquaresPeriodogram(Periodogram):
    """Box Least Squares periodogram for transit detection"""

Time Series Analysis

Systematics Correction

Advanced algorithms for removing instrumental systematics and improving photometric precision, essential for detecting small astrophysical signals.

class PLDCorrector:
    """Pixel Level Decorrelation for removing systematic noise"""
    def correct(self, **kwargs): ...

class CBVCorrector:
    """Cotrending Basis Vector correction using pre-computed vectors"""
    def correct(self, **kwargs): ...

class SFFCorrector:
    """Self Flat Fielding for K2 data correction"""
    def correct(self, **kwargs): ...

Systematics Correction

Point Spread Function Modeling

Sophisticated PSF modeling and photometry for extracting precise light curves from pixel data, particularly useful for crowded fields and faint targets.

class KeplerPRF:
    """Kepler Point Response Function model"""
    def evaluate(self, **kwargs): ...

class PRFPhotometry:
    """High-level interface for PRF photometry analysis"""
    def fit(self, **kwargs): ...

Point Spread Function Modeling

Asteroseismology

Specialized tools for analyzing stellar oscillations and deriving fundamental stellar properties from seismic parameters.

class Seismology:
    """Asteroseismology analysis for stellar oscillations"""
    def estimate_numax(self, **kwargs): ...
    def estimate_deltanu(self, **kwargs): ...

def estimate_radius(numax, deltanu, teff): ...
def estimate_mass(numax, deltanu, teff): ...

Asteroseismology

Types

# Time formats for space telescope data
class TimeBKJD:
    """Barycentric Kepler Julian Date"""

class TimeBTJD:
    """Barycentric TESS Julian Date"""

# Quality flag decoders
class KeplerQualityFlags:
    """Decoder for Kepler data quality flags"""

class TessQualityFlags:
    """Decoder for TESS data quality flags"""

# Configuration
class Conf:
    """Configuration parameters for lightkurve"""
    cache_dir: str
    search_result_display_extra_columns: list