Skip to main content

3D orbital probability clouds from simulated exoplanet posteriors

Project description

orbcloud

orbcloud is a Python package designed to transform simulated exoplanet parameter posteriors (such as MCMC chains) into physical 3D orbital probability density clouds.

By plotting thousands of low-opacity orbital paths, the overlapping threads naturally highlight the high-probability regions of 3D orbital space, creating a beautiful and physically accurate visualization.

[!TIP] In addition to visualization, orbcloud can be useful to rule out possible dynamical instability in the system. Visually mapping the orbital probability clouds allows researchers to quickly identify overlapping orbital regions. This helps save significant time and computational resources by avoiding expensive N-body simulations if a visual inspection already reveals that the system is most likely going to be unstable.


Features

  • Vectorized Kepler Solver: Vectorized Newton-Raphson solver to compute eccentric and true anomalies over custom phase grids.
  • Physical Star Customization: Built-in star properties database (e.g. Vega, Barnard's Star) that automatically adjusts the size and glowing spectral color of the central star.
  • Top (2D) & Lateral (3D) Views: Easily render orbits in 2D, 3D, or side-by-side.
  • Transparent Alpha-Clouds: Line-by-line low opacity (alpha=0.02) plots that naturally map the probability clouds.
  • Robust Parameter Validation: Informative alert messages and correction suggestions to prevent unphysical values (e.g. eccentricity $\ge 1.0$) or solver failures.

Installation

pip install orbcloud

Dependencies: numpy, matplotlib


Quickstart

Here is how to set up and render a multi-planet system:

import matplotlib.pyplot as plt
from orbcloud import PlanetConfig, SystemEnsemble

# 1. Initialize the system around a customized star (e.g. M-type dwarf)
system = SystemEnsemble(star_name="Custom Star", star_mass=1.6, star_type="M")

# 2. Configure planets with mean parameters and uncertainties
planet_b = PlanetConfig(
    name="Planet b",
    P_mean=90.0, P_std=8.0,
    omega_mean_deg=60.0, omega_std_deg=40.0,
    e_mean=0.15, e_std=0.09
)

planet_c = PlanetConfig(
    name="Planet c",
    P_mean=260.0, P_std=14.0,
    omega_mean_deg=210.0, omega_std_deg=45.0,
    e_mean=0.25, e_std=0.10
)

# 3. Add planets to simulate posterior distributions and pre-compute 3D coordinates
system.add_planet(planet_b, num_samples=1000)
system.add_planet(planet_c, num_samples=1000)

# 4. Plot 2D and 3D clouds side-by-side
system.plot_system(show_reference_plane=True)

# 5. Save the result
plt.savefig("system_plot.png", dpi=150, facecolor="white", bbox_inches="tight")
plt.show()

Development & Testing

Run unit tests via pytest:

python3 -m pytest -v

License

This project is licensed under the MIT License.

Project details


Download files

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

Source Distribution

orbcloud-0.1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

orbcloud-0.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file orbcloud-0.1.0.tar.gz.

File metadata

  • Download URL: orbcloud-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for orbcloud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1b90cd996401ce523e36066a9704fd26d00146ba9e3b5cea0b7a3d268be89a8
MD5 e0e6200c07e8ccf1e1fc16a379f17d78
BLAKE2b-256 a373b4832379cbfe9b870fab2b1969af432f07de59928f3c0a8ca58203c7cafd

See more details on using hashes here.

File details

Details for the file orbcloud-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: orbcloud-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for orbcloud-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c8dc4619f77c43fcd6ed8d2229553199418867127b20d3f06729a10b0a50d1c
MD5 9e1f8b05c33cbec29a52f77782f46961
BLAKE2b-256 c858ea3e7c1a92fc8b0f8a113f3081620065b7137121dead3fa2d9cc1c96ac24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page