optixstuff
Shared hardware objects - with standard values - for the HWO direct-imaging simulation suite.
What optixstuff is
optixstuff is a thin shared dependency that defines the observatory's
hardware as composable JAX modules: primary aperture, throughput-affecting
elements, coronagraph backend, detector. Its job is to be the single source of
truth for the hardware configuration that downstream tools consume.
coronagraphoto
(2D image simulation), coronachrome
(lenslet-IFS dispersion + spectral extraction), and
jaxEDITH
(exposure-time and yield calculations) import the same Instrument class and
the same detector / throughput / primary / disperser types from optixstuff.
Change a value here and every downstream tool picks it up on the next import.
What optixstuff is not
- Not a wavefront tool. Diffraction, E-field propagation, and PSFs-from-first-principles belong to dLux and HCIPy.
- Not a PSF interpolator. Image providers implement the shared
AbstractCoronagraphcontract; optixstuff owns the contract and scalar models. - Not a scene model. Stars, planets, disks, and zodi live in skyscapes.
- Not a simulator. Downstream tools (coronagraphoto, coronachrome, jaxEDITH)
consume an
Instrumentto produce images, dispersed IFS frames, or count rates.
Architecture
Built on JAX and
Equinox, optixstuff provides:
- Abstract interfaces -
AbstractPrimary,AbstractOpticalElement,AbstractCoronagraph,AbstractDetector,AbstractDisperser - Concrete implementations -
SimplePrimary,SegmentedPrimary(carries hex segment geometry for a diffraction backend),ConstantThroughput,IdealDetector,Detector(with optional wavelength-dependent QE),LensletDisperser - Container -
Instrument, a composable hardware configuration passed to all simulators
Optical elements and coronagraphs accept fidelity axes - wavelength, position, and time - with defaults so that simple implementations can ignore unused axes while future high-fidelity models (wavelength-dependent coatings, position-dependent vignetting, time-dependent detector degradation) can use them without breaking the interface.
Primary geometry and coronagraph grids
Primaries expose diameter("circumscribed"), diameter("inscribed"), and
collecting_area_m2. Build a lambda/D frame with primary.frame(500.0).
SimplePrimary takes both diameters and collecting area as keyword arguments;
SegmentedPrimary derives them from segment size, gap, and ring count.
OpticalPath raises ValueError when its primary's diameter differs from the
diameter of the coronagraph's lambda/D frame, so the tables and the collecting
area describe one telescope. A yippy Coronagraph carries the matching
primary.
Coronagraph images use hwoutils.grids.Image and an explicit target PixelGrid.
Coordinates are (x, y), arrays are (..., y, x), and even-grid centres fall
between pixels. For example, band.off_axis_psf(500.0, 3.0, target) returns
per-pixel fractions of unocculted source flux. Use .data to obtain its array.
Select the imaging model with band = coro.band(500.0). Its
at_wavelength(500.0) gives the source, stellar and uniform-sky grids.
Scene models return an image and a validity flag from
render_scene(scene_image, 500.0, grid=target).
coro.curves(Circular(0.7)) is the single performance record for that aperture.
Import Circular from optixstuff; prepare every required rule before JIT
when constructing an image provider.
Records contain throughput, core area, stellar leakage fraction, leakage density,
raw contrast, iwa_lod, and data_extent_lod. A known design limit is separately
named outer_working_angle_lod. ScalarCoronagraph stores calibrated constants
for one declared aperture.
MultiBandCoronagraph selects the first declared bandpass covering the wavelength.
Coronagraph and speckle timestamps use time_d, days from the scene epoch;
exposure durations remain seconds.
Linear speckle fields
Subclass LinearSpeckleField and implement coefficients(time_d), subtracting
its static host epoch_d internally. Construct a FocalResponse with the
complex nominal amplitude density e_nom, sensitivity density G, native
lod grid, unocculted input energy and reference wavelength. The shared law
uses response.per_pixel() and returns the excess
[2 Re(conj(e_nom) G eps) + |G eps|^2] / input_energy, with G scaled by
reference_wavelength_nm / wavelength_nm.
realize(wavelength_nm=..., time_d=...) returns an Image on the field's own
grid, with Measure.integral(), stellar_flux_fraction, band_limited, and reflect
metadata. Wavelength arrays, including quadrature nodes (W, Q), become leading
axes. Each native lambda/D coordinate uses the node wavelength: convert with
image.grid.to_arcsec(node_nm) before resampling that node onto a detector.
broadened(quadrature=..., time_d=...) averages realized nodes at fixed native
lambda/D coordinates, normalizing the nm weights to sum to one per band.
Detector-band images instead require resampling and spectral weighting at each
node before integration. realize_average(..., exposure_s=..., start_time_d=...)
retains its midpoint time-average meaning. Enable JAX x64 for deep contrast and
for adding small offsets to absolute day timestamps. Nonlinear replay models
continue to implement AbstractSpeckleField directly.
Detector chain
Readers supply PhotonRates in photons/s/nm at shared quadrature nodes.
The detector converts them to ElectronRates with spectral QE and survival
applied once, before integration. The observer owns the frame plan.
import jax
import jax.numpy as jnp
from hwoutils.spectral import Band, Quadrature
from optixstuff import Detector, PhotonRates, frames_for_time
detector = Detector(pixel_scale_arcsec=0.01, shape=(1, 1), qe=0.9)
quadrature = Quadrature.build([Band(500.0, 600.0)], detector, order=3)
rates = PhotonRates(quadrature, planet=jnp.ones((1, 3)))
electrons = detector.electrons(rates)
plan = frames_for_time(time_s=600.0, frame_time_s=300.0)
mean, variance = detector.mean_and_variance(electrons, plan)
counts = detector.draw(jax.random.key(0), electrons, plan)
The six source fields retain their names throughout the chain. Image readers
use (W, Q, ny, nx) integrands; aperture readers use (W, Q). The detector
returns (W, *spatial) electrons/s and count moments. See the
detector contract
for noise parameters, gain statistics, and readout overlap.
Ecosystem position
flowchart TB
physopt["<b>Physical optics</b><br/>dLux / HCIPy / PROPER<br/>E-fields -> PSFs"]
provider["<b>Image provider</b><br/>PSF interpolation"]
optix["<b>optixstuff</b><br/>Telescope / Coronagraph / Detector / Instrument<br/>Throughput chains / QE / Noise rates"]
jaxedith["<b>jaxEDITH</b><br/>Scalar count rates<br/>Exposure-time calculations"]
corono["<b>coronagraphoto</b><br/>2D image simulation<br/>Multi-epoch scenes"]
coronachrome["<b>coronachrome</b><br/>Lenslet-IFS dispersion<br/>Spectral extraction"]
physopt -- PSF tables --> provider
provider -- AbstractCoronagraph --> optix
optix --> jaxedith
optix --> corono
optix --> coronachrome
Installation
pip install optixstuff
Metadata
Release files for optixstuff 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 |
|---|---|---|---|---|
| optixstuff-6.1.0.tar.gz | 62.7 kB | With provenance | Details for optixstuff-6.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| optixstuff-6.1.0-py3-none-any.whl | Python 3 | none | any | Details for optixstuff-6.1.0-py3-none-any.whl |
Total release size: 121.7 kB
Release files / optixstuff-6.1.0.tar.gz
| Download URL | optixstuff-6.1.0.tar.gz |
|---|---|
| Size | 62.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37daf4f9969e3b5818ade4affc498270d1c67ac7613eb0961d54aeca3dd0d859
|
|
BLAKE2b-256 checksum How to use checksums |
4c5dbc5cd50e805d2dfb8c53a090fd91a9c44a9bb28bc45a477b74fb4ad12563
|
| 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 / optixstuff-6.1.0-py3-none-any.whl
| Download URL | optixstuff-6.1.0-py3-none-any.whl |
|---|---|
| Size | 59.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdb24ec093af01139af50fa14e0be2c2a5ddd06a9468ea8bd94c1ee7838c7bce
|
|
BLAKE2b-256 checksum How to use checksums |
c446551f59ece3aecf35c5cbf27d783929f8471dcd9b0e120b8887b456983bfd
|
| 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 optixstuff 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 optixstuff-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.