KL Modal Basis¶
Overview¶
compute_KL_basis() computes the Karhunen-Loève (KL) modal basis for a DM by diagonalising the atmosphere covariance projected onto the DM influence functions. The resulting basis is ordered from lowest to highest spatial frequency (first modes are piston, tip, tilt, then higher-order modes).
This is the recommended modal basis for closed-loop AO control in OOPAO.
API reference¶
- OOPAO.calibration.compute_KL_modal_basis.compute_KL_basis(tel, atm, dm, lim=1e-3, remove_piston=True, n_batch=1)¶
Compute the KL modal basis for a DM/atmosphere combination.
- Parameters:
tel (Telescope) – Telescope object.
atm (Atmosphere) – Atmosphere object (defines the turbulence statistics for the covariance).
dm (DeformableMirror) – Deformable mirror object.
lim (float) – Inversion threshold for the covariance matrix. Default
1e-3.remove_piston (bool) – If
True, remove the piston mode from the basis. DefaultTrue.n_batch (int) – Number of batches for memory-efficient covariance computation. Default
1.
- Returns:
Mode-to-command (M2C) matrix of shape
(n_actuators, n_modes).- Return type:
Example
from OOPAO.calibration.compute_KL_modal_basis import compute_KL_basis M2C = compute_KL_basis(tel, atm, dm) dm.coefs = M2C # visualise all modes as OPD maps