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 supports JIT compilation and differentiation of scene predictions with fixed instrument geometry. JAX provides CPU and accelerator execution.

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

Photon budgets and detector images

Scenes come from skyscapes; hardware and detector statistics come from optixstuff. The image reader provides three entry points:

Function Output Units
image_rates PhotonRates, each field (W, Q, ny, nx) photons/s/nm/pixel
image_electrons ElectronRates, each field (W, ny, nx) electrons/s/pixel
observe Image, data (W, ny, nx) electrons/pixel

The fields are planet, star_leakage, local_zodi, exozodi, thermal and stellar_companions; the reader does not model the last two, so they hold zeros. Call .total() to combine terms. Optical throughput excludes detector yield. Only detector.electrons applies QE and survival, at the quadrature nodes. observe calls detector.draw once on the combined electron budget.

image_electrons scans nodes and accumulates band images, holding one node's images at a time. image_rates retains all nodes for inspection and small problems. Build one quadrature on the host from the active scene and optical path. Its Gauss-Legendre rule splits at every declared break, including detector QE knots. Reuse that quadrature across readers.

Quick start

Enable float64 before loading orbital state vectors. This example downloads a public scene and YIP on first use; the epoch must lie in the scene's recorded time range.

import jax

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

from hwoutils.grids import SkyOrientation
from hwoutils.spectral import Band, Quadrature
from optixstuff import FramePlan, OpticalPath
from skyscapes.datasets import fetch_scene
from yippy import fetch_yip, open_yip
from coronagraphoto import image_electrons, load_scene_from_exovista, observe

scene = load_scene_from_exovista(fetch_scene(), load_disk=False)
coronagraph = open_yip(fetch_yip("eac1_aavc_2d")).prepare()
optical_path = OpticalPath.from_default_setup(
    coronagraph,
    attenuating_throughput=0.4,
    qe=0.8,
    detector_shape=(128, 128),
    pixel_scale_arcsec=0.01,
)
bands = (Band(500.0, 600.0),)
quadrature = Quadrature.build(bands, scene, optical_path)
pointing = SkyOrientation(pa_y_deg=30.0, parity=-1)
options = dict(time_d=0.0, pointing=pointing, zodi=scene.zodi)
rates = image_electrons(scene.system, optical_path, quadrature, **options)
image = observe(
    jax.random.PRNGKey(0),
    scene.system,
    optical_path,
    quadrature,
    FramePlan(frame_time_s=100.0, n_frames=36),
    **options,
)
# imshow(image.data[0], origin="lower")

For disks, load the disk and give the coronagraph a scene renderer with coronagraph.with_scene_operator(). The reader requests disk photon radiance on the detector sky grid and passes its per-pixel flux through the coronagraph's field-dependent PSFs.

Rows increase along detector +y and columns along detector +x. Pixel (j,i) is centred at (x,y)=(i,j), including even grids. pa_y_deg is the position angle of detector +y, north through east. At zero, east is left and north is up; at 90 degrees, north is right. A roll changes this orientation for both planets and disks.

Speckle fields may be supplied through OpticalPath.speckle or the reader's speckle keyword. Their positive excess joins star_leakage; their existing physics is retained. The reader calls realize(wavelength_nm=..., time_d=...) and leaves epoch conversion to the field. The speckle pattern remains fixed in detector coordinates as pointing rolls.

Select record fields for per-source access. See rate and observation contracts and JAX and memory for details.

Metadata

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

Built distribution (wheel)

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

Total release size: 3.1 MB

Release files / coronagraphoto-6.0.0.tar.gz

Download URL coronagraphoto-6.0.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
5128aa366f60e0c1e89b5126ad6844aeb292b5e3436ed89a3a057de400d77d6b
BLAKE2b-256 checksum
How to use checksums
e93c62d733ba7db17c2a03f63b11b824244373901024980ced6d96b7728aa74e
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 / coronagraphoto-6.0.0-py3-none-any.whl

Download URL coronagraphoto-6.0.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
368171854f731d29d4947d31431d4315465be845057ae286ae9953bb243f20aa
BLAKE2b-256 checksum
How to use checksums
ad3950d25583ff0dfb19700f892003c13bf65e5412ab57efe8a67fdd11192f7c
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 coronagraphoto 6.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-6.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