pyTomoAO
📖 Documentation — installation, configuration reference, tutorials and API reference.
pyTomoAO is an open-source Python library for tomographic reconstruction in Adaptive Optics (AO) systems. It reconstructs atmospheric turbulence phase maps from several laser guide star Shack–Hartmann wavefront sensors and projects them onto a deformable mirror.
Features
- Minimum-mean-square-error tomographic reconstruction from multiple LGS wavefront sensors, driven by a layered Von Kármán turbulence model. This is the single-DM, single-optimisation-direction case used for LTAO; MOAO and MCAO are on the roadmap below.
- Both a model-based reconstructor and one built from a measured interaction matrix.
- Super-resolution support: per-WFS lenslet rotation and lateral offset.
- Tools for fitting reconstructed phase maps onto deformable mirrors.
- GPU acceleration through CuPy, selected automatically when it is available, with a NumPy/Numba CPU backend otherwise.
Installation
pip install pyTomoAO
or clone the repository:
git clone https://github.com/KeckObservatory/pyTomoAO.git
cd pyTomoAO
pip install -e .
See the installation guide for GPU support and optional extras.
Usage
Everything is driven by a single YAML configuration file:
from pyTomoAO import example_config
from pyTomoAO.reconstructor import tomographicReconstructor
# Build a tomographic reconstructor from a configuration file
rec = tomographicReconstructor(example_config("kapa"))
rec.build_reconstructor()
# Fold in the DM fitting step to go from slopes straight to commands
FR = rec.assemble_reconstructor_and_fitting(nChannels=4, slopesOrder="simu")
commands = FR @ slopes
Full walkthrough: quickstart and the KAPA LTAO tutorial.
Roadmap
- Fundamental tomographic reconstruction algorithms.
- GPU acceleration.
- Deformable mirror fitting routines.
- Detailed documentation and examples.
- MOAO reconstructor (per-direction outputs).
- MCAO reconstructor (multiple DM altitudes).
Development
Setup
git clone https://github.com/KeckObservatory/pyTomoAO.git
cd pyTomoAO
pip install -e ".[docs,dev]"
Code Style
Linting and formatting are handled by ruff, configured in
pyproject.toml and enforced by the Code health workflow:
ruff check . # lint
ruff format . # format
ruff format --check . # what CI checks
Naming rules are deliberately disabled: class names such as tomographicReconstructor are
public API, and matrix names such as Gamma and Cxx mirror the equations they implement.
See the code style guide.
Documentation
The documentation is built with Sphinx and published to GitHub Pages at
https://keckobservatory.github.io/pyTomoAO/ by the Documentation workflow on every push
to main. Pull requests build the docs with warnings treated as errors, so a broken link or
docstring fails CI.
To build it locally:
pip install -e ".[docs]"
make -C docs html # output in docs/build/html
make -C docs strict # exactly what CI runs
make -C docs livehtml # auto-reloading preview (needs sphinx-autobuild)
See the documentation guide for conventions and how publishing works.
Testing
The dev extra installs pytest and coverage:
pip install -e ".[dev]"
pytest
CI runs the suite against Python 3.9–3.13 and applies a coverage threshold. See the testing guide.
Changelog
See CHANGELOG.md for release history, and the Unreleased section for what
is coming next.
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests. Branch from
dev and open the pull request against dev; see the
contributing guide
for conventions. Pull requests must pass the tests, the ruff lint/format checks and the
documentation build, and should add an entry to the changelog.
License
This project is licensed under the MIT License. See LICENSE for details.
Contact
For questions and discussions, open an issue on GitHub or contact one of:
- Jacob Taylor (Software): jacobataylor7@gmail.com
- Uriel Conod (Algorithm): urielconod@phas.ubc.ca
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytomoao-2.0.0.tar.gz.
File metadata
- Download URL: pytomoao-2.0.0.tar.gz
- Upload date:
- Size: 87.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f31537e8d3eebc91ca465d5c8336e7e6eea4b3d61c345331f215c4e97696ace
|
|
| MD5 |
33f3bb66b8dcb16f2d6661c931f6c94c
|
|
| BLAKE2b-256 |
0109d6b202c4ae018ef7931fe372b4b855f4861c5a30d3548efc8b56df7a3e00
|
Provenance
The following attestation bundles were made for pytomoao-2.0.0.tar.gz:
Publisher:
publish.yml on KeckObservatory/pyTomoAO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytomoao-2.0.0.tar.gz -
Subject digest:
5f31537e8d3eebc91ca465d5c8336e7e6eea4b3d61c345331f215c4e97696ace - Sigstore transparency entry: 2278870444
- Sigstore integration time:
-
Permalink:
KeckObservatory/pyTomoAO@c3b180c84c3dd863ed9bde4ccbdf0a48f5324668 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/KeckObservatory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3b180c84c3dd863ed9bde4ccbdf0a48f5324668 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pytomoao-2.0.0-py3-none-any.whl.
File metadata
- Download URL: pytomoao-2.0.0-py3-none-any.whl
- Upload date:
- Size: 55.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dfa4b02b43236a8b5f8fb568c8bdea4ec9340a8277b709ca1f863dc26947047
|
|
| MD5 |
90ae7f02041d9e790ec6a456cb32b215
|
|
| BLAKE2b-256 |
916e04651359b46e0d08f9748352be013ed3810e6b23796004d0b48eafb9ca23
|
Provenance
The following attestation bundles were made for pytomoao-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on KeckObservatory/pyTomoAO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytomoao-2.0.0-py3-none-any.whl -
Subject digest:
4dfa4b02b43236a8b5f8fb568c8bdea4ec9340a8277b709ca1f863dc26947047 - Sigstore transparency entry: 2278870477
- Sigstore integration time:
-
Permalink:
KeckObservatory/pyTomoAO@c3b180c84c3dd863ed9bde4ccbdf0a48f5324668 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/KeckObservatory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3b180c84c3dd863ed9bde4ccbdf0a48f5324668 -
Trigger Event:
release
-
Statement type: