lightkurve / lightkurve

A friendly package for Kepler & TESS time series analysis in Python.
https://lightkurve.github.io/lightkurve/
MIT License
429 stars 171 forks source link

Add Transit Least Squares algorithm to search for periodic transits #431

Open hippke opened 5 years ago

hippke commented 5 years ago

I am the author of Transit Least Squares, an optimized transit-fitting algorithm to search for periodic transits of small planets. Is it of interest to include TLS into lightkurve? As of now, there is only BLS integrated.

Rationale

While the commonly used Box Least Squares (BLS, Kovács et al. 2002) algorithm searches for rectangular signals in stellar light curves, TLS searches for transit-like features with stellar limb-darkening and including the effects of planetary ingress and egress. Moreover, TLS analyses the entire, unbinned data of the phase-folded light curve. These improvements yield a ~10 % higher detection efficiency (and similar false alarm rates) compared to BLS.

TLS status
Inputs and robustness

TLS needs a detrended and normalized-to-unity-flux light curve as input. It must contain time and flux values, and uncertainties can be provided. The data should be detrended before feeding it to TLS so that most of the stellar variation is removed. A sliding median with a window of 1-day width is often a good choice.

TLS is build to be robust to any kind of data. It automatically removes nan, inf, and other values which are not usable. It warns the user if the data appears to be dubious, e.g. if its mean is not close to unity. We have tested TLS with thousands of K2 light curves and it processed every single one.

TLS API and output

TLS has been designed with a similar interface as the BLS implementation in Astropy:

from transitleastsquares import transitleastsquares
model = transitleastsquares(time, flux)
results = model.power()

Its return values (results.XYZ) are documented here. TLS provides:

A number of visualizations can be found at the tutorials.

Useful links
Questions:
barentsen commented 5 years ago

Thank you for opening this issue @hippke, and congratulations with your work on transitleastsquares. It looks like a very innovative and valuable piece of work!

I'd like to answer in more detail as soon as I get the chance to properly play around with transitleastsquares, but here are three quick initial thoughts:

The first step would be for a simple demo to be created to show the benefit of integrating transitleastsquares with Lightkurve's LightCurve and Periodogram classes!

Again, thanks++ for opening the issue, and thank you for the new package and paper!