Skip to main content

zodi

PyPI Documentation Status Tests License Python 3.12+

Zodiacal and exozodiacal light brightness conventions for exoplanet imaging, from a single source that runs on numpy and JAX.

zodi is experimental: its API may change between major versions.

What it owns

  • Local zodiacal light surface brightness: the Leinert et al. (1998) Table 17 position dependence and Table 19 wavelength dependence, with the interpolation, anchoring, and near-Sun conventions of the production codes stated explicitly (zodi.specific_intensity, zodi.zodi_flux_ratio).
  • The exozodi chain of Stark et al. (2014), anchored at the EEID and numerically compatible with EXOSIMS calc_JEZ0, with the radial scaling measured from the EEID (zodi.exozodi_flux_ratio_v, zodi.jez0, zodi.scale_jez), the three published latitudinal models (zodi.latitudinal_factor), and the grey-scatterer band correction in both production flavors: the stellar-color scaling used by pyEDITH (zodi.exozodi_flux_ratio_band) and the scattered-plus-thermal spectrum model used by EXOSIMS, with its calibration as a closed-form least-squares fit (zodi.fit_grey_scatter_constants).
  • Unit conversions between the dialects in common use: magnitudes per square arcsecond, flux ratio per square arcsecond, spectral radiance, photon rates, and MJy per steradian (zodi.units).
  • Equinox local-background models (zodi.jax): AYOZodi, LeinertZodi, and PrecomputedZodi, sharing the AbstractLocalZodi interface.

Documentation and evidence

Documentation is at zodi.readthedocs.io. docs/conventions.md states every model, constant, and known cross-code difference with sources and measured deltas; docs/evidence.md maps each claim to an executable check and its kind of evidence. Cross-code benchmark scripts against EXOSIMS, skyscapes, and zodipy live in scripts/ and are runnable by anyone with those packages installed. Current results: exact agreement with the EXOSIMS closed-form models and magnitude chain, float64 round-off agreement with skyscapes, and 0.95-1.23 brightness ratios against the independent Kelsall model at 1.25 um.

Design

One implementation serves both backends through the array API standard. Functions compute in the namespace of their array inputs (via array-api-compat), so numpy callers get numpy in and numpy out with no JAX anywhere in their dependency tree, while JAX callers get functions that jit, vmap, and differentiate natively. Hard dependencies are numpy and array-api-compat only; the [jax] extra adds JAX, Equinox and hwoutils for the scene models and JAX array inputs. Importing zodi alone does not import JAX or Equinox. JAX users should enable float64:

import jax

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

The optional scene models evaluate the same namespace-generic physics:

import jax.numpy as jnp
from zodi.jax import LeinertZodi

radiance = LeinertZodi().photon_radiance(
    jnp.array([500.0, 550.0, 700.0]),
    ecliptic_latitude_deg=30.0,
    solar_longitude_deg=120.0,
)

Radiance is in photons/s/m2/nm/sr and preserves the wavelength shape. spectral_breaks_nm() returns a NumPy array of breakpoints in nm. AYOZodi and LeinertZodi return the Table 19 wavelengths. PrecomputedZodi returns its supplied wavelengths and evaluates to NaN outside their support. The analytic flat-AB AYOExozodi returns an empty array. The core functions, including zodi.specific_intensity and zodi.ayo_default_ab_mag, accept JAX arrays directly. Use zodi.units.AB_ZERO_POINT_JY * zodi.units.mag_to_flux_ratio(mag) for Jy/arcsec2, or scale zodi.ab_color_correction by a reference flux to construct a spectrum.

Random sampling is deliberately absent from the library: any distribution it exposes is a quantile function (inverse CDF), and callers bring uniforms from their own generator, whether that is numpy.random or jax.random.

Not this library

Structured circumstellar disks (rings, gaps, offsets) and scene rendering belong to scene simulators; solar-system ephemerides belong to the caller. For thermal-infrared zodiacal emission modeling, see zodipy; this library covers the reflected-light brightness conventions used in exoplanet direct imaging.

Install

pip install zodi

The hard dependencies are numpy and array-api-compat. For the Equinox models, install zodi[jax]. To also run the test suite, install:

pip install "zodi[jax,test]"

Metadata

Release files for zodi 2.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 zodi 2.0.0
File Size Uploaded Provenance Actions
zodi-2.0.0.tar.gz 60.6 kB With provenance Details for zodi-2.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 89.7 kB

Release files / zodi-2.0.0.tar.gz

Download URL zodi-2.0.0.tar.gz
Size 60.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4a0dab6079e4c008d3484a321b5205367a9246693144e2272510902fb679637e
BLAKE2b-256 checksum
How to use checksums
79b22741b0784e4072f2a6cd0dc6e6ec392f6f17c72b87cd0f8a7402ca30cfe4
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 19, 2026.

Transparency log

Release files / zodi-2.0.0-py3-none-any.whl

Download URL zodi-2.0.0-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43af493cfcbdc4b987fdda3deb216aaeb354724e681c529fcf9fc775fc832738
BLAKE2b-256 checksum
How to use checksums
9510827a2e581fa619da49887705937aca3e596c3bdb0adc92658a36d5ed25ba
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 19, 2026.

Transparency log

Security for zodi 2.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 zodi-2.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 19, 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