ldtk

Python toolkit for calculating stellar limb darkening profiles and model-specific coefficients using the stellar atmosphere spectrum library by Husser et al. (2013). Described in Parviainen & Aigrain, MNRAS 453, 3821–3826 (2015).

https://github.com/hpparvi/ldtk

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, zenodo.org
  • Committers with academic emails
    2 of 8 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.0%) to scientific vocabulary

Keywords

astronomy astrophysics exoplanet-transits exoplanets limb-darkening-models limb-darkening-profiles python
Last synced: 6 months ago · JSON representation ·

Repository

Python toolkit for calculating stellar limb darkening profiles and model-specific coefficients using the stellar atmosphere spectrum library by Husser et al. (2013). Described in Parviainen & Aigrain, MNRAS 453, 3821–3826 (2015).

Basic Info
  • Host: GitHub
  • Owner: hpparvi
  • License: gpl-2.0
  • Language: Jupyter Notebook
  • Default Branch: master
  • Homepage:
  • Size: 2.03 MB
Statistics
  • Stars: 30
  • Watchers: 6
  • Forks: 21
  • Open Issues: 5
  • Releases: 12
Topics
astronomy astrophysics exoplanet-transits exoplanets limb-darkening-models limb-darkening-profiles python
Created almost 11 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

LDTk

Licence MNRAS arXiv ASCL DOI astropy

Python Limb Darkening Toolkit - a Python toolkit for calculating stellar limb darkening profiles and model-specific coefficients for arbitrary passbands using the stellar spectrum model library by Husser et al (2013).

```python from ldtk import LDPSetCreator, BoxcarFilter

filters = [BoxcarFilter('a', 450, 550), # Define your passbands BoxcarFilter('b', 650, 750), # - Boxcar filters useful in BoxcarFilter('c', 850, 950)] # transmission spectroscopy

sc = LDPSetCreator(teff=(6400, 50), # Define your star, and the code logg=(4.50, 0.20), # downloads the uncached stellar z=(0.25, 0.05), # spectra from the Husser et al. filters=filters) # FTP server automatically.

ps = sc.createprofiles() # Create the limb darkening profiles cq,eq = ps.coeffsqd(do_mc=True) # Estimate quadratic law coefficients

lnlike = ps.lnlike_qd([[0.45,0.15], # Calculate the quadratic law log [0.35,0.10], # likelihood for a set of coefficients [0.25,0.05]]) # (returns the joint likelihood)

lnlike = ps.lnlike_qd([0.25,0.05],flt=0) # Quad. law log L for the first filter ```

...and the same, but for 19 narrow passbands...

Overview

LDTk automates the calculation of custom stellar limb darkening (LD) profiles and model-specific limb darkening coefficients (LDC) using the library of PHOENIX-generated specific intensity spectra by Husser et al. (2013).

The aim of the package is to facilitate exoplanet transit light curve modeling, especially transmission spectroscopy where the modeling is carried out for custom narrow passbands. The package can be

  1. used to construct model-specific priors on the limb darkening coefficients prior to the transit light curve modeling
  2. directly integrated into the log posterior computation of any pre-existing transit modeling code with minimal modifications.

The second approach can be used to constrain the LD model parameter space directly by the LD profile, allowing for the marginalization over the whole parameter space that can explain the profile without the need to approximate this constraint by a prior distribution. This is useful when using a high-order limb darkening model where the coefficients are often correlated, and the priors estimated from the tabulated values usually fail to include these correlations.

News

  • Version 1.7 (22.7.2021)

    • Improved the way the stellar limb is defined. LDTk now fits an LD model together with a smoothstep function to find the edge of the star. This approach should remove the need for manual edge definition completely.
    • LDTk now resamples the original models to a linear sampling in mu since this makes LD coefficient estimation more straightforward.
  • Version 1.6 (4.5.2021)

  • Version 1.5 (3.3.2021)

    • LDTk can now use four different sets of the modelled stellar spectra: vis, vis-lowres, visir, and visir-lowres. The first, vis, is the original one by Husser et al (2013) spanning from 50 nm to 2600 nm; vis-lowres is a lower resolution version of the original dataset, binned to a 5 nm resolution; visir is a new version of the original model set extended to span from 50 nm to 5500 nm; and visir-lowres is a lower resolution version of the new model set binned to 5 nm resolution.
    • The model set can be chosen in the LDPSetCreator initialisation by setting the dataset argument. LDTk uses vis-lowres as a default, but visir-lowres can be used when dealing with IR observations, and the original versions (vis and visir) can be used if a spectral resolution higher than 5 nm is required.
  • Version 1.4

    • Added automatic detection and re-download of corrupted fits files (a highly welcome contribution by T. Fatahi).
  • Version 1.3

    • Changed to calculate the limb darkening models using numba. This should give a significant performance boost.
  • Version 1.2

    • Added an option to use low resolution version of the original specific intensity spectra. These spectra are binned to 5 nm resolution in wavelength and are kindly hosted by T. Husser at the same FTP server as the original spectra.
    • The behavior can be toggled with a new LDPSetCreator initialisation argument, lowres.
    • LDTk uses now low resolution spectra by default. This is because the wavelength resolution should be good enough for most broadband photometry analyses, and the this decreases the download times and file storage sizes significantly.

Requirements

Core requirements

  • Python 2.7 or Python 3
  • NumPy => 1.7
  • SciPy => 0.16
  • tqdm
  • astropy

Notebooks

  • IPython => 3.0

Installation

Use pip

pip install [--user] [--upgrade] ldtk

or clone the source from github and follow the basic Python package installation routine

bash git clone https://github.com/hpparvi/ldtk.git cd ldtk python setup.py build install [--user]

Examples

Examples for basic and more advanced usage can be found from the notebooks directory.

Model coefficient estimation

Log likelihood evaluation

The LDPSet class offers methods to calculate log likelihoods for a set of limb darkening models.

  • lnlike_ln : Linear model
  • lnlike_qd : Quadratic model
  • lnlike_tq : Quadratic model with triangular parametrization (Kipping 2013)
  • lnlike_nl : Nonlinear model
  • lnlike_gn : General model
  • lnlike_p2 : Power-2 model

Resampling

The limb darkening profiles can be resampled to a desired sampling in mu using the resampling methods in the LDPSet.

  • resample_linear_z(nz=100): Resample the profiles to be linear in z
  • resample_linear_mu(nmu=100): Resample the profiles to be linear in mu
  • reset_sampling(): Reset back to native sampling in mu
  • resample():

Main classes

  • LDPSetCreator : Generates a set of limb darkening profiles given a set of filters and stellar TEff, logg, and z.
  • LDPSet : Encapsulates the limb darkening profiles and offers methods for model coefficient estimation and log likelihood evaluation.

Citing

If you use LDTk in your research, please cite the LDTk paper

Parviainen, H. & Aigrain, S. MNRAS 453, 3821–3826 (2015) (DOI:10.1093/mnras/stv1857).

and the paper describing the spectrum library without which LDTk would be rather useless

Husser, T.-O. et al. A&A 553, A6 (2013) (DOI:10.1051/0004-6361/201219058).

or use these ready made BibTeX entries

@article{Parviainen2015,
  author = {Parviainen, Hannu and Aigrain, Suzanne},
  doi = {10.1093/mnras/stv1857},
  journal = {MNRAS},
  month = nov,
  number = {4},
  pages = {3821--3826},
  title = {{ldtk: Limb Darkening Toolkit}},
  url = {http://mnras.oxfordjournals.org/lookup/doi/10.1093/mnras/stv1857},
  volume = {453},
  year = {2015}
}

@article{Husser2013,
  author = {Husser, T.-O. and {Wende-von Berg}, S and Dreizler, S and Homeier, D and
             Reiners, A and Barman, T. and Hauschildt, Peter H},
  doi = {10.1051/0004-6361/201219058},
  journal = {A{\&}A},
  pages = {A6},
  title = {{Astrophysics A new extensive library of PHOENIX stellar atmospheres}},
  volume = {553},
  year = {2013}
}

Author

Hannu Parviainen, University of Oxford

Contributors

  • Rainer Wichmann, Hamburger Sternwarte, Universität Hamburg
  • Tom Louden, University of Warwick
  • Ian Crossfield, University of Arizona

--

Copyright © 2016 Hannu Parviainen hannu.parviainen@physics.ox.ac.uk

Owner

  • Name: Hannu Parviainen
  • Login: hpparvi
  • Kind: user
  • Location: La Laguna, Tenerife, Spain
  • Company: Instituto de Astrofísica de Canarias (IAC)

Ramón y Cajal Fellow studying exoplanets in the Instituto de Astrofísica de Canarias.

Citation (CITATION.cff)

cff-version: 1.2.0
title: >-
  ldtk: Limb Darkening Toolkit
message: >-
  If you made the use of PyLDTk, I would appreciate it if you give credit.
authors:
  - family-names: Parviainen
    given-names: Hannu
    email: hannu.parviainen@physics.ox.ac.uk
    orcid: 'https://orcid.org/0000-0001-5519-1391'
  - family-names: Aigrain
    given-names: Suzanne
    orcid: 'https://orcid.org/0000-0003-1453-0574'
identifiers:
  - type: other
    value: '1510.003'
    description: ascl
repository-code: 'https://github.com/hpparvi/ldtk'
abstract: >-
  We present a python package ldtk that automates the calculation of custom
  stellar limb-darkening (LD) profiles and model-specific limb-darkening
  coefficients using the library of phoenix-generated specific intensity
  spectra by Husser et al. The aim of the package is to facilitate analyses
  requiring custom generated LD profiles, such as the studies of exoplanet
  transits -- especially transmission spectroscopy, where the transit modelling
  is carried out for custom narrow passbands -- eclipsing binaries,
  interferometry, and microlensing events. First, ldtk can be used to compute
  custom LD profiles with uncertainties propagated from the uncertainties in
  the stellar parameter estimates. Secondly, ldtk can be used to estimate the
  LD-model-specific coefficients with uncertainties for the most common LD
  models. Thirdly, ldtk can be directly integrated into the log posterior
  computation of any pre-existing modelling code with minimal modifications.
  The last approach can be used to constrain the LD model parameter space
  directly by the LD profile, allowing for the marginalization over the LD
  parameter space without the need to approximate the constraint from the LD
  profile using a prior.
keywords:
  - 'gravitational lensing: micro'
  - 'methods: numerical'
  - 'techniques: interferometric'
  - 'planets and satellites: general'
  - 'binaries: eclipsing'
preferred-citation:
  type: article
  title: >-
    ldtk: Limb Darkening Toolkit
  authors:
    - family-names: Parviainen
      given-names: Hannu
      email: hannu.parviainen@physics.ox.ac.uk
      orcid: 'https://orcid.org/0000-0001-5519-1391'
    - family-names: Aigrain
      given-names: Suzanne
      orcid: 'https://orcid.org/0000-0003-1453-0574'
  doi: "10.1093/mnras/stv1857"
  journal: 'MNRAS'
  year: 2015
  month: 11
  start: 3821
  end: 3826
  volume: 453
  number: 4
  url: 'http://mnras.oxfordjournals.org/lookup/doi/10.1093/mnras/stv1857'
license: GPL-2.0

GitHub Events

Total
  • Watch event: 4
  • Issue comment event: 1
  • Push event: 3
  • Pull request event: 2
  • Fork event: 3
Last Year
  • Watch event: 4
  • Issue comment event: 1
  • Push event: 3
  • Pull request event: 2
  • Fork event: 3

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 186
  • Total Committers: 8
  • Avg Commits per committer: 23.25
  • Development Distribution Score (DDS): 0.446
Past Year
  • Commits: 21
  • Committers: 2
  • Avg Commits per committer: 10.5
  • Development Distribution Score (DDS): 0.286
Top Committers
Name Email Commits
Hannu Parviainen h****i@g****m 103
Hannu Parviainen h****u@i****s 55
Atanas Stefanov a****o@g****m 15
Tamim Fatahi t****i@g****m 4
iancrossfield i****d 3
John Engelke 5****e 3
Tom Louden t****n@w****k 2
Kirstin k****7@s****k 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 24
  • Total pull requests: 10
  • Average time to close issues: 9 months
  • Average time to close pull requests: 6 months
  • Total issue authors: 17
  • Total pull request authors: 9
  • Average comments per issue: 2.08
  • Average comments per pull request: 0.8
  • Merged pull requests: 9
  • Bot issues: 1
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.5
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • hpparvi (7)
  • vedad (2)
  • EdGillen (1)
  • awmann (1)
  • dependabot-preview[bot] (1)
  • lisadang27 (1)
  • EduardoCristo (1)
  • rzellem (1)
  • tundeakins (1)
  • TakuNishiumi (1)
  • adammcmaster (1)
  • Zorba256 (1)
  • jpl-jengelke (1)
  • trappist1i (1)
  • ericagol (1)
Pull Request Authors
  • tamimfatahi (2)
  • PriyadarshiAkshay (2)
  • iancrossfield (1)
  • haykirstin (1)
  • jpl-jengelke (1)
  • Askaniy (1)
  • tomlouden (1)
  • astronasko (1)
  • dependabot-preview[bot] (1)
Top Labels
Issue Labels
enhancement (6) bug (2)
Pull Request Labels
dependencies (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 3,729 last-month
  • Total dependent packages: 3
  • Total dependent repositories: 3
  • Total versions: 24
  • Total maintainers: 1
pypi.org: ldtk

Toolkit to calculate stellar limb darkening profiles for arbitrary filters.

  • Documentation: https://ldtk.readthedocs.io/
  • License: GNU General Public License v2 (GPLv2)
  • Latest release: 1.8.5
    published over 1 year ago
  • Versions: 24
  • Dependent Packages: 3
  • Dependent Repositories: 3
  • Downloads: 3,729 Last month
Rankings
Dependent packages count: 3.2%
Average: 8.4%
Downloads: 8.8%
Dependent repos count: 8.9%
Forks count: 9.1%
Stargazers count: 12.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • numpy *
  • semantic_version *