Skip to main content

orbix

PyPI Documentation Status Tests License Python 3.12+ DOI

A JAX library of functions for exoplanet simulations: differentiable Keplerian orbit propagation and Kepler-equation solvers, plus solar-system geometry (observatory position, keepout) for the Habitable Worlds Observatory direct imaging simulation suite. Scene composition (planet catalogs, EXOSIMS integration, zodiacal photometry) lives in other libraries; see below.

Install

pip install orbix

Quickstart

import jax.numpy as jnp
from hwoutils.constants import G, Msun2kg
from orbix.system import FrameOrbit, offset_arcsec, phase_angle_rad, distance_AU

orbit = FrameOrbit.from_classical(
    a_AU=1.0,
    e=0.0167,
    W_rad=0.0,
    i_rad=0.0,
    w_rad=0.0,
    M0_rad=0.0,
    epoch_d=0.0,
    mu_AU3_per_d2=G * Msun2kg,
)
time_d = jnp.linspace(0.0, 365.25, 5)
r_AU, v_AU_per_d = orbit.at(time_d)
beta_rad = phase_angle_rad(r_AU)
radius_AU = distance_AU(r_AU)
raoff, decoff = offset_arcsec(r_AU, 10.0)
print(r_AU.shape)  # (5, 3): (T times, xyz)

FrameOrbit stores a non-singular orbit frame and propagates through at(time_d). Times are days on the same origin as epoch_d; positions and velocities have shape (*batch, T, 3). System constructs Jacobi orbits for multiple bodies and returns a solve-once Ephemeris through solve(time_d). For a Julian-date schedule, set the reference date on SkyFrame.epoch and pass frame.time_d(jd=dates) to propagation and animation. Supply host dates so the subtraction keeps sub-day offsets before the device cast. The package root exports only __version__; import engine names from orbix.system and solver names from orbix.kepler.

Raw orbit rows are (east, north, away) in AU, a right-handed frame. Velocities share this order in AU/day; dz/dt is the body's radial velocity relative to the star, positive receding. state_vector_to_keplerian takes position and velocity in that frame. offset_arcsec returns (raoff, decoff) = (Delta alpha cos delta, Delta delta), east and north offsets in arcsec. Omega is the ascending (receding) node's PA measured north through east; i < 90 deg gives increasing PA, and omega is measured from that node in the direction of motion. Phase angle is beta, with cos(beta) = z/r; alpha denotes angular separation. See the documentation's sky-coordinate convention for details.

The default solver is the table-free Markley() strategy. Pass solver=Halley() or solver=Grid() to at, solve, or the non-singular kepler(mean_longitude, ex, ey, solver=...) function from orbix.kepler. It returns (sin(F), cos(F)) for lambda = F - ex*sin(F) + ey*cos(F), where (ex, ey) = e*(cos(p), sin(p)) and p is longitude of periapsis. All strategies support broadcasting and implicit forward/reverse derivatives, including circular orbits and higher orders. Enable jax.config.update("jax_enable_x64", True) for double-precision accuracy.

Orbits as fit parameters

orbix.system also describes an orbit as the free parameter of a fit. Three pieces work together:

  • A chart maps an orbit to a vector of real coordinates and back, with the exact volume of the map: ClassicalChart, EccentricityVectorChart, FrameChart, CartesianChart and ThieleInnesChart.
  • An orbit law is the prior density of an orbit, independent of the chart. OrbitLaw takes a law on the semi-major axis or the period and one on the eccentricity, with isotropic orientation and uniform phase.
  • A block combines a chart, a law and the rows of a System it frees. OrbitBlock works with every chart except the Thiele-Innes one, and ThieleInnesBlock frees one row through the Thiele-Innes chart and writes the star mass its coordinates imply. SkyPositionBlock frees instead the star-relative sky offsets of some planets at one time and holds the shape of each orbit, for a fit of a single image. All three follow the hwoutils.blocks.AbstractBlock contract, which is how photomancy fits use them.
import jax
from hwoutils.constants import G, Msun2kg
from orbix.system import (
    Body,
    EccentricityVectorChart,
    FrameOrbit,
    OrbitBlock,
    OrbitLaw,
    SkyFrame,
    System,
)
from priorities import LogUniform, Uniform

jax.config.update("jax_enable_x64", True)

orbit = FrameOrbit.from_classical(
    a_AU=[1.0],
    e=0.2,
    W_rad=0.5,
    i_rad=1.0,
    w_rad=0.3,
    M0_rad=0.0,
    mu_AU3_per_d2=G * Msun2kg,
)
system = System(Body(1.0), Body([0.0]), orbit, SkyFrame(10.0))

law = OrbitLaw(period_d=LogUniform(100.0, 10_000.0), eccentricity=Uniform(0.0, 0.9))
block = OrbitBlock(EccentricityVectorChart(), law, rows=(0,), system="")

x = block.sample(jax.random.key(0), system)  # {name: (1,)} per coordinate
orbits = block.forward(x, system)["orbits"]  # the freed row written into the orbits
log_p = block.log_prob(x, system)  # normalized density of the coordinates
print(block.coordinate_names)

Every coordinate takes any real value. A size coordinate that the law bounds is mapped onto the real line, by a logit on a finite interval or a softplus when one end is open, and named with the prefix mapped_ (mapped_ln_a_AU above), and the density includes the log derivative of that map. In the Thiele-Innes chart the sky position of a planet is linear in the four constants (A, B, F, G): sky_design gives the design matrix at a fixed orbit shape and linear_gaussian_conditional the exact Gaussian conditional of the constants under Gaussian astrometric errors.

Block coordinates and log densities require float64. A float64 block can fit a float32 System. It widens the model values for inference and returns each model update in the destination leaf's dtype. The linear astrometric fit requires a float64 orbit, and the Gaussian conditional requires a float64 design matrix.

A radial-velocity or phase-dependent likelihood can tell apart two orbits that share one sky track and differ only in the sign of the line-of-sight coordinate. line_of_sight_sheet reads that sign (+1 or -1) of an orbit, and reflect_line_of_sight(orbits, planet) returns the orbits with one planet mirrored through the sky plane, which has the same east and north positions at every time and the opposite away coordinate.

Observatory geometry

orbix.observatory places the telescope on its L2 halo orbit and answers whether a target is outside the keepout zones at a given time (Observatory.is_observable_at) or for what fraction of an interval (Observatory.observability). ecliptic_pointing returns the ecliptic latitude and helioecliptic longitude that the local zodiacal light models need.

Scope

orbix provides Keplerian orbit geometry, Kepler-equation solvers, and the charts, laws and blocks that make an orbit a fit parameter. Scene composition lives in skyscapes, and inference lives in photomancy.

Citation

If you use orbix, please cite it as described in CITATION.cff.

Metadata

Release files for orbix 6.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orbix 6.0.0
File Size Uploaded Provenance Actions
orbix-6.0.0.tar.gz 323.3 kB With provenance Details for orbix-6.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orbix 6.0.0
File Interpreter ABI Platform Actions
orbix-6.0.0-py3-none-any.whl Python 3 none any Details for orbix-6.0.0-py3-none-any.whl

Total release size: 483.0 kB

Release files / orbix-6.0.0.tar.gz

Download URL orbix-6.0.0.tar.gz
Size 323.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5d8372fa2fcced08dd461afe4919fa7c447d513f11de7e3d6d0504351e987555
BLAKE2b-256 checksum
How to use checksums
b3c2d7365388b6997bbc2ee80325c7d7420d8f73daaaeb2bcd9596b3ff6c3e18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / orbix-6.0.0-py3-none-any.whl

Download URL orbix-6.0.0-py3-none-any.whl
Size 159.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d2faf374c3d66df4abe289ee4a66445f798b2b703a2f90285c5a351d53b950e
BLAKE2b-256 checksum
How to use checksums
a576445b6bd28799596b11881a33b590c611f1bd99b144838eba9a2b3ded6c9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for orbix 6.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for orbix-6.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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