Skip to main content

jaxedith

jaxedith turns performance curves, a scene, an instrument and a planet position into analytic aperture rates: the scalar AYO and pyEDITH count-rate terms, evaluated in JAX. It returns an optixstuff.Rates record, which optixstuff.snr and optixstuff.exposure_time reduce to a signal-to-noise ratio or an exposure time. The package has five functions: rates, scene_rates, photon_counting_frame_time, and the one-call planet_exposure_time and planet_snr.

Usage

This example needs curves (an optixstuff.PerformanceCurves measured for the telescope and star, for example from yippy's coronagraph.curves(rule)), a skyscapes.Scene, an optixstuff.Instrument and the bands to read.

The curves are read at the band-centre lambda/D for every node, so the response does not slide across a pixel and the quadrature is built with field_lod=0: a wider field would add nodes and change nothing. The scene's tabulated spectra (a PHOENIX star, a local-zodi table, a planet model with a grid) are integrated exactly over each band by an operator built on the host, and scene.sources reads them once on the nodes. A band must lie inside every source table. Sky transmission comes with each band's curves in PerformanceCurves.uniform_sky.

import jaxedith
import optixstuff as ox
from optixstuff.spectral import Quadrature, Resolution

models = [m for m in (instrument, scene.local_zodi, scene.disk) if m is not None]
quadrature = Quadrature.build(bands, *models, field_lod=0)
resolution = Resolution.build(quadrature, *scene.spectral_tables())
sources = scene.sources(quadrature, resolution, time_d)
planet_flux = sources.planets[:, :, planet, 0]  # (W, Q), photons/s/m^2/nm
contrast = 1e-10  # an optional hypothesis for the one-call contrast calculators

rates = jaxedith.rates(
    curves,
    scene,
    instrument,
    quadrature,
    east_arcsec,
    north_arcsec,
    planet=planet_flux,
    time_d=time_d,
    sources=sources,  # node rows of the one time read
)
frame_time_s = jaxedith.photon_counting_frame_time(rates, instrument.detector)
time = ox.exposure_time(
    rates,
    instrument.detector,
    7.0,
    frame_time_s=frame_time_s,
    post_processing=ox.PostProcessing(1 / 30, 0.0, background_variance_factor=2.0),
)
frames = ox.frames_for_time(time.time_s, frame_time_s)
reachable = time.valid  # Boolean mask per band

An unreachable target gives NaN in time.time_s and in the plan's frame count and live time. A count of zero represents a request for zero seconds.

import jax.numpy as jnp
import optixstuff as ox
from optixstuff.spectral import Band, Quadrature

detector = ox.Detector(pixel_scale_arcsec=0.01, shape=(1, 1), qe=0.9)
quadrature = Quadrature.build([Band(500.0, 600.0)], detector, order=1)
rates = ox.Rates(
    quadrature, "photon", planet=jnp.zeros((1, 1)), local_zodi=jnp.ones((1, 1))
)
frame_time_s = 300.0
time = ox.exposure_time(
    rates,
    detector,
    7.0,
    frame_time_s=frame_time_s,
    post_processing=ox.PostProcessing(background_variance_factor=1.0),
)
frames = ox.frames_for_time(time.time_s, frame_time_s)
assert not bool(time.valid[0])
assert jnp.isnan(frames.n_frames[0])

For pyEDITH and EXOSIMS users the one-call form, which answers for one planet, takes the same arguments plus the target and the frame time. It answers for the fixed contrast hypothesis above, so it matches the two steps only where that contrast implies the same planet flux at the nodes:

time = jaxedith.planet_exposure_time(
    curves,
    scene,
    instrument,
    quadrature,
    east_arcsec,
    north_arcsec,
    contrast,
    time_d=time_d,
    sources=sources,
    target_snr=7.0,
    frame_time_s=frame_time_s,
    post_processing=ox.PostProcessing(1 / 30, 0.0, background_variance_factor=2.0),
)
snr = jaxedith.planet_snr(
    curves,
    scene,
    instrument,
    quadrature,
    east_arcsec,
    north_arcsec,
    contrast,
    time_d=time_d,
    sources=sources,
    time_s=3600.0,
    frame_time_s=frame_time_s,
    post_processing=ox.PostProcessing(1 / 30, 0.0, background_variance_factor=2.0),
)

jaxedith.planet_exposure_time is rates followed by optixstuff.exposure_time on instrument.detector, and jaxedith.planet_snr is rates followed by optixstuff.snr; neither adds arithmetic. They return an optixstuff.ExposureTime and the S/N per band.

rates is a scalar read of one planet that reads no spectrum itself: the star, the local zodi and the disk's host star are the node rows of sources. Pass planet= with a scene's node-effective photon flux density from sources.planets, or contrast= with a planet-to-star hypothesis; exactly one is required. Map it over positions and fluxes with jax.vmap. Fields are photons/s/nm of shape (W, Q), with n_pix per band and a squared-weight variance record. Detector yield is not applied there: detector.electrons(rates) applies QE and survival once, downstream.

To read every planet of the scene at every time, scene_rates is a vmap of rates over the planets and the times that reads scene.sources once outside the map, and takes the same layout as coronagraphoto.scene_aperture_rates, so the two reads swap:

record = jaxedith.scene_rates(
    curves,
    scene,
    instrument,
    quadrature,
    time_d,
    resolution=resolution,
)  # time_d: (T,) days; fields (W, Q, K, T), n_pix (W, K, T)
time = ox.exposure_time(
    record,
    instrument.detector,
    7.0,
    frame_time_s=frame_time_s,
    post_processing=post_processing,
)  # one time per band, planet and time

Planets with scene.valid False read zero, so their exposure time is invalid.

The reduction itself is described in optixstuff's how an exposure time is computed. The conventions of the terms, and how AYO, pyEDITH and EXOSIMS map onto PostProcessing, are on the conventions page. Thermal emission is read from Instrument.warm_emission (optixstuff's WarmEmission) and is zero without it; stellar companions are zero in this release. coronagraphoto fills the same field from its images and aperture records.

Cross-code references

Scalar pyEDITH, EXOSIMS and AYO comparison implementations live in tests/reference/ in the source checkout. They support cross-code benchmarks and convention checks, and are excluded from the wheel and source distribution. See comparison references for their scope.

Installation

pip install jaxedith

The development tests use coordinated unreleased versions of optixstuff and skyscapes; published dependency floors have not yet been verified for this API.

Metadata

Release files for jaxedith 4.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 jaxedith 4.0.0
File Size Uploaded Provenance Actions
jaxedith-4.0.0.tar.gz 24.3 kB With provenance Details for jaxedith-4.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 38.6 kB

Release files / jaxedith-4.0.0.tar.gz

Download URL jaxedith-4.0.0.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
58b713899bd28ef29032da28939055a32a20d090240f3926de3d70eeca9ddf38
BLAKE2b-256 checksum
How to use checksums
2f9ec11522d3bcb378751e50e7573c1a0e4e181365517b5b9c7878f403a65558
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 28, 2026.

Transparency log

Release files / jaxedith-4.0.0-py3-none-any.whl

Download URL jaxedith-4.0.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71c2c5d8724d389840bcbfe2226d05718017f8d0d6040c83a2803dead90c1929
BLAKE2b-256 checksum
How to use checksums
04153705c0f47d2ab3a7f1d9b17d401a442c0bf8b73b699cc76f5134769ac33b
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 28, 2026.

Transparency log

Security for jaxedith 4.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 jaxedith-4.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 28, 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