tiptilt 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. tiptilt-0.1.0/.github/workflows/publish-to-pypi.yml +50 -0
  2. tiptilt-0.1.0/.github/workflows/release-please.yml +22 -0
  3. tiptilt-0.1.0/.github/workflows/tests.yml +49 -0
  4. tiptilt-0.1.0/.gitignore +221 -0
  5. tiptilt-0.1.0/.pre-commit-config.yaml +28 -0
  6. tiptilt-0.1.0/.readthedocs.yaml +17 -0
  7. tiptilt-0.1.0/CHANGELOG.md +34 -0
  8. tiptilt-0.1.0/LICENSE +21 -0
  9. tiptilt-0.1.0/PKG-INFO +111 -0
  10. tiptilt-0.1.0/README.md +57 -0
  11. tiptilt-0.1.0/docs/conf.py +28 -0
  12. tiptilt-0.1.0/docs/index.md +32 -0
  13. tiptilt-0.1.0/examples/custom_controller.py +89 -0
  14. tiptilt-0.1.0/pyproject.toml +65 -0
  15. tiptilt-0.1.0/src/tiptilt/__init__.py +137 -0
  16. tiptilt-0.1.0/src/tiptilt/_version.py +24 -0
  17. tiptilt-0.1.0/src/tiptilt/control.py +527 -0
  18. tiptilt-0.1.0/src/tiptilt/dm.py +316 -0
  19. tiptilt-0.1.0/src/tiptilt/lowfs.py +199 -0
  20. tiptilt-0.1.0/src/tiptilt/maintenance.py +356 -0
  21. tiptilt-0.1.0/src/tiptilt/multichannel.py +309 -0
  22. tiptilt-0.1.0/src/tiptilt/sensing.py +548 -0
  23. tiptilt-0.1.0/src/tiptilt/speckle.py +374 -0
  24. tiptilt-0.1.0/src/tiptilt/testbed.py +899 -0
  25. tiptilt-0.1.0/src/tiptilt/turbulence.py +87 -0
  26. tiptilt-0.1.0/tests/conftest.py +8 -0
  27. tiptilt-0.1.0/tests/test_channel_speckle.py +198 -0
  28. tiptilt-0.1.0/tests/test_control.py +476 -0
  29. tiptilt-0.1.0/tests/test_coronagraph_dark_hole.py +111 -0
  30. tiptilt-0.1.0/tests/test_dm.py +299 -0
  31. tiptilt-0.1.0/tests/test_internal_refs_guard.py +66 -0
  32. tiptilt-0.1.0/tests/test_lowfs.py +151 -0
  33. tiptilt-0.1.0/tests/test_maintenance.py +195 -0
  34. tiptilt-0.1.0/tests/test_multichannel_control.py +251 -0
  35. tiptilt-0.1.0/tests/test_residual_export.py +156 -0
  36. tiptilt-0.1.0/tests/test_seams.py +186 -0
  37. tiptilt-0.1.0/tests/test_sensing.py +241 -0
  38. tiptilt-0.1.0/tests/test_speckle.py +272 -0
  39. tiptilt-0.1.0/tests/test_testbed.py +165 -0
  40. tiptilt-0.1.0/tests/test_turbulence.py +78 -0
  41. tiptilt-0.1.0/tests/test_zwfs_reconstruct.py +61 -0
  42. tiptilt-0.1.0/tools/check_internal_refs.py +80 -0
@@ -0,0 +1,50 @@
1
+ name: Publish to PyPI
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ build:
7
+ name: Build distribution
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v6
12
+ - name: Set up Python
13
+ uses: actions/setup-python@v6
14
+ with:
15
+ python-version: "3.x"
16
+ - name: Install pypa/build
17
+ run: >-
18
+ python3 -m
19
+ pip install
20
+ build
21
+ --user
22
+ - name: Build a binary wheel and a source tarball
23
+ run: python3 -m build
24
+ - name: Store the distribution packages
25
+ uses: actions/upload-artifact@v7
26
+ with:
27
+ name: python-package-distributions
28
+ path: dist/
29
+
30
+ publish-to-pypi:
31
+ name: >-
32
+ Publish Python distribution to PyPI
33
+ if: startsWith(github.ref, 'refs/tags/')
34
+ needs:
35
+ - build
36
+ runs-on: ubuntu-latest
37
+ environment:
38
+ name: pypi
39
+ url: https://pypi.org/p/tiptilt
40
+ permissions:
41
+ id-token: write
42
+
43
+ steps:
44
+ - name: Download all the dists
45
+ uses: actions/download-artifact@v8
46
+ with:
47
+ name: python-package-distributions
48
+ path: dist/
49
+ - name: Publish distribution to PyPI
50
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,22 @@
1
+ on:
2
+ push:
3
+ branches:
4
+ - main
5
+
6
+ permissions:
7
+ contents: write
8
+ pull-requests: write
9
+
10
+ name: release-please
11
+
12
+ jobs:
13
+ release-please:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: googleapis/release-please-action@v5
17
+ with:
18
+ # Personal access token stored as an action secret; the default
19
+ # GITHUB_TOKEN cannot be used because tags it pushes do not
20
+ # trigger the publish-to-pypi workflow.
21
+ token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
22
+ release-type: simple
@@ -0,0 +1,49 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ test:
12
+ name: Test Python ${{ matrix.python-version }} on ${{ matrix.platform }}
13
+ runs-on: ${{ matrix.platform }}
14
+ strategy:
15
+ matrix:
16
+ python-version: ["3.12"]
17
+ platform: [ubuntu-latest, macos-latest]
18
+ steps:
19
+ - uses: actions/checkout@v6
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v7
23
+ with:
24
+ enable-cache: true
25
+
26
+ - name: Create venv
27
+ run: uv venv .venv --python ${{ matrix.python-version }}
28
+
29
+ - name: Install package with test dependencies
30
+ run: uv pip install -e ".[test]"
31
+ env:
32
+ VIRTUAL_ENV: ${{ github.workspace }}/.venv
33
+
34
+ # optixstuff main carries the speckle-field contract this package
35
+ # imports; drop the override once optixstuff >= 2.0.0 is on PyPI.
36
+ # (physicaloptix override dropped 2026-07-17: 0.1.0 released.)
37
+ - name: Override unreleased dependencies from git main
38
+ run: uv pip install "optixstuff @ git+https://github.com/CoreySpohn/optixstuff.git"
39
+ env:
40
+ VIRTUAL_ENV: ${{ github.workspace }}/.venv
41
+
42
+ - name: Diag pytest present
43
+ run: .venv/bin/pytest --version
44
+
45
+ - name: Diag imports
46
+ run: .venv/bin/python -c "import jax, physicaloptix, tiptilt; from physicaloptix import BeamSplitter; print('jax', jax.__version__)"
47
+
48
+ - name: Run tests
49
+ run: .venv/bin/pytest tests/ -v --tb=short
@@ -0,0 +1,221 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+
220
+ # hatch-vcs generated version file
221
+ *_version.py
@@ -0,0 +1,28 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: no-internal-refs
5
+ name: no internal research references
6
+ entry: python3 tools/check_internal_refs.py
7
+ language: system
8
+ types: [text]
9
+ exclude: ^(CHANGELOG\.md|tools/check_internal_refs\.py)$
10
+ - repo: https://github.com/pre-commit/pre-commit-hooks
11
+ rev: "v6.0.0"
12
+ hooks:
13
+ - id: trailing-whitespace
14
+ - id: name-tests-test
15
+ args: [--pytest-test-first]
16
+ - id: end-of-file-fixer
17
+ - repo: https://github.com/astral-sh/ruff-pre-commit
18
+ rev: v0.15.2
19
+ hooks:
20
+ - id: ruff-check
21
+ args: [--fix]
22
+ - id: ruff-format
23
+ - repo: https://github.com/compilerla/conventional-pre-commit
24
+ rev: v4.3.0
25
+ hooks:
26
+ - id: conventional-pre-commit
27
+ stages: [commit-msg]
28
+ args: []
@@ -0,0 +1,17 @@
1
+ # Required
2
+ version: 2
3
+
4
+ build:
5
+ os: ubuntu-22.04
6
+ tools:
7
+ python: "3.12"
8
+
9
+ python:
10
+ install:
11
+ - method: pip
12
+ path: .
13
+ extra_requirements:
14
+ - docs
15
+
16
+ sphinx:
17
+ configuration: docs/conf.py
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2026-07-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * **control,sensing:** symmetric estimator/controller seams -- DarkZoneModel, EFC/stroke-min/predictive controllers, oracle/pairwise/Kalman estimators; close_dark_hole a thin driver ([c94ee5d](https://github.com/CoreySpohn/tiptilt/commit/c94ee5d4ff183375ea6c7e02f2be897537fd5ff2))
9
+ * **control:** broadband estimated dark-hole control via per-sub-band probing ([3db547b](https://github.com/CoreySpohn/tiptilt/commit/3db547b438a3e6bdec4ec0f3ef0b4dc649a65970))
10
+ * **control:** close_dark_hole -- differentiable single-DM EFC loop (linearize once & hoist, tree_at command updates, propagate per step); digs a deep dark hole and differentiates through the scan ([a80c053](https://github.com/CoreySpohn/tiptilt/commit/a80c0534edeccf35c4af8b38b97464cd44b59557))
11
+ * **control:** estimated (pairwise-probe) dark-hole loop alongside oracle ([fe8cb7d](https://github.com/CoreySpohn/tiptilt/commit/fe8cb7de209f89fa8ff7254e2f6ec3447cbab885))
12
+ * **control:** generalize close_dark_hole to N deformable mirrors and broadband (chromatic) dark holes ([08d670f](https://github.com/CoreySpohn/tiptilt/commit/08d670f594da7d6e20f7d024d9547b95e3065312))
13
+ * **control:** kalman estimated loop + shared probe_measurement helper ([f4180d7](https://github.com/CoreySpohn/tiptilt/commit/f4180d746eb1609f1156e2e1d117af0e61ccb09d))
14
+ * **dm:** HardwareDM hardware-honesty layer -- DAC quantization with straight-through Jacobians, per-actuator gains and dead columns, stuck-actuator offsets, hardware_dm testbed scenario ([91e0136](https://github.com/CoreySpohn/tiptilt/commit/91e01369e608563fd859e167ba0f984330564a9e))
15
+ * **dm:** programmable actuator-grid DeformableMirror (Gaussian influence functions, coupling parameterization, per-actuator stroke limits) + callable-controller registry extension point and a bring-your-own-algorithm worked example ([5a505f3](https://github.com/CoreySpohn/tiptilt/commit/5a505f32d8a02686dd229a58e8da65efe53ec537))
16
+ * **lowfs:** pickoff low-order sensor and pointing loop (defocus-biased response matrix, integrator on the fork, pointing testbed regime) ([0158bc2](https://github.com/CoreySpohn/tiptilt/commit/0158bc2fdf7029b8f4ac6b9cf3e79fecbca483fc))
17
+ * **maintenance:** maintain_dark_hole (drift-injected hold at the dug operating point, honest model side) + mean-preserving make_detector ([3bfcef7](https://github.com/CoreySpohn/tiptilt/commit/3bfcef742916bff9d792520a31bfa95577789ee3))
18
+ * **maintenance:** maintained_residual_field exports the closed-loop residual as a TabulatedSpeckleField (drift+command sensitivities about a dug operating point); maintain_dark_hole grows return_trajectory ([05f746b](https://github.com/CoreySpohn/tiptilt/commit/05f746ba8ce565a70a08a10cd66009ffb3de6744))
19
+ * **multichannel:** cross-channel feed-forward -- MultiChannelModel dark-zone blocks, shared_dm_command, FeedForwardController, run_multichannel with reference frames and measurable NCPA aliasing ([fca42ee](https://github.com/CoreySpohn/tiptilt/commit/fca42eedb166f8aba2ebfeddad844a9b57b6cb7c))
20
+ * scaffold wavefronts -- differentiable wavefront-error generation and control (working name) ([c263d98](https://github.com/CoreySpohn/tiptilt/commit/c263d984c9d180149a41f564e0e18c49bf84320a))
21
+ * **sensing:** pairwise-probe focal-plane field estimator ([372e2f7](https://github.com/CoreySpohn/tiptilt/commit/372e2f7bdfa8db0bbe760ce68cf004bc81786f3a))
22
+ * **sensing:** recursive Kalman field estimator (one probe pair per step) ([3688eb1](https://github.com/CoreySpohn/tiptilt/commit/3688eb1aa9bfd0be090cfbd425187b5ec1baeecc))
23
+ * **sensing:** ZWFS low-order reconstruction (interaction-matrix inverse) ([746f522](https://github.com/CoreySpohn/tiptilt/commit/746f52259931915ebc8386a2a20d9f80fa9d3a33))
24
+ * **speckle:** correlated_channel_fields (one shared draw through per-channel g_shared blocks, independent local NCPA blocks) + public TabulatedSpeckleField.eps ([fdb7c40](https://github.com/CoreySpohn/tiptilt/commit/fdb7c4052c3a079f749cdde957e5ee061ae250f3))
25
+ * **speckle:** correlated_drift_field -- stationary AnalyticSpeckleField with a target cross-mode covariance via eigendecomposition spectral factorization; adversarial-review hardening (ensemble-covariance docs, input validation, low-N_eff warning) ([6b7ffd3](https://github.com/CoreySpohn/tiptilt/commit/6b7ffd38fc6de4e9c349c5ca9d12b3ce7d017702))
26
+ * **speckle:** TabulatedSpeckleField -- replay a precomputed WFE trajectory as a floor-excluded AbstractSpeckleField (the non-stationary/AR escape hatch), with physicaloptix (E_nom,G) integration ([a7c883f](https://github.com/CoreySpohn/tiptilt/commit/a7c883f06126c59352c9c4340a9bda006b8e9061))
27
+ * **testbed:** the WFSC benchmark harness -- algorithm registry, Scenario/Metrics with stroke caps, run/sweep, seven scenario builders (dig, one-vs-two DM, hold, ncpa_limited, aliasing, dual-science, wfs+science) ([99afbd9](https://github.com/CoreySpohn/tiptilt/commit/99afbd9c6378dea15f0a2956af60cded4d455fc1))
28
+ * **turbulence:** von Karman/Kolmogorov phase screens with frozen flow (ground-turbulence aberration generation) ([28d0756](https://github.com/CoreySpohn/tiptilt/commit/28d07567ad1868f9506202acfb7060c9dc8b94cc))
29
+ * wire release automation and docs -- release-please, PyPI trusted publishing, hatch-vcs versioning, sphinx + ReadTheDocs scaffold ([3fcd2e8](https://github.com/CoreySpohn/tiptilt/commit/3fcd2e8c2b9fe5f51c4b685bc01d552ec08238f9))
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * **control:** guard empty dark zone, non-PhaseScreen dm_index, and non-positive regularization; document single-DM/mono/one-sided scope + dense-jacfwd scaling (adversarial-review hardening) ([53fa069](https://github.com/CoreySpohn/tiptilt/commit/53fa06949e4d137d59fb17f2253f5d4e8120072f))
tiptilt-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Corey Spohn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
tiptilt-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: tiptilt
3
+ Version: 0.1.0
4
+ Summary: Differentiable wavefront-error generation and wavefront control for the HWO direct imaging simulation suite
5
+ Author-email: Corey Spohn <corey.a.spohn@nasa.gov>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Corey Spohn
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ License-File: LICENSE
28
+ Classifier: Development Status :: 3 - Alpha
29
+ Classifier: Intended Audience :: Science/Research
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Programming Language :: Python :: 3
32
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
33
+ Requires-Python: >=3.11
34
+ Requires-Dist: equinox>=0.12.0
35
+ Requires-Dist: hwoutils
36
+ Requires-Dist: jax>=0.4.1
37
+ Requires-Dist: jaxlib>=0.4.1
38
+ Requires-Dist: jaxtyping
39
+ Requires-Dist: numpy
40
+ Requires-Dist: optixstuff>=1.5.0
41
+ Requires-Dist: physicaloptix
42
+ Provides-Extra: dev
43
+ Requires-Dist: pre-commit; extra == 'dev'
44
+ Provides-Extra: docs
45
+ Requires-Dist: myst-nb; extra == 'docs'
46
+ Requires-Dist: sphinx-autoapi; extra == 'docs'
47
+ Requires-Dist: sphinx-book-theme; extra == 'docs'
48
+ Provides-Extra: test
49
+ Requires-Dist: hypothesis; extra == 'test'
50
+ Requires-Dist: pytest; extra == 'test'
51
+ Requires-Dist: pytest-cov; extra == 'test'
52
+ Requires-Dist: pytest-xdist; extra == 'test'
53
+ Description-Content-Type: text/markdown
54
+
55
+ # tiptilt
56
+
57
+ Differentiable wavefront-error generation and wavefront control for the HWO
58
+ direct imaging simulation suite.
59
+
60
+ > Named for tip and tilt, the humblest wavefront correction.
61
+
62
+ ## What it is
63
+
64
+ `tiptilt` owns the two halves of the wavefront program that the propagation
65
+ engine (`physicaloptix`) deliberately leaves out:
66
+
67
+ 1. **Aberration generation.** A physically meaningful mode basis (segment
68
+ piston/tip/tilt, deformable-mirror influence functions, Zernikes) plus
69
+ per-mode temporal statistics produce a drifting wavefront-error realization.
70
+ It is delivered as a time-varying speckle residual implementing the
71
+ `optixstuff.AbstractSpeckleField` contract, built on the `(E_nom, G)`
72
+ linearization `physicaloptix` provides, so the image and yield layers consume
73
+ it unchanged.
74
+ 2. **Wavefront control.** Wavefront-sensor estimators, a reconstructor over the
75
+ same `(E_nom, G)` product (electric-field conjugation in space, a modal loop
76
+ on the ground), and a differentiable control loop that commands the
77
+ deformable mirror.
78
+
79
+ Space wavefront control is the priority; atmospheric turbulence shares the loop,
80
+ the mode basis, and the residual interface.
81
+
82
+ ## What is here
83
+
84
+ - **Aberration sources** (`speckle`, `turbulence`): a stationary
85
+ spectrally-factorized drift field, a tabulated replay field, correlated
86
+ multi-channel realizations, and von Karman / frozen-flow screens.
87
+ - **Sensing** (`sensing`): pairwise probe estimation, Zernike wavefront
88
+ sensor calibration and reconstruction, and Kalman field estimators behind
89
+ a common `AbstractEstimator` seam.
90
+ - **Control** (`control`): electric-field conjugation, stroke minimization,
91
+ and a predictive law behind a common `AbstractController` seam, with
92
+ `close_dark_hole` as the driver.
93
+ - **Operations** (`maintenance`, `multichannel`): dark-hole maintenance
94
+ under injected drift with honest model/truth separation, and cross-channel
95
+ feed-forward on a shared deformable mirror.
96
+ - **Hardware** (`dm`): a programmable actuator-grid deformable mirror
97
+ (Gaussian influence functions, per-actuator stroke limits) whose command
98
+ vector is actuator-space, the language published control algorithms speak.
99
+ - **Benchmarking** (`testbed`): an algorithm registry, scenario builders
100
+ (dig from cold, hold against drift, NCPA-limited, dual-channel), metrics,
101
+ and `run`/`sweep` drivers. Custom laws plug in by implementing one method;
102
+ see `examples/custom_controller.py`.
103
+
104
+ The mode-basis constructors it builds on (`zernike_basis`,
105
+ `segment_ptt_basis`, `fourier_dm_basis`) live in `physicaloptix`.
106
+
107
+ ## Layout
108
+
109
+ - `src/tiptilt/` -- the package.
110
+ - `tests/` -- the test suite (pytest, CPU/x64-pinned like `physicaloptix`).
111
+ - `examples/` -- worked examples (bring-your-own control algorithm).
@@ -0,0 +1,57 @@
1
+ # tiptilt
2
+
3
+ Differentiable wavefront-error generation and wavefront control for the HWO
4
+ direct imaging simulation suite.
5
+
6
+ > Named for tip and tilt, the humblest wavefront correction.
7
+
8
+ ## What it is
9
+
10
+ `tiptilt` owns the two halves of the wavefront program that the propagation
11
+ engine (`physicaloptix`) deliberately leaves out:
12
+
13
+ 1. **Aberration generation.** A physically meaningful mode basis (segment
14
+ piston/tip/tilt, deformable-mirror influence functions, Zernikes) plus
15
+ per-mode temporal statistics produce a drifting wavefront-error realization.
16
+ It is delivered as a time-varying speckle residual implementing the
17
+ `optixstuff.AbstractSpeckleField` contract, built on the `(E_nom, G)`
18
+ linearization `physicaloptix` provides, so the image and yield layers consume
19
+ it unchanged.
20
+ 2. **Wavefront control.** Wavefront-sensor estimators, a reconstructor over the
21
+ same `(E_nom, G)` product (electric-field conjugation in space, a modal loop
22
+ on the ground), and a differentiable control loop that commands the
23
+ deformable mirror.
24
+
25
+ Space wavefront control is the priority; atmospheric turbulence shares the loop,
26
+ the mode basis, and the residual interface.
27
+
28
+ ## What is here
29
+
30
+ - **Aberration sources** (`speckle`, `turbulence`): a stationary
31
+ spectrally-factorized drift field, a tabulated replay field, correlated
32
+ multi-channel realizations, and von Karman / frozen-flow screens.
33
+ - **Sensing** (`sensing`): pairwise probe estimation, Zernike wavefront
34
+ sensor calibration and reconstruction, and Kalman field estimators behind
35
+ a common `AbstractEstimator` seam.
36
+ - **Control** (`control`): electric-field conjugation, stroke minimization,
37
+ and a predictive law behind a common `AbstractController` seam, with
38
+ `close_dark_hole` as the driver.
39
+ - **Operations** (`maintenance`, `multichannel`): dark-hole maintenance
40
+ under injected drift with honest model/truth separation, and cross-channel
41
+ feed-forward on a shared deformable mirror.
42
+ - **Hardware** (`dm`): a programmable actuator-grid deformable mirror
43
+ (Gaussian influence functions, per-actuator stroke limits) whose command
44
+ vector is actuator-space, the language published control algorithms speak.
45
+ - **Benchmarking** (`testbed`): an algorithm registry, scenario builders
46
+ (dig from cold, hold against drift, NCPA-limited, dual-channel), metrics,
47
+ and `run`/`sweep` drivers. Custom laws plug in by implementing one method;
48
+ see `examples/custom_controller.py`.
49
+
50
+ The mode-basis constructors it builds on (`zernike_basis`,
51
+ `segment_ptt_basis`, `fourier_dm_basis`) live in `physicaloptix`.
52
+
53
+ ## Layout
54
+
55
+ - `src/tiptilt/` -- the package.
56
+ - `tests/` -- the test suite (pytest, CPU/x64-pinned like `physicaloptix`).
57
+ - `examples/` -- worked examples (bring-your-own control algorithm).
@@ -0,0 +1,28 @@
1
+ """Sphinx configuration."""
2
+
3
+ from importlib.metadata import version as get_version
4
+
5
+ project = "tiptilt"
6
+ release = get_version("tiptilt")
7
+ version = ".".join(release.split(".")[:2])
8
+
9
+ extensions = [
10
+ "myst_nb",
11
+ "autoapi.extension",
12
+ "sphinx.ext.autodoc",
13
+ "sphinx.ext.napoleon",
14
+ "sphinx.ext.viewcode",
15
+ "sphinx.ext.mathjax",
16
+ ]
17
+
18
+ autoapi_dirs = ["../src"]
19
+ autoapi_ignore = ["**/*version.py"]
20
+ myst_enable_extensions = ["amsmath", "dollarmath"]
21
+
22
+ html_theme = "sphinx_book_theme"
23
+ html_context = {"default_mode": "dark"}
24
+ source_suffix = {".rst": "restructuredtext", ".md": "myst-nb"}
25
+
26
+ nb_execution_mode = "auto"
27
+ nb_execution_timeout = 120
28
+ nb_execution_raise_on_error = True
@@ -0,0 +1,32 @@
1
+ # tiptilt
2
+
3
+ Differentiable wavefront-error generation and wavefront control for the
4
+ HWO direct imaging simulation suite.
5
+
6
+ > Named for tip and tilt, the humblest wavefront correction.
7
+
8
+ `tiptilt` owns the two halves of the wavefront program that the
9
+ propagation engine (`physicaloptix`) deliberately leaves out:
10
+
11
+ 1. **Aberration generation.** A physically meaningful mode basis
12
+ (segment piston/tip/tilt, deformable-mirror influence functions,
13
+ Zernikes) plus per-mode temporal statistics produce a drifting
14
+ wavefront-error realization, delivered as a time-varying speckle
15
+ residual implementing the `optixstuff.AbstractSpeckleField` contract
16
+ on top of the `(E_nom, G)` linearization the engine provides.
17
+ 2. **Wavefront control.** Wavefront-sensor estimators, a reconstructor
18
+ over the same `(E_nom, G)` product (electric-field conjugation in
19
+ space, a modal loop on the ground), and a differentiable control
20
+ loop that commands the deformable mirror.
21
+
22
+ The library keeps its devices and control loop private and exposes only
23
+ the resulting residual through the speckle seam, so the image and yield
24
+ layers pick it up without any change. Space wavefront control is the
25
+ priority; atmospheric turbulence shares the loop, the mode basis, and
26
+ the residual interface.
27
+
28
+ ```{toctree}
29
+ :maxdepth: 1
30
+
31
+ API reference <autoapi/index>
32
+ ```