Skip to main content

makewfs

CI PyPI Python License: MIT

makewfs turns a configured pupil-plane phase/OPD map into a realistic adaptive-optics wavefront-sensor image. The supported sensors are Shack–Hartmann and four-face pyramid sensors.

The package owns the wavefront-sensor optics. It deliberately reuses pyturb for atmospheric OPD and getframes for detector response and noise; neither model will be reimplemented here.

Status: stable. makewfs 1.0 freezes the configuration-driven Shack–Hartmann and four-face pyramid API under Semantic Versioning. Broadband source morphology, wavelength-resolved detector QE, Shack–Hartmann sodium-layer elongation, and optional end-to-end CuPy execution are supported. The documented mean-altitude LGS OPD approximation remains intentionally distinct from future range-resolved turbulence.

The minimal API is:

import makewfs

wfs = makewfs.WavefrontSensor.from_toml("wfs.toml")
frame = wfs.expose(opd_m, seed=0)  # getframes.Frame, data in ADU

Install the CPU package from PyPI with:

python -m pip install makewfs

For the optional CUDA 12.x path:

python -m pip install "makewfs[gpu]"

Set device = "gpu" under [numerics] and pass a CuPy OPD array for the device-resident path. frame.data is then a CuPy ADU array; use getframes.to_numpy(frame.data) only at an intentional host boundary.

The repository includes a runnable starter configuration at examples/configs/shack_hartmann_minimal.toml. The corresponding pyramid starter is at examples/configs/pyramid_minimal.toml. For an ideal photon-rate map, use wfs.photon_rate(opd_m); for one detector exposure containing several temporal OPD samples, use wfs.expose_integrated(samples).

For closed-loop work, construct the sensor once and call expose() with each new residual wavefront. The only per-frame inputs are the wavefront and, optionally, a detector-noise seed; telescope, source, sensor, sampling, and camera choices live in the configuration.

CPU/GPU throughput

Warm end-to-end frame throughput on an AMD Ryzen 9 9950X3D and NVIDIA RTX 5090 includes optics, getframes detector noise, truth, and ADU, with device-resident input/output and no host transfers:

Workflow Output Work samples CPU (frames/s) GPU (frames/s) Speedup
20x20 SH, float32 160x160 1 143.4 2,011.2 14.03x
60x60 SH, float64 360x360 1 26.3 945.2 35.94x
Broadband/range-sampled SH 64x64 9 99.8 557.1 5.58x
Pyramid, 8-point modulation, float32 80x80 8 668.5 1,579.4 2.36x
Pyramid, 32-point modulation, float64 108x108 32 33.3 903.9 27.18x

Higher is better. A tiny unmodulated 54x54 pyramid case remains CPU-faster (3,570 versus 1,541 frames/s) because GPU launch overhead dominates its small optical workload. See the full snapshot, raw JSON, and benchmark methodology.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

makewfs-1.0.0.tar.gz (408.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

makewfs-1.0.0-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file makewfs-1.0.0.tar.gz.

File metadata

  • Download URL: makewfs-1.0.0.tar.gz
  • Upload date:
  • Size: 408.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for makewfs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4225dae9c10d68025daef7cf9f418d80359b735651f610e05e6fac0c596d2c62
MD5 1e8b276a236a0b5fad101c7d307dbf39
BLAKE2b-256 60e0ad6a04cde4bc2847f5a9a6af4eca871aeedf7cf893dae73fe7c557969f73

See more details on using hashes here.

Provenance

The following attestation bundles were made for makewfs-1.0.0.tar.gz:

Publisher: release.yml on jacotay7/makewfs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file makewfs-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: makewfs-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for makewfs-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 589bb012d8ae505884f0e8c2cd579bafbe2627d483a5f5c35bfee38b81c6b642
MD5 ff2be7715fb789a76eb6fb835a0264ad
BLAKE2b-256 3ee747d656dab51bc27722cea47af48d567752aef2b73654311ba2a7c775eff2

See more details on using hashes here.

Provenance

The following attestation bundles were made for makewfs-1.0.0-py3-none-any.whl:

Publisher: release.yml on jacotay7/makewfs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page