Skip to main content

The compiled backend for exoplanet

Project description



Tests

exoplanet-core

This repository contains the compiled components for the exoplanet project, with implementations for NumPy, JAX, and PyMC3. Most users probably won't install or interact with exoplanet-core directly, instead using it via exoplanet itself. However, there are a few reasons why you might be here:

  1. You want to evaluate a quadratically limb darkened light curve or solve Kepler's equation in numpy, JAX, or PyMC3, using fast and well-tested code.
  2. You might have found an issue with one of the compiled ops for exoplanet and want to report or fix it.
  3. You might be looking to build a better alternative to exoplanet.

All of these are excellent reasons to be here, so welcome!

Motivation

This library is developed separately from the exoplanet codebase for several reasons, but the main one is that the code in this repo needs to change at a less frequent cadence than the main exoplanet modeling code and there is some cost associated with re-compiling the backend. I'm hoping that this separation will make it easier for people to contribute to the exoplanet project without dealing with compilation issues. This also means that some users can use just the computational components here without the heavy dependencies required by the exoplanet project. This might be useful, for example, for people who just want a high performance solver for Kepler's equation or fast quadratically limb-darkened light curves.

Installation

The best way to install exoplanet-core is using pip:

python -m pip install exoplanet-core

By default this will only install the numpy ops and its dependencies (only numpy itself). So if you want to install the dependencies for the jax or pymc versions, you can run:

python -m pip install "exoplanet-core[jax]"
# or
python -m pip install "exoplanet-core[pymc]"

You can also install exoplanet-core using conda from conda-forge:

conda install -c conda-forge exoplanet-core

Usage

If you're developing new ops or fixing existing ones, you'll probably want to skip to the next section, but if you just want to solve Kepler's equation or compute a limb darkened light curve, you can use the following snippets.

To solve Kepler's equation and compute the true anomaly for an array of eccentricities:

from exoplanet_core import kepler

ecc = 0.3
M = # compute the mean anomaly as a function of time for your measurements

sinf, cosf = kepler(M, ecc)

# Use the true anomaly to evaluate your model

To compute the relative flux for a quadratically limb darkened light curve at some projected center-to-center distance b and radius ratio ror:

from exoplanet_core import quad_limbdark_light_curve

u1, u2 = 0.3, 0.2
ror = 0.05
b = # Compute the impact parameter as a function of time
flux = quad_limbdark_light_curve(b, ror)

where u1 and u2 are the usual limb darkening parameters and the resulting flux is in relative units where 0 is the unocculted flux. Some other implementations that you might be familiar with return this value plus one.

API Reference

exoplanet-core currently provides three ops, but only two are intended for general consumption: kepler and quad_solution_vector. The three interfaces (numpy, jax, and pymc) are designed to have the same API, so you can import them interchangeably as:

from exoplanet_core.{interface} import ops

where {interface} is numpy, jax, or pymc.

kepler

sin_true_anomaly, cos_true_anomaly = ops.kepler(mean_anomaly, eccentricity)

Solve Kepler's equation and convert to the true anomaly using a fast method (Brandt et al., in prep) that gives nearly machine precision across the full valid parameter range.

Parameter Type Description
mean_anomaly array This does not need to be range reduced.
eccentricity array Must be in the range [0, 1).
Returns Type Description
sin_true_anomaly array The sine and cosine of the true anomaly
cos_true_anomaly array evaluated at the input coordinates.

quad_solution_vector

soln = ops.quad_solution_vector(impact_parameter, radius_ratio)

Compute the "solution vector" as defined by Agol et al. (2020) for a quadratically limb darkened light curve. This can then be dotted into a vector of coefficients (a function of the usual limb darkening parameters) to compute the integrated flux.

Parameter Type Description
impact_parameter array The projected center to center distance.
radius_ratio array The radius of the occulter in units of the target.
Returns Type Description
soln array The quadratic solution vector at each impact_parameter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exoplanet_core-0.1.1.tar.gz (33.5 kB view details)

Uploaded Source

Built Distributions

exoplanet_core-0.1.1-cp39-cp39-win_amd64.whl (136.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

exoplanet_core-0.1.1-cp39-cp39-macosx_10_9_x86_64.whl (142.8 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

exoplanet_core-0.1.1-cp38-cp38-win_amd64.whl (136.7 kB view details)

Uploaded CPython 3.8 Windows x86-64

exoplanet_core-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl (142.3 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

exoplanet_core-0.1.1-cp37-cp37m-win_amd64.whl (137.8 kB view details)

Uploaded CPython 3.7m Windows x86-64

exoplanet_core-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl (141.4 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

exoplanet_core-0.1.1-cp36-cp36m-win_amd64.whl (208.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

exoplanet_core-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl (141.4 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

Details for the file exoplanet_core-0.1.1.tar.gz.

File metadata

  • Download URL: exoplanet_core-0.1.1.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 40efbb87aa1556304a37a8becddbed46a28b5f8846c5387cd2f791a3372ca0e6
MD5 454a5c0b4be1a0ad3959e8a84de626a8
BLAKE2b-256 6ccad90d9934aa5d77eea6ec4f6aefeacd6f0c28b1348c215bf12c59e1569141

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 136.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9e512c1ac8178331df6a7549b3e64363a32c2137cba319c7fcb783c859a14917
MD5 56023d5656dcb910e1c76f5c433a5d6c
BLAKE2b-256 e7c8eafcb12b70ff03563d1422e636519b4cf4dfcff545181613245868f516e6

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 208.7 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a40ad4a857b656c9425be3b57aedcf4c329322594ddf563a91d302a1b86fca1b
MD5 3e6d3dbef2c2bb152253a47f75af89ed
BLAKE2b-256 1e4697d867c6bce0d196570be6426c097edb67c3e0cbf7c1eb93d7ff0131c7fe

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 142.8 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 27f2cf106883e10c5a029654e10604e9963e4ed7376418fcfa98cc2e8230bd5e
MD5 8ee5057eb2b89995e96118b8860f982c
BLAKE2b-256 165bf6420c3798eb8e252f34605447952d608c738d701af24ac73ca9a748de8e

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 136.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a148e29119bf505c1d67204d55ee4f9c3e44dbb2d19fd0d160b6088bfc3cfd3e
MD5 92fb01e32048f25bf582f45801cc46b7
BLAKE2b-256 e6c21a8447a261e6d0c23ded6a9cacbc89b503309d819d8ae657d058492d1269

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 208.4 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9048ef15168b10d4367f99159c08ac910443d46d2ea485eb92666460632f917
MD5 eee65d47e31cd3ac9026f7ce5c8d1f24
BLAKE2b-256 25fc75c0fdec0b4d4d25dc025925370b366ec3ae1f74ae47a8e27bae8102cd02

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 142.3 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 58fb8e34873dbc50dad0fcde4b563bb9ab7d59a267f83150c2d7481bc87a192d
MD5 2f4c36cfcd01e0ee35442dd40b518f2e
BLAKE2b-256 38ffd5f749270418502daf11424b997d6c6f279933d4871fe92a192671a71797

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 137.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 447261b68576d633e58ecc9fdf4577de8b55ba06dbfbeeecc7f72de8090f0534
MD5 81db8675346a290c0a25ecc530a6cf3d
BLAKE2b-256 e3116180fdb4e4bf657963f086510586da9ef9bf3b9752f5461c076416af4e49

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 211.7 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26ebbdf92847811d40b35df0b20b836a63227aefa62b481aa5efb290eb6c3e49
MD5 019090bd924d485ea32076e6120f8b76
BLAKE2b-256 9b621e7ce09c1c4659ca2318319957c72b2ff2bd5a81c82042ce6fdfc0a6cf6c

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 141.4 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ad7cf39f1d4e115e8c03b0cd1639b8aa1565053127cd921f1c5d38a73a5894bb
MD5 02e972f50df7852300ee437c69b657f0
BLAKE2b-256 8ee1f2ab15c0276afba626cf5727073b88ece07464a00f3575efc9bf6e3483a4

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 208.3 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e6a9735768376339c75d40ce673b7c0490b39f529a60423e1ced6dd3e5343358
MD5 0698f4ad3503f19f3bb6725fa68160b2
BLAKE2b-256 40ba5725c78b7a888ae966ce593da5ea461d2ff823830a6db35797909b0de1db

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 211.6 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f73fcfefd280500450bb74e82c19be41254d7e0a1ea1c2d455be3cd94ddb1986
MD5 d2f197aad3762056a6db0992df722531
BLAKE2b-256 6e05e864149a4317422d14aa192bb17e18ba5c9fce5fb75bb9cc62b970013f21

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: exoplanet_core-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 141.4 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for exoplanet_core-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 34539ca995554869b007615f68dc68ba2245e3eb4f474b95c85eaccd265f846e
MD5 4208d1cc295d622f6860a132a54c6493
BLAKE2b-256 ac219e52682c928bc3e421086ef5b782c37fe872e5f0cf2f3c343b27cd28baf0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page