Skip to main content

PyPI Documentation Status Tests License Python 3.12+ DOI


hwoutils

hwoutils is the shared utility foundation for the HWO direct imaging simulation suite. It provides physical constants, unit conversions and a reference epoch that need only NumPy, plus flux-conserving JAX image transforms behind the jax extra. It is used across:

  • yippy: Coronagraph performance modeling
  • orbix: Orbital dynamics and target scheduling
  • coronagraphoto: Image simulation for coronagraphic observations
  • photomancy: Post-processing, detection statistics and inference
  • spaceodyssey: End-to-end mission simulations

Key Features

  • Physical Constants: Single source of truth for SI constants, conversion factors, and astronomical quantities
  • Unit Conversions: Conversion functions (angular, flux, distance, time) with zero astropy overhead; NumPy arrays and JAX arrays both work
  • Image Transforms: Flux-conserving resampling, sub-pixel shifts, and cubic spline interpolation
  • JAX Extra: The image transforms are JIT-compilable, differentiable, and GPU-accelerated (pip install "hwoutils[jax]")
  • Model Paths and Blocks: Dotted paths that read and replace a node of a model (hwoutils.model_paths), and the contract of a fit's free entry that owns a node (hwoutils.blocks), behind the jax extra

Installation

With uv (recommended):

uv pip install hwoutils          # NumPy only
uv pip install "hwoutils[jax]"   # with the JAX modules

Or with pip:

pip install hwoutils

Quick Start

This example requires a user-provided PSF array, psf.

from hwoutils import constants as const
from hwoutils import conversions as conv
from hwoutils.transforms import resample_flux

# Convert 5 arcsec to lambda/D for a 6m telescope at 550nm
sep_lod = conv.arcsec_to_lambda_d(5.0, 550.0, 6.0)

# Smooth PSF resampling, scaled by the target pixel area
resampled = resample_flux(psf, pixscale_src=0.01, pixscale_tgt=0.1, shape_tgt=(64, 64))

Test budget guard

hwoutils.testbudget is an opt-in pytest plugin for time, memory and compile budgets. Add pytest_plugins = ["hwoutils.testbudget.plugin"] to the top-level conftest.py and a [tool.testbudget] table to pyproject.toml; see docs/testbudget.md.

Documentation

For model paths and the block contract, see the model paths and blocks guide. For the shared repository text guard and pytest plugin, see the internal reference guard guide.

Full documentation is available at hwoutils.readthedocs.io.

Metadata

Release files for hwoutils 3.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 hwoutils 3.0.0
File Size Uploaded Provenance Actions
hwoutils-3.0.0.tar.gz 80.6 kB With provenance Details for hwoutils-3.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 161.2 kB

Release files / hwoutils-3.0.0.tar.gz

Download URL hwoutils-3.0.0.tar.gz
Size 80.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2a7f77690cb141543b381e1f2424d985f11d4438aad7a748b53cfc03a2595de8
BLAKE2b-256 checksum
How to use checksums
6d5293700c769376652b80e62e354e49d011a6dd96a5c2c653d9b0465049cc22
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 / hwoutils-3.0.0-py3-none-any.whl

Download URL hwoutils-3.0.0-py3-none-any.whl
Size 80.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca7ed417b919ceea74a6c6324043e93f1f1c7ad6d38e8f77ef1b00ca31c7ec2d
BLAKE2b-256 checksum
How to use checksums
aa8152c2e9c3c3c57b63cbd6ebced2c7a75d3f024ac82fb68d479d89647b41f3
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 hwoutils 3.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 hwoutils-3.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