Static Response Matrix & Modal Basis
Acquires Hadamard/direct static RM and computes SVD modal control matrix.
Overview & Role
Takes a reference WFS image (takeref), probes zonal Hadamard or direct Zernike patterns (RM), and performs GPU SVD inversion (compstrCM) to build the modal basis (DMmodes), WFS reconstructor (CM), and modal-to-DM projection matrices.
Supports unthrottled lockstep step-and-shoot calibration (RM/FAST) under fused cacaosim as well as archiving and reloading calibrated RMs across runs.
Compute Units / Entry Points: cacao-fpsexec-cacaoac-measlinrespcacao-fpsexec-cacaocc-compstrcm
Verified Highlights:
- 1,024+ controlled modes on Stage 1 (64x64) and 1,255 modes on Stage 2 (50x50)
Option Variants (CODE/OPT)
| Option Code | Behavior & Usage | Main Flags |
|---|---|---|
RM/HAD | Real-time paced Hadamard zonal RM + SVD KL/Fourier modal basis. | --nbloop --no-fast-calib --svdlim1 --svdlim2 |
RM/FAST | Unthrottled fused-bench step-and-shoot RM acquisition (default). | --save-rm --load-rm |
RM/DIR | Direct low-order Zernike modal RM used by Stage-3 LLOWFS. | --svdlim3 |
Dependencies & Calibration Chain
Upstream Calibrations & Inputs
Selected Algorithm
★ Current Entry
RMOffline Calib
Static Response Matrix & Modal Basis
Feeds & Enables Downstream
CLI Flags, Environment Variables & FPS Parameters
| Layer | Option (Links to Reference) | Default | Description |
|---|---|---|---|
| CLI Flag | --nbloop | 1 | Hadamard response-matrix averaging cycles per AO stage |
| CLI Flag | --no-fast-calib | OFF | Disable fused lockstep step-and-shoot RM; use real-time paced RM |
| CLI Flag | --svdlim1 | 0.004 | Stage-1 AO3k SVD singular-value truncation threshold |
| CLI Flag | --svdlim2 | 0.004 | Stage-2 SCExAO SVD singular-value truncation threshold |
| CLI Flag | --svdlim3 | 0.02 | Stage-3 LLOWFS SVD singular-value truncation threshold |
| CLI Flag | --save-rm | _work/ao3k_scexao_rm | Directory to archive Stage-1 & Stage-2 calibrated response matrices |
| CLI Flag | --load-rm | — | Load pre-saved response matrices from <dir>/stage1 and <dir>/stage2 |
| CACAO_* Env | CACAO_SVDLIM | 0.004 / 0.004 / 0.02 | SVD singular-value cutoff threshold for control matrix inversion |
| CACAO_* Env | CACAO_CPAMAX | 28 / 22 / 4 | Maximum controlled spatial frequency [cycles/aperture] for KL/Zernike basis |
| CACAO_* Env | CACAO_RCPAMAX | 28.5 / 22.5 / 4.5 | Radial spatial frequency ceiling [cycles/aperture] for modal basis |
| CACAO_* Env | CACAO_DELTACPA | 1.0 | Spatial frequency bin step [cycles/aperture] for modal basis |
| CACAO_* Env | CACAO_POKEAMPL | 0.015 / 0.010 / 0.015 | DM poke amplitude [um RMS] during response-matrix acquisition |
| CACAO_* Env | CACAO_FAST_CALIB | 0 | Enable unthrottled lockstep step-and-shoot RM via csim_htsim (0/1) |
| CACAO_* Env | CACAO_NMODES_DIRECT | 14 | Direct Zernike mode count used by Stage-3 LLOWFS modal calibration |
Implementation, Tests & Related Reports
Source Files
Verification Tests
test_00_stack_sanity.pyao3k_phases1to5_calib.milk