A collection of tools for exoplanetary and stellar astrophysics.
Project description
exohelp
A Python library of tools for exoplanetary and stellar astrophysics. Provides vectorized, unit-aware functions built on astropy and numpy.
Installation
pip install exohelp
Or with uv:
uv add exohelp
Quick Start
import exohelp as eh
# Kepler's third law
period = eh.keplers_third_law(semi_major_axis=1.0, mass=1.0) # → days
# Transit geometry for a planet
from exohelp.planet.summary import derived_planet_quantities
qtable = derived_planet_quantities(
period=3.5, # days
r_planet=2.0, # R_earth
r_star=1.0, # R_sun
m_star=1.0, # M_sun
teff_star=5778, # K
m_planet=10.0, # M_earth
j_mag=8.5,
)
print(qtable)
All public functions accept plain floats (in canonical units), numpy arrays, or astropy.Quantity objects.
Modules
Body properties
from exohelp.body import bulk_density, surface_gravity, log_surface_gravity
bulk_density(mass, radius) # M_earth, R_earth → g/cm³
surface_gravity(mass, radius) # M_earth, R_earth → m/s²
log_surface_gravity(mass, radius) # M_earth, R_earth → dex (cgs)
Kepler's third law
from exohelp import keplers_third_law
# Solve for any one parameter by passing it as None (default)
period = keplers_third_law(semi_major_axis=1.0, mass=1.0) # → days
a = keplers_third_law(period=365.25, mass=1.0) # → AU
mass = keplers_third_law(period=365.25, semi_major_axis=1.0) # → M_sun
Default units: period in days, semi-major axis in AU, mass in M_sun.
Planet
Transit geometry
from exohelp.planet.transit import (
impact_parameter, orbital_inclination, transit_depth,
transit_duration_total, transit_duration_flat, transit_duration_ingress,
a_over_r_star, geometric_transit_probability, transit_quantities,
)
transit_quantities(period, r_planet, r_star, m_star, b, eccentricity, omega) returns a QTable with all geometry columns at once.
Planetary properties
from exohelp.planet.properties import (
insolation_flux, # L_sun, AU → S/S⊕
equilibrium_temperature, # K, AU → K
hill_sphere_radius, # AU, M_earth, M_sun → AU
)
Radial velocity
from exohelp.planet.rv import planet_mass_from_rv, rv_semi_amplitude
m_planet = planet_mass_from_rv(rv_semi_amplitude=5.0, period=10.0) # → M_earth
K = rv_semi_amplitude(m_planet=10.0, period=10.0) # → m/s
Uses fixed-point iteration on the exact Keplerian relation (no small-planet approximation).
Spectroscopy metrics
from exohelp.planet.spectroscopy import (
scale_height, # K, m/s², amu → km
transmission_signal_size, # km, R_earth, R_sun → ppm
transmission_spectroscopy_metric, # TSM (Kempton et al. 2018)
emission_spectroscopy_metric, # ESM (Kempton et al. 2018)
)
Summary table
from exohelp.planet.summary import derived_planet_quantities
Returns a QTable with transit geometry, RV, bulk density, surface gravity, scale height, TSM, ESM, and more — depending on which optional inputs are provided.
Star
Activity and age
from exohelp.star.activity import sample_rotation_period_and_age
result = sample_rotation_period_and_age(
log_rhk=-4.5, log_rhk_err=0.05,
mag_b=6.0, mag_b_err=0.01,
mag_v=5.5, mag_v_err=0.01,
n_samples=10_000,
)
Returns a QTable with sampled rotation periods (prot_noyes, prot_mamajek) and ages (age_mamajek_gyro, age_mamajek_chromo) based on Noyes (1984) and Mamajek & Hillenbrand (2008).
Spectroscopic velocities
from exohelp.star.spectroscopy import sample_v_mic_and_v_mac
result = sample_v_mic_and_v_mac(
teff=5778, teff_err=50,
logg=4.44, logg_err=0.05,
n_samples=10_000,
)
# Columns: v_mic, v_mac_bruntt (Bruntt 2010), v_mac_doyle (Doyle 2014)
Rotation period from v sin i
from exohelp.star.spectroscopy import sample_rotation_period_from_vsini
result = sample_rotation_period_from_vsini(
vsini=3.0, vsini_err=0.3,
r_star=1.0, r_star_err=0.05,
)
# Column: max_rotation_period (days) — upper limit when inclination is unknown
Archive
Requires the archive dependency group (httpx, pandas):
uv sync --group archive
from exohelp.archive import ConfirmedExoplanetLoader
loader = ConfirmedExoplanetLoader()
df = loader.load() # fetches from NASA Exoplanet Archive, caches locally
Conventions
- Units: Plain floats are interpreted in canonical units (documented per function). Pass
astropy.Quantityfor explicit unit control. - Vectorized: All functions accept numpy arrays and
astropy.Quantityarrays. - Masked arrays: Functions with validity ranges (e.g., chromospheric age) return
numpy.mamasked arrays rather than raising errors. - Monte Carlo functions: Return
astropy.table.QTablewith column descriptions citing source equations.
Development
uv sync --group dev --group test
pre-commit install
pytest # run tests
pre-commit run --all-files # lint and format
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file exohelp-0.1.2.tar.gz.
File metadata
- Download URL: exohelp-0.1.2.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d5ca2e176599616032b5d66832cb3b13726a52562e3471050b4135aef8dd784
|
|
| MD5 |
39970790e47e57ac18c2e82e135b7083
|
|
| BLAKE2b-256 |
f77a2fa2f8e48cba17d04cda6ff87bfb007be59c105c9320a4a88fa595a3ac10
|
Provenance
The following attestation bundles were made for exohelp-0.1.2.tar.gz:
Publisher:
publish.yml on dgegen/exohelp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exohelp-0.1.2.tar.gz -
Subject digest:
6d5ca2e176599616032b5d66832cb3b13726a52562e3471050b4135aef8dd784 - Sigstore transparency entry: 1188605949
- Sigstore integration time:
-
Permalink:
dgegen/exohelp@faf4eff73655dbd6ef0ba252267dbbb8934d9899 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/dgegen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@faf4eff73655dbd6ef0ba252267dbbb8934d9899 -
Trigger Event:
push
-
Statement type:
File details
Details for the file exohelp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: exohelp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 29.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a13c66e4364c764a02471900e8f630068991ae1c63e2376114385156bf384470
|
|
| MD5 |
ce74e570d27f51efb29d811ed7405335
|
|
| BLAKE2b-256 |
6dee59142f469af1c26513ad6a5ea8901978dda3b0fcb443bfcf9c98f5cf2f54
|
Provenance
The following attestation bundles were made for exohelp-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on dgegen/exohelp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exohelp-0.1.2-py3-none-any.whl -
Subject digest:
a13c66e4364c764a02471900e8f630068991ae1c63e2376114385156bf384470 - Sigstore transparency entry: 1188605951
- Sigstore integration time:
-
Permalink:
dgegen/exohelp@faf4eff73655dbd6ef0ba252267dbbb8934d9899 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/dgegen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@faf4eff73655dbd6ef0ba252267dbbb8934d9899 -
Trigger Event:
push
-
Statement type: