Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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:
exoplanet
and want to report
or fix it.exoplanet
.All of these are excellent reasons to be here, so welcome!
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.
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
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.
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 . |
FAQs
The compiled backend for exoplanet
We found that exoplanet-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.