Metadata-Version: 2.4
Name: coronalyze
Version: 1.0.3
Summary: A JAX-based library for post-processing coronagraphic direct imaging data.
Project-URL: Homepage, https://github.com/CoreySpohn/coronalyze
Project-URL: Issues, https://github.com/CoreySpohn/coronalyze/issues
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 :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.9
Requires-Dist: equinox
Requires-Dist: jax
Requires-Dist: jaxlib
Requires-Dist: matplotlib>=3.10.8
Requires-Dist: numpy
Requires-Dist: pooch
Provides-Extra: coronagraphoto
Requires-Dist: coronagraphoto; extra == 'coronagraphoto'
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: docs
Requires-Dist: ipython; extra == 'docs'
Requires-Dist: myst-nb; extra == 'docs'
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: sphinx-autoapi; extra == 'docs'
Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
Requires-Dist: sphinx-book-theme; extra == 'docs'
Provides-Extra: test
Requires-Dist: hypothesis; extra == 'test'
Requires-Dist: nox; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://pypi.org/project/coronalyze/"><img src="https://img.shields.io/pypi/v/coronalyze.svg?style=flat-square" alt="PyPI"/></a>
  <a href="https://coronalyze.readthedocs.io"><img src="https://readthedocs.org/projects/coronalyze/badge/?version=latest&style=flat-square" alt="Documentation Status"/></a>
  <!-- <a href="https://github.com/CoreySpohn/coronalyze/actions/workflows/ci.yml/"><img src="https://img.shields.io/github/actions/workflow/status/CoreySpohn/coronalyze/ci.yml?branch=main&logo=github&style=flat-square" alt="CI"/></a> -->
</p>

---

# coronalyze

**coronalyze** is a JAX-based Python library for post-processing coronagraphic direct imaging data. It is designed as a companion to **[coronagraphoto](https://github.com/CoreySpohn/coronagraphoto)**, providing analysis tools for simulated and (maybe) real coronagraphic observations.

## Key Features

*   **SNR Estimation**: Mawet et al. (2014) aperture photometry SNR with small-sample corrections
*   **PSF Subtraction**: KLIP/PCA and reference differential imaging
*   **Planet Injection**: Forward modeling for yield simulations
*   **JAX-Native**: Fully JIT-compilable, differentiable, and GPU-accelerated

## Installation

```bash
pip install coronalyze
```

*(Note: You may need to install JAX separately to match your specific hardware acceleration requirements.)*

## Quick Start

```python
import coronalyze as cz
import jax.numpy as jnp

# Calculate SNR at planet positions using Mawet et al. (2014)
snr_values = cz.snr(residual_image, planet_positions, fwhm=4.5)

# Or use the estimator pattern for efficient batch processing
estimator = cz.snr_estimator(fwhm=4.5)
snr_values = estimator(residual_image, planet_positions)
```

## Pairing with coronagraphoto

```python
import coronagraphoto as cg
import coronalyze as cz

# Generate image with coronagraphoto
obs = cg.Observation(scene, coronagraph, settings)
obs.create_images()
science_image = obs.get_total_image()

# Get the star model for subtraction
star_model = obs.get_star_image()

# Subtract and calculate SNR
residual = cz.subtract_star(science_image, star_model)
snr_values = cz.snr(residual, planet_positions, fwhm=4.5)
```

## Design Philosophy

Like its companion `coronagraphoto`, `coronalyze` provides **primitives** rather than black-box functions. You compose the analysis pipeline that fits your science case.

## Documentation

Full documentation is available at [coronalyze.readthedocs.io](https://coronalyze.readthedocs.io).

