Metadata-Version: 2.4
Name: tiptilt
Version: 0.1.0
Summary: Differentiable wavefront-error generation and wavefront control for the HWO direct imaging simulation suite
Author-email: Corey Spohn <corey.a.spohn@nasa.gov>
License: MIT License
        
        Copyright (c) 2026 Corey Spohn
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.11
Requires-Dist: equinox>=0.12.0
Requires-Dist: hwoutils
Requires-Dist: jax>=0.4.1
Requires-Dist: jaxlib>=0.4.1
Requires-Dist: jaxtyping
Requires-Dist: numpy
Requires-Dist: optixstuff>=1.5.0
Requires-Dist: physicaloptix
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-nb; extra == 'docs'
Requires-Dist: sphinx-autoapi; extra == 'docs'
Requires-Dist: sphinx-book-theme; extra == 'docs'
Provides-Extra: test
Requires-Dist: hypothesis; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-xdist; extra == 'test'
Description-Content-Type: text/markdown

# tiptilt

Differentiable wavefront-error generation and wavefront control for the HWO
direct imaging simulation suite.

> Named for tip and tilt, the humblest wavefront correction.

## What it is

`tiptilt` owns the two halves of the wavefront program that the propagation
engine (`physicaloptix`) deliberately leaves out:

1. **Aberration generation.** A physically meaningful mode basis (segment
   piston/tip/tilt, deformable-mirror influence functions, Zernikes) plus
   per-mode temporal statistics produce a drifting wavefront-error realization.
   It is delivered as a time-varying speckle residual implementing the
   `optixstuff.AbstractSpeckleField` contract, built on the `(E_nom, G)`
   linearization `physicaloptix` provides, so the image and yield layers consume
   it unchanged.
2. **Wavefront control.** Wavefront-sensor estimators, a reconstructor over the
   same `(E_nom, G)` product (electric-field conjugation in space, a modal loop
   on the ground), and a differentiable control loop that commands the
   deformable mirror.

Space wavefront control is the priority; atmospheric turbulence shares the loop,
the mode basis, and the residual interface.

## What is here

- **Aberration sources** (`speckle`, `turbulence`): a stationary
  spectrally-factorized drift field, a tabulated replay field, correlated
  multi-channel realizations, and von Karman / frozen-flow screens.
- **Sensing** (`sensing`): pairwise probe estimation, Zernike wavefront
  sensor calibration and reconstruction, and Kalman field estimators behind
  a common `AbstractEstimator` seam.
- **Control** (`control`): electric-field conjugation, stroke minimization,
  and a predictive law behind a common `AbstractController` seam, with
  `close_dark_hole` as the driver.
- **Operations** (`maintenance`, `multichannel`): dark-hole maintenance
  under injected drift with honest model/truth separation, and cross-channel
  feed-forward on a shared deformable mirror.
- **Hardware** (`dm`): a programmable actuator-grid deformable mirror
  (Gaussian influence functions, per-actuator stroke limits) whose command
  vector is actuator-space, the language published control algorithms speak.
- **Benchmarking** (`testbed`): an algorithm registry, scenario builders
  (dig from cold, hold against drift, NCPA-limited, dual-channel), metrics,
  and `run`/`sweep` drivers. Custom laws plug in by implementing one method;
  see `examples/custom_controller.py`.

The mode-basis constructors it builds on (`zernike_basis`,
`segment_ptt_basis`, `fourier_dm_basis`) live in `physicaloptix`.

## Layout

- `src/tiptilt/` -- the package.
- `tests/` -- the test suite (pytest, CPU/x64-pinned like `physicaloptix`).
- `examples/` -- worked examples (bring-your-own control algorithm).
