Skip to main content

aocore

CI License: MIT

Shared conventions, conformance checks and optics primitives for the adaptive-optics simulation stack: aobasis, pyturb, getframes, makewfs, solvephase, shmpipeline-ao and pyRTC.

The packages of the stack hand each other OPD maps, images, wind vectors and slopes. aocore makes sure they mean the same thing by them:

  • CONVENTIONS.md is the contract: array axes, pixel centres, units, propagation sign and normalization, RMS and Strehl definitions, Zernike orientation, wind and slope conventions, and who owns which primitive.
  • aocore.conformance holds executable checks of the contract that every package runs against its own implementation in its test suite.
  • The primitives themselves, implemented once:
    • a NumPy/CuPy array backend;
    • anti-aliased and segmented pupils with telescope presets, and sub-pixel translated copies of them (Pupil.shifted) for pupil-shift and misregistration studies;
    • FFT, matrix-Fourier, focal-plane and angular-spectrum propagators with exact adjoints;
    • wavefront metrics (rms, rms_unweighted, rms_tiptilt_removed) and the measured Strehl ratio (strehl_peak);
    • perfect-coronagraph images and azimuthal profiles for contrast curves (perfect_coronagraph_image, azimuthal_profile);
    • least-squares phase unwrapping, fast pixel binning (block_sum, block_mean), periodic sub-pixel shifts (fourier_shift), coordinate grids built on either device, and unit constants;
    • set_threads, one switch for the BLAS, OpenMP, FFT and Numba thread pools, for multiprocessing sweeps.
pip install aocore              # CPU
pip install "aocore[cuda12]"    # + CuPy for CUDA 12.x
import aocore as ac

pupil = ac.Pupil.vlt(128)
prop = ac.FocalPlanePropagator(pupil.shape, pupil.pitch, 1.6e-6, 1.6e-6 / 8 / 2, (64, 64))
print(ac.rms(opd, pupil))  # CONVENTIONS 4.1: weighted, piston removed
print(ac.rms_unweighted(opd, pupil.mask))  # plain quadratic mean, piston included
print(ac.rms_tiptilt_removed(opd, pupil))  # weighted, piston/tip/tilt removed
y, x = ac.coordinate_grid(pupil.shape, pupil.pitch, backend="auto", dtype="float32")

# Raw contrast behind a perfect coronagraph, and its azimuthal profile in lambda/D.
halo = ac.perfect_coronagraph_image(opd, pupil, prop)[0]
radii, contrast = ac.azimuthal_profile(halo, pixel_scale=1 / 2)  # 2 pixels per lambda/D

# In any package's tests:
from aocore import conformance

conformance.check_tilt_direction(
    my_image_from_opd, pupil_shape=(64, 64), pitch=..., pixel_scale=...
)

aocore depends only on NumPy, SciPy and threadpoolctl. CuPy is optional.

License

MIT. Every package in the stack except pyRTC (GPL-3.0-or-later) is MIT, and none of them may copy GPL code (see CONVENTIONS 8.4).

Metadata

Release files for aocore 0.2.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 aocore 0.2.0
File Size Uploaded
aocore-0.2.0.tar.gz 74.4 kB Details

Built distribution (wheel)

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

Total release size: 125.7 kB

Release files / aocore-0.2.0.tar.gz

Download URL aocore-0.2.0.tar.gz
Size 74.4 kB
Tags Source
SHA-256 checksum
How to use checksums
799be8406ce24bb374eef121a7f8108b181a2ff98b79dd3d0a8edba7df093b5a
BLAKE2b-256 checksum
How to use checksums
9555440296b85eceb63f43b432c46028be98016a6b422b9d1a5267d1334d8e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Release files / aocore-0.2.0-py3-none-any.whl

Download URL aocore-0.2.0-py3-none-any.whl
Size 51.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b80624e6792369b02f5f62152ba252ef0e2ca7a6f983c0cfbc66eb1438b50f9
BLAKE2b-256 checksum
How to use checksums
53a976341775c8bdb558d55b11b58324a2b6acd99cd18aae1848ebd8463b2028
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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