Skip to content

Repository files navigation

harv

Tests Docs License: MIT Python 3.12+


harv logo

harv is a Python package for inferring Keplerian orbital parameters of binary-star and star–exoplanet systems from time series data. Built on JAX, NumPyro, and unxt for units-aware computation.

It's pronounced harvey.

⚠️ Warning! ⚠️

harv is in rapid development and is pre-alpha. Meaning the API is not stable or guaranteed! Once the first version is released, we will have some guarantees about backwards compatibility, but there are no guarantees for API stability with the current development versions of this package. Sorry!

Installation

Requires Python 3.12+. Install from GitHub:

pip install git+https://github.com/adrn/harv

Or, if using uv:

uv add git+https://github.com/adrn/harv

Quickstart

Here are a few entry points to the documentation:

How it works

harv is built on the same tricks as The Joker (Price-Whelan et al. 2017) to make rejection sampling practical for Keplerian orbit inference. It uses a two-level parameterization that separates orbital parameters into:

  1. Nonlinear parameters (period, eccentricity, argument of pericenter, phase) — sampled directly from the prior via rejection sampling, and
  2. Linear parameters (RV semi-amplitude, systemic velocity, astrometric offsets) — these can be analytically marginalized given each set of nonlinear parameters.

This approach makes rejection sampling possible for high-dimensional parameter spaces by reducing the effective dimensionality of the sampling problem. The main utility of the rejection sampler is to map out the multi-modal posterior distribution of orbital parameters in the low signal-to-noise or low number of observations regime, which is challenging or impossible for MCMC methods. The samples returned by the rejection sampler are exact draws from the posterior distribution, and can be used to initialize MCMC samplers for further refinement, if necessary.

All objects are Equinox modules (valid JAX pytrees), so they work seamlessly with jax.jit, jax.vmap, and jax.grad.

Documentation

The full documentation is available at: harvey.readthedocs.io.

License

harv is free software released under the MIT License. See LICENSE for details.

About

Custom samplers for Keplerian orbit modeling (astrometry + radial velocity data)

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages