Metadata-Version: 2.5
Name: zodi
Version: 1.1.0
Summary: Zodiacal and exozodiacal light brightness conventions with a single-source numpy/JAX core
Project-URL: Repository, https://github.com/CoreySpohn/zodi
Project-URL: Documentation, https://zodi.readthedocs.io
Author-email: Corey Spohn <corey.a.spohn@nasa.gov>
License: MIT License
        
        Copyright (c) 2026 Corey Spohn
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.12
Requires-Dist: array-api-compat>=1.9
Requires-Dist: numpy>=1.26
Provides-Extra: dev
Requires-Dist: pre-commit>=3.5; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-nb>=1.0; extra == 'docs'
Requires-Dist: sphinx-autoapi>=3.0; extra == 'docs'
Requires-Dist: sphinx-book-theme>=1.1; extra == 'docs'
Requires-Dist: sphinx>=7.2; extra == 'docs'
Provides-Extra: jax
Requires-Dist: jax>=0.4.33; extra == 'jax'
Requires-Dist: jaxlib>=0.4.33; extra == 'jax'
Provides-Extra: test
Requires-Dist: hypothesis>=6.100.2; extra == 'test'
Requires-Dist: ineedvalidation>=1.0; extra == 'test'
Requires-Dist: pytest-fail-slow>=0.1.0; extra == 'test'
Requires-Dist: pytest-markdown-docs>=0.4.3; extra == 'test'
Requires-Dist: pytest-testmon>=2.1.1; extra == 'test'
Requires-Dist: pytest-timeout>=1.3.1; extra == 'test'
Requires-Dist: pytest-xdist>=2.5; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

# zodi

<p align="center">
  <a href="https://pypi.org/project/zodi/"><img src="https://img.shields.io/pypi/v/zodi.svg?style=flat-square&logo=pypi" alt="PyPI"/></a>
  <a href="https://zodi.readthedocs.io"><img src="https://readthedocs.org/projects/zodi/badge/?version=latest&style=flat-square" alt="Documentation Status"/></a>
  <a href="https://github.com/CoreySpohn/zodi/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/CoreySpohn/zodi/ci.yml?branch=main&style=flat-square&logo=github&label=tests" alt="Tests"/></a>
  <a href="https://github.com/CoreySpohn/zodi/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" alt="License"/></a>
  <a href="https://github.com/CoreySpohn/zodi/blob/main/pyproject.toml"><img src="https://img.shields.io/badge/python-3.12%2B-blue.svg?style=flat-square&logo=python" alt="Python 3.12+"/></a>
</p>

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

## 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`).

## Documentation and evidence

Documentation is at [zodi.readthedocs.io](https://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 exists so the test suite can run
the JAX side. JAX users should enable float64:

```python
import jax

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

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](https://github.com/Cosmoglobe/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`. To run the JAX
side of the test suite, install the extras:

```
pip install "zodi[jax,test]"
```
