The compiled backend for exoplanet
Project description
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:
- 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.
- You might have found an issue with one of the compiled ops for
exoplanet
and want to report or fix it. - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for exoplanet_core-0.3.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d723a4ff3e8edb3ada5922687fbc4d1f1fa2ba949b344a842eb0af87b10bcb7 |
|
MD5 | 6bde56640b8348faf50afd0a9826f224 |
|
BLAKE2b-256 | 9d9e072408a5f099cf5fa6c0e821e7258c846bca254ba1acc669fb4650717823 |
Hashes for exoplanet_core-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f957d1c93b9acab2551c1bcbbe88b7205178f9d59d8d52f7836c8f2ce53f8062 |
|
MD5 | dbca565c0d091af4915b81fd40881740 |
|
BLAKE2b-256 | b24258beb25cf25aa5b64b3b4ea250a72bd0a1b9840fef65168def11e2fc69f4 |
Hashes for exoplanet_core-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 418463fa07fd8f4fed4f7b4fa6416dfd7dc359af94f9fb36565ebd365821576c |
|
MD5 | 433d161a105182176bdac557dab27dba |
|
BLAKE2b-256 | 151074c7719c1a71d793574a150749b2d4bb8d56f9aac53519239fb1f861dd94 |
Hashes for exoplanet_core-0.3.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e2bcf0e9b48195818073c7d89b895a1201841d6da3b390739597c248e73de15 |
|
MD5 | 081dcb9b3a633401a6824fff2563e734 |
|
BLAKE2b-256 | 1939c714cbc82484d3aeb271384b19bae805fa0a02bf27c0f7be648f3d7af9d8 |
Hashes for exoplanet_core-0.3.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54d739039eaabf0304d07cb2e5551f03ad6e75e8af6a133bfb88baef74f4d6d1 |
|
MD5 | 6f012ffb0b65088aa7ec4a543d0c44a2 |
|
BLAKE2b-256 | 6327229decfd56d531aab9ff01fcc2556c7ab7e40dcc9a3ea023edc5c44b4107 |
Hashes for exoplanet_core-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c450d0e32ddf2e741092a2e86d15d0bdf03f27ea1c95d1a85a71997a53615495 |
|
MD5 | b3933a6c453fc7bd7e1eeec8ae2c72f2 |
|
BLAKE2b-256 | c729e661e6dca11d45f372f604140b9fa34cf28ebcc2ee493199e72b4d54ca6e |
Hashes for exoplanet_core-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8ee4e9908797add276c41fc1f65a168065d17db7ea1d3ee790f4a55bc33a03b |
|
MD5 | 6d653cadafcb8ce5ae783c1e26061f44 |
|
BLAKE2b-256 | 680d5541606b07757e36a81bbf434cdd2131d2edf2046a1b0e0169f3556bc318 |
Hashes for exoplanet_core-0.3.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f9dd3aba365e7f143fcd85f53d3f383ede1225be193c09c2aa74c5bbc854bc |
|
MD5 | ce2db359bea7b92c74be422572267cad |
|
BLAKE2b-256 | 6f3e042c2f78bb018d0b65816b9c4dc3e47c1ddd89747b11fb60b2b2a2b694e0 |
Hashes for exoplanet_core-0.3.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15da68790573fe46917d69e21d4d5a39f89cb9f1b7b563f62fdbecd183b521a4 |
|
MD5 | 029bf8f72a40149a067e8f711bfa178f |
|
BLAKE2b-256 | 32c8fb4d948af38ccb2730606e1892409893c2581867e706257e89b0b8251d3e |
Hashes for exoplanet_core-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d011332537b38d7fbef1e9947de809d05a2639a40c1a1d5fd6b90c2405450dc1 |
|
MD5 | e466343970ebc4e48d08aa2651def549 |
|
BLAKE2b-256 | 8b94db93f89774eae8f3478a97a74aaa51024d7ade5953c98e0eb82b2b1b15b3 |
Hashes for exoplanet_core-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c6f1a186ed423449303d3bc871d0eac4b39e9cea42ebd3c509cd20f1bfaf8ae |
|
MD5 | b1a63a8678d43fb94010027de40f30fc |
|
BLAKE2b-256 | c0c825dd060a29f5f3138b3d81c3ff90b09a16a710f47da80273a2a539dd7d6e |
Hashes for exoplanet_core-0.3.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 470bb6dde44184907a76c8f06587994bc3b3bbbac7bd9ec05088562e314ea1fc |
|
MD5 | 8c0e1e1d763b90e4d0c72f91588f4e49 |
|
BLAKE2b-256 | d45cc7289f248565441e7c5fe1da026cff075228ea53e0716ecc31612e42ece3 |
Hashes for exoplanet_core-0.3.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d2bed27cf55bfd4f4b47086798402e156794bcff60c7e14f2a86ee652e97bdf |
|
MD5 | 7577a19877270d34825abf71a0ad1546 |
|
BLAKE2b-256 | 5e2ec84c0edc1acabf3192830fd39f0bb825a1b87da17cf7c3fd2dc769f097ee |
Hashes for exoplanet_core-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15e64e0d0c8e845144655b9bc454abb787b97a06714f895768fe9d6d5c7ee483 |
|
MD5 | f56c9c991c67360395bd5c18058842bc |
|
BLAKE2b-256 | dbd0831a8fb5214e2a986b21ca9012788a6c2e5eafe04705a4c0182977c834c4 |
Hashes for exoplanet_core-0.3.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5b4a4256649c382adc808c65bd16fa727aac6e7333a3e9423c9c2f712b4eac2 |
|
MD5 | a5912598bba8d119c6db9b82eb4d45f6 |
|
BLAKE2b-256 | 2908697fcc2dfb8a9e1bf9f355023d9d50260c4cef0eceebeafd0d2478630631 |
Hashes for exoplanet_core-0.3.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 671471f4dc8cf5ebcbb52e0862505a05ab18e03637e7f48158aeec114727a419 |
|
MD5 | 62f24e658b46174837dd4dca8d93850f |
|
BLAKE2b-256 | fe203628ea1ce32b974230defc36d38f0eeb638e36ddcd1862929be785aa8a43 |