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.2.tar.gz (33.5 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

exoplanet_core-0.1.2-cp39-cp39-manylinux2014_x86_64.whl (208.7 kB view details)

Uploaded CPython 3.9

exoplanet_core-0.1.2-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.2-cp38-cp38-win_amd64.whl (136.7 kB view details)

Uploaded CPython 3.8 Windows x86-64

exoplanet_core-0.1.2-cp38-cp38-manylinux2014_x86_64.whl (208.4 kB view details)

Uploaded CPython 3.8

exoplanet_core-0.1.2-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.2-cp37-cp37m-win_amd64.whl (137.8 kB view details)

Uploaded CPython 3.7m Windows x86-64

exoplanet_core-0.1.2-cp37-cp37m-manylinux2014_x86_64.whl (211.7 kB view details)

Uploaded CPython 3.7m

exoplanet_core-0.1.2-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.2-cp36-cp36m-win_amd64.whl (208.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

exoplanet_core-0.1.2-cp36-cp36m-manylinux2014_x86_64.whl (211.6 kB view details)

Uploaded CPython 3.6m

exoplanet_core-0.1.2-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.2.tar.gz.

File metadata

  • Download URL: exoplanet_core-0.1.2.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.5

File hashes

Hashes for exoplanet_core-0.1.2.tar.gz
Algorithm Hash digest
SHA256 33f25c7b77b3882cbf16a94636b791f68816b5d929fdb9c26d808bca93c7854e
MD5 8c41f3d3179671a4b9ccd49a7d84a744
BLAKE2b-256 fd97859b1186729df0a298c408931fe5acd7d2eb8844f03c19a4b78ed4d183ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1eb8c82d73b90e81237f06f3b6b62dff67ec904a931f5f96d6bd57041f3df8a4
MD5 1a511c51cea848a553c3b3696b45930c
BLAKE2b-256 56d8b6604760c42c57521464ba7fe8e6d26a560761b9ac72d1a136781eb692ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e48ec0adc9e656106b7a4b33fe5b9ccfc4f8b342fd49ef00b40acdc4d64ac916
MD5 1f61811e1df615e421baccd49423acdb
BLAKE2b-256 120e1ab8f32e5ed524dcfd688e1b437bb433e47cc74b2dacabe4caa764621a80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5c3954e7a6b15d8e649853c490bee105a4f4b7c3d5a9a8e18399bc00f6964507
MD5 713aabec91b70297c1c0c0a20e1be6e0
BLAKE2b-256 5f263f970f4fc095f74cb659af2a2065451c7c5b9817a799930fd1ac7b247204

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 db1f2835f98a69497ae678283aa30aaefde19b5f8fab167e598bbb042fd1217a
MD5 bf79d54da8228f6d37b6cb87c2af3975
BLAKE2b-256 9f2c5dd105d392d09028886f6cd7fc0ad6681d400508e6736103070df8f9fe19

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd0807361d43bdec2edcc2e557ce0c87c40dbda1c0b7548fe4b5788165b9b390
MD5 944d5a7fd80468ac1633405074853727
BLAKE2b-256 f47d7124c6b1326e1aa7d90d175671cdff46f1c547952c857e9e8969a4847788

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1fe291bef4402ac8c1c2e550b8772926b11fbe9b7d11a27de1617f10d36fcf89
MD5 afd61af2d8fd7356f60dfc5ee903c97f
BLAKE2b-256 057095f5815f6c456ca19199fd13a2469f2893e10819b357ebdf54350c5c9e2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 67566a6935c3c0d8dbe003db583804c056e23f41e1ea1c86b5a97aac8e1244b5
MD5 841249c5869483493349d71c8be54b94
BLAKE2b-256 38316ed7b649af643214d1bfdabafeaaf05048b65ec8db3efb001ccdd512cd43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2c1065ba71636c6d187722c8271cab8c143808e5c44a5dfeb6568227a0158460
MD5 e01b5674cc43f640a71a15442ba079dd
BLAKE2b-256 386f643f2ba4906ef5aa3d51a0d0bb245632cd4a8f6a6f0abf4cb9429d09b0b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 41f5b24a473944d2e9f9ca26332270ddb9b0ad3e8e020d7d9ffa9a1a1494ab7e
MD5 125cca50c0217ec8fca2a8545736f991
BLAKE2b-256 85afee4171c161e4f697dcee52326adb37954e3ed5fe5b8e0336ea9fe389c4eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d729f118ab9e40fc2d714fdd26715bcf960b286dc2db7cb3a3960e277b317bc8
MD5 56f547761ccef5880b1473446c476642
BLAKE2b-256 8e466950042ed24db7b08e01af1663ab787ad89a765a86038d60bc69ccfdc0fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be029b59a26b08fc5e81a8ef23208a755dedc50f938cafc3e4e72b2d61ad9813
MD5 69f84e15a8e80f78be32b83a4e46bcae
BLAKE2b-256 23442c45c9ce69262342109032084af8c0f2c23cce4d4d2e957140bb0b2f6f60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: exoplanet_core-0.1.2-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.5

File hashes

Hashes for exoplanet_core-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9d60bbbfd020136efc102aad7cff0ce9903590558bd1968c29c1d852237ea278
MD5 893ef295e48196a3adfdc0c20b22db4a
BLAKE2b-256 2c438370f17d7361eae820d75b3accfb1bc33770ca97ab4bc75b2f09e92e5101

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