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, rowtbeing the command computed at stept(the same time base asslopes).interactionMatrix (
array_like) –(nSlopes, nActuators)interaction matrix, in the units ofslopesper unit command.delay (
int, optional) – Frames between computing a command and the slopes it affects,tau(default 1: the command computed att - 1was on the mirror during framet). 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 cwithMthe interaction matrix as measured andcthe recorded command; thensign = -sigma_DM:+1(default): the loop applies the opposite of the recorded command, sos = s_ol - M c. This is the usual case whenMis measured by poking+cbut the DM is driven with-c, as in SPECULA (DMwith its defaultsign: -1and an IM calibrated withsign: 1).-1: the recorded command is applied as is andMwas measured by poking that same command, sos = s_ol + M c.
Self-check: in a well-corrected loop the wrong sign gives
s_polclose 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 withslopes[delay:].