Giter Club home page Giter Club logo

tls's Introduction

Logo

An optimized transit-fitting algorithm to search for periodic transits of small planets

Image Image Image Image Image Image

Motivation

We present a new method to detect planetary transits from time-series photometry, the Transit Least Squares (TLS) algorithm. 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. The higher detection efficiency of our freely available Python implementation comes at the cost of higher computational load, which we partly compensate by applying an optimized period sampling and transit duration sampling, constrained to the physically plausible range. A typical Kepler K2 light curve, worth of 90 d of observations at a cadence of 30 min, can be searched with TLS in 10 seconds real time on a standard laptop computer, just as with BLS.

image

Installation

TLS can be installed conveniently using: pip install transitleastsquares

If you have multiple versions of Python and pip on your machine, try: pip3 install transitleastsquares

The latest version can be pulled from github::

git clone https://github.com/hippke/tls.git
cd tls
python setup.py install

If the command python does not point to Python 3 on your machine, you can try to replace the last line with python3 setup.py install. If you don't have git on your machine, you can find installation instructions here. TLS also runs on Python 2, but without multi-threading.

Dependencies: Python 3, NumPy, numba, batman-package, tqdm, optional: argparse (for the command line version), astroquery (for LD and stellar density priors from Kepler K1, K2, and TESS).

If you have trouble installing, please open an issue.

Getting started

Here is a short animation of a real search for planets in Kepler K2 data. For more examples, have a look at the tutorials and the documentation.

image

Attribution

Please cite Hippke & Heller (2019, A&A 623, A39) if you find this code useful in your research. The BibTeX entry for the paper is:

@ARTICLE{2019A&A...623A..39H,
       author = {{Hippke}, Michael and {Heller}, Ren{\'e}},
        title = "{Optimized transit detection algorithm to search for periodic transits of small planets}",
      journal = {\aap},
         year = "2019",
        month = "Mar",
       volume = {623},
          eid = {A39},
        pages = {A39},
          doi = {10.1051/0004-6361/201834672},
archivePrefix = {arXiv},
       eprint = {1901.02015},
 primaryClass = {astro-ph.EP},
       adsurl = {https://ui.adsabs.harvard.edu/\#abs/2019A&A...623A..39H},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Contributing Code, Bugfixes, or Feedback

We welcome and encourage contributions. If you have any trouble, open an issue.

Copyright 2019 Michael Hippke & René Heller.

tls's People

Contributors

astrojose9 avatar hippke avatar keatonb avatar leigh2 avatar lgbouma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tls's Issues

Refactor hardcoded self.rp

Refactor hardcoded self.rp = kwargs.get("rp", (1.42 * R_earth) / R_sun)
Move to the top where all constants are defined. Also:
self.per = 12.9
self.rp = (0.03)
self.a = (23.1)
self.inc = 89.21
self.b = 0.99
self.per = 29
self.rp = (11 * R_earth) / R_sun
self.a = (26.9)

Call clean_array before every TLS run

Currently clean_array must be called manually. As the runtime is very short and it has no negative side effects, we should call it automatically before each run.

Code refactorings

  • Split into separate files (constants, helper functions, core?)
  • Re-run black
  • hardcoded self.rp

Visualization of phase-folded model appears too shallow

Occasionally, the transit model light curve in the phase-folded plot appears to be too shallow.
Examples: EPICs

  • 246389858
  • 212006344
  • 210968143
  • 220621087
  • 206154641

Shifting the fitted transit depth down in 1% steps worsens the results.chi2_min monotonically. Therefore, the power spectrum (and SDE) appears to be correct. The error appears to be in the visualization only.

Downsample data before search

Binning the data before running a search increases speed almost quadratically. For very high cadence data, the loss from binning should be small. Add option to bin 2x, 4x, 8x,...

catalog_info returns "--" when values are missing

These empty return values can not directly be fed into TLS. Extra code necessary to catch/handle on the user side.
Possible solution: Return "none" and handle it internally in TLS (fall back to defaults). Document the behavior.

Release on github

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Return flat power spectrum if no transit was fit

CASE: Light curve is so flat the the transit_depth_min (default 10 ppm) causes no transit to be fit.
Current behaviour: TLS raises a UserError and quits
Desired behaviour: Raise a warning and return a flat power spectrum + all zero values

Tutorials

  • New: Balancing speed and detection efficiency
  • New: TESS
  • New: Command-line interface
  • New: Uncertainties

rp_rs for all LD laws

Currently only available when quadratic limb darkening is used, otherwise returns None

make period_grid robust

User may provide values leading to an empty period grid.
Then, do not raise a warning and quit.
Instead, provide a default grid, warn, and continue.

Validate statistics

  • numpy warnings (mean of empty slice, etc) --> are currently hidden with numpy.warnings.filterwarnings('ignore')
  • fix numpy deprecation warnings
  • snr_pink_per_transit
  • odd_even_mismatch

MAST API broken (for TESS priors)

Dear Sir or Madam,

I have been using the MAST API in the past month and the examples from https://mast.stsci.edu/api/v0/pyex.html worked great. Recently I noticed that something broke. When I use the service "Mast.Catalogs.Filtered.Tic", I get the error:

{"status" : "ERROR","msg" : "The column prefix 'c' does not match with a table name or alias name used in the query."}

My query is:

mastQuery(
        {
            "service": "Mast.Catalogs.Filtered.Tic",
            "format": "json",
            "params": {
                "columns": "c.*",
                "filters": adv_filters,
            },
        }

Handle unknown args

Currently, TLS silently swallows unknown parameters.
Better handling should be: Reject, or at least warn

Compensate for morphological light-curve distortions

Compensate for morphological light-curve distortions (temporal smearing effects) due to finite integration time (Kipping 2010). Following his Eq. 40 we can estimate that this is probably not necessary to re-compute at every period, but only occasionally, so that the speed loss is small. Can also be made an optional parameter.

Warn if period_grid returns very large number of periods

If user provides mass, radius with very small values, the period_grid can contain a very large number of periods. Providing unrealistically small mass and radius can happen by accident or from faulty catalog values. Possible solutions:

  • Reject unphysical stellar values (e.g., make R_star_min > 0.1)
  • Warn if len(period_grid)>X where e.g. X>10^6

Installation issue conda

When I was trying to pip install, it reports

(python37) [boma@16:48:11@~/transit/tls] pip install tls
Collecting tls
Could not find a version that satisfies the requirement tls (from versions: )
No matching distribution found for tls

I have python 3.7 installed using Conda. Not sure which version is required by TLS.

Follow-up paper ideas

Searches

  • K2 multiples
  • Paper: Quad system
  • Paper: New multis
  • K2 full
  • K2 multiples
  • K1 full
  • TESS

Theory

  • Determine effect of TTVs on SDE:
  • Is a TTV-smeared transit more transit-like (or more box-like)?
  • Are very short transits (outside of Figure 5) detectable?
  • See previous estimates about exoplanet detectability around White Dwarfs (Agol 2011) and other exotic places (Imara & Stefano 2017).
  • If this is realistic, how should TLS be adapted?
  • Simply change the shortest transit duration to 1 cadence?
  • How big is the morphological shape deformation with "long" cadences?
  • Is the best transit template V-shaped?
  • Account for TTVs
  • For BLS this has been implemeneted: Quasiperiodic Automated Transit Search (Carter & Agol 2012)
  • Is this computationally realistic fo TLS? The major additional effort should be non-constant phase folding?
  • Determine detection biases:
  • Observational biases for transiting planets (Kipping & Sandford 2016) are partly due to the box shaped transit fit (when using BLS).
  • Even when fitting a better transit shape like the TLS template, similar biases can be expected since our template curve cannot be a perfect fit for all transits.
  • For example, an eccentric or V-form grazing transit shape is substantially different from a box.
  • This causes increased noise, resulting in lower detection efficiency.
  • A few real, but rare, transit shapes might be closer to a box than to the reference transit template, resulting in a different set of observational biases.
  • Characterizing these can be a natural follow-up work.
  • Benchmark machine-learning vs. TLS:
  • Speed
  • Detection efficiency
  • Develop a heuristic of a shallowest transit depth to be fitted, as a function of noise in the data, period, and other factors.
  • What is the optimal (most sparse but still accurate) period grid to re-calculate the transit shape to correct for morphological deformations
  • PLATOsim

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.