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. One Exposure record, built once with build_exposure, carries
the epoch, roll, wavelength quadrature and frame plan. The image reader takes
(scene, instrument, exposure):
| Function | Output | Units |
|---|---|---|
photon_rates |
PhotonRates, each field (W, Q, ny, nx) |
photons/s/nm/pixel |
expected |
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.
expected scans nodes and accumulates band images, holding one node's
images at a time. photon_rates retains all nodes for inspection and small
problems. build_exposure builds the quadrature on the host from the scene's
zodi and the instrument. Its Gauss-Legendre rule splits at every declared
break, including detector QE knots. Reuse one exposure across readers, and
change fields with dataclasses.replace.
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.spectral import Band
from optixstuff import FramePlan, Instrument
from skyscapes import from_exovista
from skyscapes.datasets import fetch_scene
from yippy import fetch_yip, open_yip
from coronagraphoto import build_exposure, expected, observe
scene = from_exovista(fetch_scene(), load_disk=False)
coronagraph = open_yip(fetch_yip("eac1_aavc_2d")).prepare()
instrument = Instrument.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),)
exposure = build_exposure(
scene,
instrument,
bands,
time_d=0.0,
roll_deg=30.0,
plan=FramePlan(frame_time_s=100.0, n_frames=36),
)
rates = expected(scene, instrument, exposure)
image = observe(jax.random.PRNGKey(0), scene, instrument, exposure)
# 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. roll_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 are supplied through Instrument.speckle. 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.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coronagraphoto-6.1.0.tar.gz | 3.0 MB | With provenance | Details for coronagraphoto-6.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coronagraphoto-6.1.0-py3-none-any.whl | Python 3 | none | any | Details for coronagraphoto-6.1.0-py3-none-any.whl |
Total release size: 3.1 MB
Release files / coronagraphoto-6.1.0.tar.gz
| Download URL | coronagraphoto-6.1.0.tar.gz |
|---|---|
| Size | 3.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ad88394764609b220db7f1a1314ee17a8bcc313b352c55af0e9f9031a0088e5
|
|
BLAKE2b-256 checksum How to use checksums |
326b9fd751e3f228f88f13232c19cdb3cbf3c9b1a0df35ba58ae484d91c1b847
|
| 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 20, 2026.
Transparency logRelease files / coronagraphoto-6.1.0-py3-none-any.whl
| Download URL | coronagraphoto-6.1.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e10d6c5b2e679d6b4b23d18b91acd16cb757c1e8f89f56c55da9ef9ea30e776
|
|
BLAKE2b-256 checksum How to use checksums |
6cd08be656fc9cd6615514c74d516e066fbf411f253be99f3a7e69b4c926bc7a
|
| 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 20, 2026.
Transparency logSecurity for coronagraphoto 6.1.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.
Attestation for coronagraphoto-6.1.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 20, 2026.
Transparency logA 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.