Skip to main content

MeepMeep

Fast Keplerian orbits for exoplanet modelling.

MeepMeep computes Keplerian orbit quantities — transit geometry, projected separations, radial velocities, and phase curves — using 5th-order Taylor expansions around a set of expansion points distributed along the orbit. This makes it 2-3 orders of magnitude faster than standard Newton-Raphson approaches while keeping the approximation error well below the photometric noise of current instruments. Optional analytic gradients with respect to the orbital parameters make it suitable for gradient-based inference (HMC, optimisers).

All hot paths are Numba-jitted and can be called directly from your own @njit kernels with no wrapper overhead.

The method is described in Parviainen & Korth (2020), MNRAS 499, 3356.

Installation

pip install meepmeep

For a development checkout:

git clone https://github.com/hpparvi/meepmeep.git
cd meepmeep
pip install -e ".[test]"

Quickstart

import numpy as np
from meepmeep import Orbit

o = Orbit(npt=15, ep_placement="ea")
o.set_pars(tc=0.0, p=3.4, a=8.0, i=1.55, e=0.1, w=0.4)   # times in days, angles in radians
o.set_data(np.linspace(-0.15, 0.15, 500))

x, y, z = o.xyz()                       # sky-frame position (R_star); z > 0 toward observer
rv  = o.radial_velocity(k=120.0)        # radial velocity in the units of k

Bind tp=... instead of tc=... to anchor the orbit at periastron passage.

Analytic gradients

o = Orbit(derivatives=True)
o.set_pars(tc=0.0, p=3.4, a=8.0, i=1.55, e=0.1, w=0.4)
o.set_data(times)
x, y, z, dx, dy, dz = o.xyz()           # gradients w.r.t. (tc, p, a, i, e, w, lan), shape (N, 7)

Conventions

  • Units: times in days, angles in radians, lengths in stellar radii (a is the scaled semi-major axis a / R_star).
  • Parameter order (solvers and gradients): (tc, p, a, i, e, w, lan) — transit-centre time, period, scaled semi-major axis, inclination, eccentricity, argument of periastron, longitude of the ascending node. lan is optional and defaults to 0.0.
  • Coordinates: x, y span the sky plane; z is the line of sight, positive toward the observer. Transit occurs at z > 0, secondary eclipse at z < 0; i = pi/2 is edge-on.

Public API

Import Purpose
meepmeep.Orbit 3D, multi-expansion-point orbit; any orbital phase
meepmeep.Expansion2D / Expansion3D single-expansion-point, transit-window evaluators
meepmeep.numba2d / meepmeep.numba3d low-level @njit Taylor primitives

Testing

pip install -e ".[test]"
pytest meepmeep/tests/                                   # full suite
NUMBA_DISABLE_JIT=1 pytest -m "not slow" --cov           # with coverage

Coverage must run with the JIT disabled — compiled kernels are invisible to the tracer otherwise.

Documentation

Full documentation is built with Sphinx from docs/source/:

cd docs && make html      # output in docs/build/html/

Citing

If MeepMeep contributes to work that leads to a publication, please cite Parviainen and Korth (2020):

@ARTICLE{2020MNRAS.499.3356P,
       author = {{Parviainen}, H. and {Korth}, J.},
        title = "{Going back to basics: accelerating exoplanet transit modelling using Taylor-series expansion of the orbital motion}",
      journal = {Monthly Notices of the Royal Astronomical Society},
         year = 2020,
        month = dec,
       volume = {499},
       number = {3},
        pages = {3356-3361},
          doi = {10.1093/mnras/staa2953},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2020MNRAS.499.3356P},
}

License

MeepMeep is released under the GNU General Public License v3.0. See LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meepmeep-1.1.0.tar.gz (667.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meepmeep-1.1.0-py3-none-any.whl (254.9 kB view details)

Uploaded Python 3

File details

Details for the file meepmeep-1.1.0.tar.gz.

File metadata

  • Download URL: meepmeep-1.1.0.tar.gz
  • Upload date:
  • Size: 667.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.9

File hashes

Hashes for meepmeep-1.1.0.tar.gz
Algorithm Hash digest
SHA256 86b2aaff50f34f06d4740a425ab558d9cb4599950ed2f9415b672940e2c30234
MD5 ac48f582389f7a81bb261d47e364be76
BLAKE2b-256 bbec0b2bed9d28a269aaa83cdc9e451d9ddc064310720feff8527b9bd170bd7b

See more details on using hashes here.

File details

Details for the file meepmeep-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: meepmeep-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 254.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.9

File hashes

Hashes for meepmeep-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94523b1e786e20b9ff8a88681ac5c51ef7b31c36f84ebdf7d6cd0ca8d40f9afd
MD5 4f2d142b10c4c8896e5ded3d9c2502dd
BLAKE2b-256 9c667ceb2526d72993c51a23534e6779818917f93f5389879330126c0b6f2b10

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

1.0.0

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page