Skip to content

pyturb

Fast, GPU-optional atmospheric turbulence for adaptive optics.

pyturb generates the optical path differences (OPD) an adaptive-optics system sees through the atmosphere: full layered turbulence for a representative sky, with per-layer wind, frozen-flow time evolution, off-axis directions, and standard site profiles. It runs on NumPy by default and switches to CUDA (via CuPy) with a single argument.

import pyturb

atm = pyturb.Atmosphere.from_profile(
    "paranal-median", seeing=0.8, zenith_angle=30, diameter=8.0, n=512, seed=1,
)
print(atm.r0, atm.theta0, atm.tau0)          # Fried param, iso angle, tau0

for t, opd in atm.frames(dt=1e-3, steps=2000):
    ...                                      # (512, 512) OPD in metres

Why pyturb

  • Fast. 30,629 independent 512² screens/s and a full 9-layer 512² atmosphere at 3,133 fps on a consumer GPU — see Comparison.
  • Correct. The spatial statistics match von Kármán/Kolmogorov theory to a couple of percent, enforced by tests — see Validation.
  • Complete. Named site profiles, off-axis tomography, boiling, LGS cone, OPD-native output, and a diagnostics toolkit (pyturb.analysis).

Install

pip install pyturb                 # CPU
pip install pyturb[cuda12]         # + CuPy for CUDA 12 (or [cuda11])
pip install pyturb[fits]           # + FITS I/O

Where to next

  • Quickstart — the three-line path to OPD frames.
  • Concepts — r0, L0, Cn², θ0, τ0 for newcomers.
  • Validation — the evidence, regenerated by CI.
  • Comparison — head-to-head vs aotools, soapy, HCIPy.
  • Interop — recipes for HCIPy, poppy, DM fitting.
  • API reference — every public function and class.