{"id":41813460,"url":"https://github.com/hpparvi/ldtk","last_synced_at":"2026-01-25T07:08:47.722Z","repository":{"id":28387981,"uuid":"31902182","full_name":"hpparvi/ldtk","owner":"hpparvi","description":"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 \u0026 Aigrain, MNRAS 453, 3821–3826 (2015).","archived":false,"fork":false,"pushed_at":"2025-06-11T12:21:57.000Z","size":2125,"stargazers_count":32,"open_issues_count":5,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-25T16:50:02.770Z","etag":null,"topics":["astronomy","astrophysics","exoplanet-transits","exoplanets","limb-darkening-models","limb-darkening-profiles","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hpparvi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-03-09T14:13:54.000Z","updated_at":"2025-09-24T06:54:18.000Z","dependencies_parsed_at":"2023-12-19T12:04:57.988Z","dependency_job_id":"2d71d3b7-3580-4e54-afb4-3bd854712fdf","html_url":"https://github.com/hpparvi/ldtk","commit_stats":{"total_commits":186,"total_committers":8,"mean_commits":23.25,"dds":0.446236559139785,"last_synced_commit":"d116a5e8711716c00035ccb3c06dd7263f4dbfb8"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/hpparvi/ldtk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpparvi%2Fldtk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpparvi%2Fldtk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpparvi%2Fldtk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpparvi%2Fldtk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hpparvi","download_url":"https://codeload.github.com/hpparvi/ldtk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpparvi%2Fldtk/sbom","scorecard":{"id":470226,"data":{"date":"2025-08-11","repo":{"name":"github.com/hpparvi/ldtk","commit":"15c369aa76c9fd9867b4d57a38304751178f22bc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 2/13 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T13:42:49.954Z","repository_id":28387981,"created_at":"2025-08-19T13:42:49.954Z","updated_at":"2025-08-19T13:42:49.954Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28747308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T05:12:38.112Z","status":"ssl_error","status_checked_at":"2026-01-25T05:04:50.338Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","astrophysics","exoplanet-transits","exoplanets","limb-darkening-models","limb-darkening-profiles","python"],"created_at":"2026-01-25T07:08:47.181Z","updated_at":"2026-01-25T07:08:47.715Z","avatar_url":"https://github.com/hpparvi.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LDTk\n\n[![Licence](http://img.shields.io/badge/license-GPLv2-blue.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html)\n[![MNRAS](https://img.shields.io/badge/MNRAS-10.1093%2Fmnras%2Fstv1857-blue.svg)](http://mnras.oxfordjournals.org/content/453/4/3821.abstract)\n[![arXiv](http://img.shields.io/badge/arXiv-1508.02634-blue.svg?style=flat)](http://arxiv.org/abs/1508.02634)\n[![ASCL](https://img.shields.io/badge/ASCL-1510.003-blue.svg?style=flat)](http://ascl.net/1510.003)\n[![DOI](https://zenodo.org/badge/5871/hpparvi/ldtk.svg)](https://zenodo.org/badge/latestdoi/5871/hpparvi/ldtk)\n[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/)\n\nPython **L**imb **D**arkening **T**ool**k**it - 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).\n\n```python\nfrom ldtk import LDPSetCreator, BoxcarFilter\n\nfilters = [BoxcarFilter('a', 450, 550),  # Define your passbands\n           BoxcarFilter('b', 650, 750),  # - Boxcar filters useful in\n           BoxcarFilter('c', 850, 950)]  #   transmission spectroscopy\n\nsc = LDPSetCreator(teff=(6400,   50),    # Define your star, and the code\n                   logg=(4.50, 0.20),    # downloads the uncached stellar\n                      z=(0.25, 0.05),    # spectra from the Husser et al.\n                     filters=filters)    # FTP server automatically.\n\nps = sc.create_profiles()                # Create the limb darkening profiles\ncq,eq = ps.coeffs_qd(do_mc=True)         # Estimate quadratic law coefficients\n\nlnlike = ps.lnlike_qd([[0.45,0.15],      # Calculate the quadratic law log\n                       [0.35,0.10],      # likelihood for a set of coefficients\n                       [0.25,0.05]])     # (returns the joint likelihood)\n\nlnlike = ps.lnlike_qd([0.25,0.05],flt=0) # Quad. law log L for the first filter\n```\n\n![](notebooks/plots/example_profiles.png)\n![](notebooks/plots/example_coefficients.png)\n\n...and the same, but for 19 narrow passbands...\n\n![](notebooks/plots/qd_coeffs_narrow.png)\n\n## Overview\n\nLDTk 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).\n\nThe aim of the package is to facilitate exoplanet transit light curve modeling, especially transmission\nspectroscopy where the modeling is carried out for custom narrow passbands. The package can be  \n\n1. used to construct model-specific priors on the limb darkening coefficients prior to the transit light curve modeling\n2. directly integrated into the log posterior computation of any pre-existing transit modeling code with minimal modifications.\n\nThe 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.\n\n## News\n\n- Version 1.7 (22.7.2021)\n\n    - Improved the way the stellar limb is defined. LDTk now fits an LD model together with a smoothstep function to\n      find the edge of the star. This approach should remove the need for manual edge definition completely.\n      \n    - LDTk now resamples the original models to a linear sampling in mu since this makes LD coefficient estimation\n      more straightforward.  \n\n- Version 1.6 (4.5.2021)\n\n    - Added `ldtk.SVOFilter` filter class that creates a filter using the [Spanish Virtual Observatory (SVO) Filter \n      Profile Service (FPS)](http://svo2.cab.inta-csic.es/theory/fps/). The FPS contains over 10000 named filters, and\n      creating a filter based on the FPS data is now as simple as giving the `SVOFilter` the SVO filter name.\n\n- Version 1.5 (3.3.2021)\n\n    - LDTk can now use four different sets of the modelled stellar spectra: `vis`, `vis-lowres`, `visir`, and `visir-lowres`.\n      The first, `vis`, is the original one by Husser et al (2013) spanning from 50 nm to 2600 nm; `vis-lowres` is a lower\n      resolution version of the original dataset, binned to a 5 nm resolution; `visir` is a new version of the original\n      model set extended to span from 50 nm to 5500 nm; and `visir-lowres` is a lower resolution version of the new model\n      set binned to 5 nm resolution.\n      \n    - The model set can be chosen in the `LDPSetCreator` initialisation by setting the `dataset` argument. LDTk uses \n      `vis-lowres` as a default, but `visir-lowres` can be used when dealing with IR observations, and the original\n      versions (`vis` and `visir`) can be used if a spectral resolution higher than 5 nm is required.\n\n- Version 1.4\n\n    - Added automatic detection and re-download of corrupted fits files (a highly welcome contribution by T. Fatahi).\n\n- Version 1.3\n\n    - Changed to calculate the limb darkening models using numba. This should give a significant performance boost.\n\n- Version 1.2\n\n    - Added an option to use *low resolution* version of the original specific intensity spectra. These spectra are binned to \n      5 nm resolution in wavelength and are kindly hosted by T. Husser at the same FTP server as the original spectra.\n    - The behavior can be toggled with a new ``LDPSetCreator`` initialisation argument, ``lowres``.\n    - **LDTk uses now low resolution spectra by default**. This is because the wavelength resolution should be good enough \n      for most broadband photometry analyses, and the this decreases the download times and file storage sizes significantly.\n\n## Requirements\n### Core requirements\n- Python 2.7 or Python 3\n- NumPy =\u003e 1.7\n- SciPy =\u003e 0.16\n- tqdm\n- astropy\n\n### Notebooks\n- IPython =\u003e 3.0\n\n## Installation\n\nUse `pip`\n\n    pip install [--user] [--upgrade] ldtk\n\nor clone the source from github and follow the basic Python package installation routine\n\n```bash\n git clone https://github.com/hpparvi/ldtk.git\n cd ldtk\n python setup.py build install [--user]\n```\n\n## Examples\n\nExamples for basic and more advanced usage can be found from the `notebooks` directory.\n\n## Model coefficient estimation\n\n## Log likelihood evaluation\nThe ``LDPSet`` class offers methods to calculate log likelihoods for a set of limb darkening models.\n\n - ``lnlike_ln`` : Linear model\n - ``lnlike_qd`` : Quadratic model\n - ``lnlike_tq`` : Quadratic model with triangular parametrization (Kipping 2013)\n - ``lnlike_nl`` : Nonlinear model\n - ``lnlike_gn`` : General model\n - ``lnlike_p2`` : Power-2 model\n\n## Resampling\nThe limb darkening profiles can be resampled to a desired sampling in ``mu`` using the resampling methods in the ``LDPSet``.\n\n - ``resample_linear_z(nz=100)``: Resample the profiles to be linear in z\n - ``resample_linear_mu(nmu=100)``: Resample the profiles to be linear in mu\n - ``reset_sampling()``: Reset back to native sampling in mu\n - ``resample()``:\n\n## Main classes\n\n - LDPSetCreator : Generates a set of limb darkening profiles given a set of filters and stellar TEff, logg, and z.\n - LDPSet : Encapsulates the limb darkening profiles and offers methods for model coefficient estimation and log likelihood evaluation.\n\n## Citing\n\nIf you use LDTk in your research, please cite the LDTk paper\n\n    Parviainen, H. \u0026 Aigrain, S. MNRAS 453, 3821–3826 (2015) (DOI:10.1093/mnras/stv1857).\n\nand the paper describing the spectrum library without which LDTk would be rather useless\n\n    Husser, T.-O. et al. A\u0026A 553, A6 (2013) (DOI:10.1051/0004-6361/201219058).\n\nor use these ready made BibTeX entries\n\n    @article{Parviainen2015,\n      author = {Parviainen, Hannu and Aigrain, Suzanne},\n      doi = {10.1093/mnras/stv1857},\n      journal = {MNRAS},\n      month = nov,\n      number = {4},\n      pages = {3821--3826},\n      title = {{ldtk: Limb Darkening Toolkit}},\n      url = {http://mnras.oxfordjournals.org/lookup/doi/10.1093/mnras/stv1857},\n      volume = {453},\n      year = {2015}\n    }\n\n    @article{Husser2013,\n      author = {Husser, T.-O. and {Wende-von Berg}, S and Dreizler, S and Homeier, D and\n                 Reiners, A and Barman, T. and Hauschildt, Peter H},\n      doi = {10.1051/0004-6361/201219058},\n      journal = {A{\\\u0026}A},\n      pages = {A6},\n      title = {{Astrophysics A new extensive library of PHOENIX stellar atmospheres}},\n      volume = {553},\n      year = {2013}\n    }\n\n## Author\n\nHannu Parviainen, University of Oxford\n\n## Contributors\n\n- Rainer Wichmann, Hamburger Sternwarte, Universität Hamburg\n- [Tom Louden](https://github.com/tomlouden), University of Warwick\n- [Ian Crossfield](https://github.com/iancrossfield), University of Arizona\n\n--\n\nCopyright © 2016 Hannu Parviainen \u003channu.parviainen@physics.ox.ac.uk\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpparvi%2Fldtk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpparvi%2Fldtk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpparvi%2Fldtk/lists"}