Skip to main content

coronagraphoto logo

PyPI Documentation Status Tests License Python 3.12+ DOI


coronagraphoto

coronagraphoto is a Python library designed to simulate coronagraphic observations of exoplanetary systems. The base "thing" it produces are images/photos, hence the name. It has been designed to bridge the gap between yield calculations and concrete image generation for missions like the Habitable Worlds Observatory (HWO).

The library integrates high-fidelity coronagraph models from the standard format used for yield calculations (dubbed a "Yield Input Package" and loaded via yippy) with detailed planetary system simulations (via ExoVista) to produce realistic detector images.

Built on JAX, coronagraphoto is fully JIT-compilable, differentiable, and GPU-accelerated, making it suitable for large-scale optimization and high-performance simulation.

Key Features

  • End-to-End Simulation: From astrophysical scenes to detector readouts.
  • JAX & JIT Compatible: High-performance simulations using functional programming patterns.
  • Modular Design: flexible optical paths, easily swappable coronagraphs and detectors.
  • HWO Ready: Specifically designed to support yield modeling for future direct imaging missions.

Installation

pip install coronagraphoto

(Note: You may need to install JAX separately to match your specific hardware acceleration requirements (CUDA/TPU/CPU).)

Design philosophy: "Bring your own physics"

coronagraphoto does not provide a single, black-box run_simulation() function. It provides per-source simulation functions and a thin orchestrator that sums them. Scene primitives (Star, Planet, Disk, System, Scene, backgrounds) live in skyscapes, and hardware primitives (OpticalPath, primaries, detectors, throughput elements) live in optixstuff. The convention:

  • Noiseless rates: <source>_rate(source, optical_path, *, observation_kwargs) returns the deterministic photo-electron rate map (electrons/s/pixel) for one source. These are differentiable, so they serve as the forward model for fitting and retrievals.
  • Noisy readouts: <source>_readout(source, optical_path, prng_key, *, observation_kwargs) adds photon Poisson and quantum-efficiency noise to produce one detector readout.
  • Whole-scene orchestrators: system_rate(scene, optical_path, *, ...) and system_readout(scene, optical_path, prng_key, *, ...) sum the star, every planet, the optional disk, the optional zodi, and the optional speckle field from a skyscapes.Scene.

This keeps the pipeline transparent (you know exactly which sources contributed), flexible (drop in custom noise, return spectral cubes, difference two scenes), and fast (each per-source kernel is JIT-cached at its natural shape boundary).

Quick start

Requires downloaded ExoVista and coronagraph data and a configured optical path.

import jax

jax.config.update("jax_enable_x64", True)  # Preserve orbital state-vector precision.

from optixstuff import ConstantThroughput, IdealDetector, OpticalPath, SimplePrimary
from yippy import EqxCoronagraph

from coronagraphoto import load_scene_from_exovista, system_readout
from coronagraphoto.datasets import fetch_coronagraph, fetch_scene

# 1. Load a skyscapes.Scene (system + default zodi) from an ExoVista file.
#    load_disk=False because this example skips the PSF datacube the disk
#    pipeline would need (set ensure_psf_datacube=True and drop the flag
#    to render the disk too).
scene = load_scene_from_exovista(fetch_scene(), load_disk=False)

# 2. Build the optical path from optixstuff hardware primitives + a yippy coronagraph.
coronagraph = EqxCoronagraph(fetch_coronagraph(), ensure_psf_datacube=False)
optical_path = OpticalPath(
    primary=SimplePrimary(diameter_m=6.0),
    attenuating_elements=(ConstantThroughput(throughput=0.9),),
    coronagraph=coronagraph,
    detector=IdealDetector(pixel_scale_arcsec=0.01, shape=coronagraph.psf_shape),
)

# 3. Simulate one detector readout. The epoch must lie inside the ExoVista
#    file's time grid (this demo scene covers JD 2451544.5 to 2455205.0);
#    epochs outside the grid return NaN flux.
image = system_readout(
    scene,
    optical_path,
    jax.random.PRNGKey(0),
    start_time_d=scene.system.epoch.days(2_452_000.0),
    exposure_time_s=3600.0,
    wavelength_nm=550.0,
    bin_width_nm=50.0,
    telescope_pa_deg=0.0,
    ecliptic_lat_deg=0.0,
    solar_lon_deg=135.0,
)

# Or the noiseless, differentiable forward model of the same scene:
from coronagraphoto import system_rate

rate = system_rate(
    scene,
    optical_path,
    start_time_d=scene.system.epoch.days(2_452_000.0),
    wavelength_nm=550.0,
    bin_width_nm=50.0,
    telescope_pa_deg=0.0,
    ecliptic_lat_deg=0.0,
    solar_lon_deg=135.0,
)

For broadband / IFS simulations, jax.vmap over wavelength_nm (and sum or stack the result) -- the kwarg-only signature is designed so the wavelength axis is a clean vmap target.

Detector rows increase along detector +y and columns along detector +x. telescope_pa_deg is the sky position angle of detector +y, measured north through east. At zero PA, imshow(image, origin="lower") shows north up and east left (the FITS display convention, with +column west). At PA 90 degrees, east lands along +row and north along +column. Planets and disk images use the same sky-to-detector transformation; see image orientation.

Speckles

Time-varying residual-speckle fields plug in through OpticalPath.speckle (any optixstuff.AbstractSpeckleField). When set, system_rate / system_readout add the speckle contribution automatically: the field's realize(wavelength_nm=..., time_s=...) contrast map is multiplied by the host-star flux and resampled to the detector, with evolution driven deterministically by time so that temporal correlation survives across a roll sequence.

Metadata

Release files for coronagraphoto 5.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 coronagraphoto 5.0.0
File Size Uploaded Provenance Actions
coronagraphoto-5.0.0.tar.gz 3.1 MB With provenance Details for coronagraphoto-5.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.1 MB

Release files / coronagraphoto-5.0.0.tar.gz

Download URL coronagraphoto-5.0.0.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
9e266c04a1a7ece311fb11c6cd2aad389d479be5dc080a9daff6e8257ce74b8b
BLAKE2b-256 checksum
How to use checksums
ffd5d4c88544391b60279fee1b45ca57c86ff3ed598c3f3993b4fc7c16a4e487
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 16, 2026.

Transparency log

Release files / coronagraphoto-5.0.0-py3-none-any.whl

Download URL coronagraphoto-5.0.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb91376215ecf00102db0683dac9e7e63de361b5938ffc836560f7c41f08791e
BLAKE2b-256 checksum
How to use checksums
b6ffa920206d524498fe77ead6efa6a63be08b26bea621c42bbbb582dbc9b60d
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 16, 2026.

Transparency log

Security for coronagraphoto 5.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 coronagraphoto-5.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 16, 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