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(u1, u2, 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.3.1rc1.tar.gz (32.2 kB view details)

Uploaded Source

Built Distributions

exoplanet_core-0.3.1rc1-cp312-cp312-win_amd64.whl (159.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

exoplanet_core-0.3.1rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (205.8 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

exoplanet_core-0.3.1rc1-cp312-cp312-macosx_11_0_arm64.whl (136.3 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

exoplanet_core-0.3.1rc1-cp312-cp312-macosx_10_9_x86_64.whl (146.7 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

exoplanet_core-0.3.1rc1-cp311-cp311-win_amd64.whl (159.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

exoplanet_core-0.3.1rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (206.6 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

exoplanet_core-0.3.1rc1-cp311-cp311-macosx_11_0_arm64.whl (137.8 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

exoplanet_core-0.3.1rc1-cp311-cp311-macosx_10_9_x86_64.whl (149.7 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

exoplanet_core-0.3.1rc1-cp310-cp310-win_amd64.whl (156.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

exoplanet_core-0.3.1rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (203.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

exoplanet_core-0.3.1rc1-cp310-cp310-macosx_11_0_arm64.whl (135.4 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

exoplanet_core-0.3.1rc1-cp310-cp310-macosx_10_9_x86_64.whl (146.7 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

exoplanet_core-0.3.1rc1-cp39-cp39-win_amd64.whl (157.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

exoplanet_core-0.3.1rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (203.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

exoplanet_core-0.3.1rc1-cp39-cp39-macosx_11_0_arm64.whl (135.6 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

exoplanet_core-0.3.1rc1-cp39-cp39-macosx_10_9_x86_64.whl (146.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file exoplanet_core-0.3.1rc1.tar.gz.

File metadata

  • Download URL: exoplanet_core-0.3.1rc1.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for exoplanet_core-0.3.1rc1.tar.gz
Algorithm Hash digest
SHA256 75ec57c7007b436054be3b041e31cbdd990446a0eeab0fe60161c9ac73ad5f9a
MD5 daed366bff0633e6fb3971869c88b65b
BLAKE2b-256 06ba0c0869bd506ccb6f980c2ce5cdff2957320a042256b17fde031819a0a773

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 906784827c40843b95f1a827d92777d7c0442ce6b0b6127ed64f6f4a11c496d7
MD5 9da0b2db4a5a309526a567782ceb5128
BLAKE2b-256 0a2190cc37d11d53b929f75e91a2be48ee9929114da81e8caed6b2966b17ea14

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 db5bb0bdf2caf7a4b4335b36e3cd893932b2213edcdbfde7122143c5d1998bd3
MD5 c6161ecfc96973e66825250ce3556bfb
BLAKE2b-256 b5ea964edf13adcf269fd31ecbd2b863042e823093d9d34a29196c0f70640ed7

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d3746da9c68bbce81402bc81ab56703fbb991d647d03f52aca8fffeb23034ac
MD5 6775edda4e75e99544e7bb974949f4db
BLAKE2b-256 d589c7996091ea70abf0d0fa1dacd57779642aa2431ee7f213ac04dd2b9ec10a

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8726fa1a50632bce1a7b6b5c7d2ba1714a811cfc99a2a6ac92a6794f1d2d2e00
MD5 ff2a1639846ca41074a73361e5498a90
BLAKE2b-256 bd37237da9d30efbc91646af86d0dc2a76204728d9dbc66bed47ac6391f3420b

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1a592a0a25d5f69bee0533f8a33ebf1c6270008a4fe5dccd61e9424f50f40894
MD5 590114f8113cada4435511743acd2d40
BLAKE2b-256 d6f119de41a671f870824c8289f5f7f6e91bc1cbcde05bbec102dee86f167c79

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e9e9ce38d89636304cda4be7bfc7646656bcab51c8952db6f4cdf6f93c37168
MD5 4f6da7ba9bf36b23c6a444aed19345f9
BLAKE2b-256 9380fec2ef369d2c348e19e4b2d9cbb11a37c3c2ff507de8c2208023b718e5b9

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7c55b7d047951dbb5bf9ce13967d01a0265540fe39586028da22564f52f8ec8
MD5 88aa4091e85982a3ef6344257d5dae41
BLAKE2b-256 ce7d0bc403a124ac0cc547d72af86fde6ce7b426e0ec1a461514e55c5974f19f

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 95df8f00d25b071b717adc047ce4a64a5c53f959f1f160983073719c98f81b43
MD5 9b0842ad3cbaf597c5cf9519d2e8207f
BLAKE2b-256 7aa3a121727fcb9b70d8ba28cc48b67507025a528a9912cb2170015e6d93749c

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e55717e0d16684fd23181155af604d94b6b2150294c326863880cc47ca39c002
MD5 f6e9bd5fff22b56e60ae515e84c3367b
BLAKE2b-256 2aafd8fce77ace78f8d2aff4822f124cd89a42792ba4856b933a8dc271fac03b

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6f5f915e59a4e270088fbdd73d92aad0c9a97fc1fe3dab07e5bf3ed10429b785
MD5 991dff9020aec4b664f2662ca5a2ba4e
BLAKE2b-256 33e015590350f82f477ed42e51eb27e78db44a06af4aedea3eb5a61edd19635a

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dff733aadee8df963473b9f204949f4f074d17146c5a71bbb289dfb0e253b826
MD5 a249cd96c5fa067603b7e3c12993c8c1
BLAKE2b-256 47f4c80f19a514141689a523944ab1f448247f9adf97bc583f881be42e9cc3a2

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4787f633b77eb51bcf3fea4238e224e89a5856051c1e32c92ebf2db47d25e6ac
MD5 b12cddd1a2072703a0a941bb8f109a89
BLAKE2b-256 f8710bd76952407cd68d392e9b77eaa6b62337bedf2432459d7de6f66c35c144

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 00647534f3f281048a79c9a4bbbfc66e1d06dff6a1dd642ce5df673ebf8b058f
MD5 2d065077335d3a1e043c4e6f00c4d08a
BLAKE2b-256 8691f21fb87c8cd382b8444acc6353b24c644a6a46623467d73b0f30cc111502

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b9ef7bdc63692cc5d26b8fa803f78a5b2060de859a21cd3f0f8640e84ec5f683
MD5 3500292f2965fe95c29f53540b9f5540
BLAKE2b-256 2c62a9f552d06e69e6265617bbe820804728d78cbbf54f193599a99a54e1e7f7

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1472108781bd11ee31e1681237dcde719c90afeb86a226309087539c5440a3df
MD5 93e2c02e70f5102f406c68b927f075a5
BLAKE2b-256 d0b16f7182454414bf9dd962f717362705086f32ab1ec987f91cfd77762b4999

See more details on using hashes here.

File details

Details for the file exoplanet_core-0.3.1rc1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for exoplanet_core-0.3.1rc1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 538e6b678fe083adae576c7b0bf8ee8994d56c79fe08dc371870d3bcb8ce59c1
MD5 6fac1a34d4cc9afa44a4b903cc608f83
BLAKE2b-256 fe32b011eb425d23f9feda63169cefdea66249b20bf7342a36a384690da5673d

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