pyTomoAO.slodar.pseudo_open_loop_slopes

pyTomoAO.slodar.pseudo_open_loop_slopes(slopes, commands, interactionMatrix, delay=1, sign=1.0)[source]

Pseudo-open-loop slopes from closed-loop telemetry.

In closed loop the sensors measure the turbulence minus the correction the deformable mirror applied while the frame was integrated. Adding that correction back,

\[s_{\rm pol}(t) = s(t) + \sigma\, M_{\rm int}\, c(t - \tau),\]

recovers (to the accuracy of the interaction matrix and the sensor linearity) the slopes an open-loop sensor would have measured, which is what SLODAR and the MMSE reconstructor’s covariance model describe.

Parameters:
  • slopes (array_like) – (nFrames, nSlopes) closed-loop slopes, one row per loop step.

  • commands (array_like) – (nFrames, nActuators) commands, row t being the command computed at step t (the same time base as slopes).

  • interactionMatrix (array_like) – (nSlopes, nActuators) interaction matrix, in the units of slopes per unit command.

  • delay (int, optional) – Frames between computing a command and the slopes it affects, tau (default 1: the command computed at t - 1 was on the mirror during frame t). Only whole frames are supported; real loops often have a fractional delay (e.g. about 1.5 frames), which this approximates by the nearest integer.

  • sign (float, optional) –

    How the recorded commands act on the slopes. Write the closed-loop measurement as s = s_ol + sigma_DM * M c with M the interaction matrix as measured and c the recorded command; then sign = -sigma_DM:

    • +1 (default): the loop applies the opposite of the recorded command, so s = s_ol - M c. This is the usual case when M is measured by poking +c but the DM is driven with -c, as in SPECULA (DM with its default sign: -1 and an IM calibrated with sign: 1).

    • -1: the recorded command is applied as is and M was measured by poking that same command, so s = s_ol + M c.

    Self-check: in a well-corrected loop the wrong sign gives s_pol close to -s_ol, with almost the same variance (and spatial covariance) as the right one, so the variance does not tell them apart. The frame-to-frame increments do: the right sign recovers the temporally smooth open-loop slopes, while the wrong one keeps the servo-lag jitter. np.var(np.diff(s_pol, axis=0)) is typically 2-4x smaller for the right sign.

Returns:

numpy.ndarray – (nFrames - delay, nSlopes) pseudo-open-loop slopes, aligned with slopes[delay:].