run_cl

Overview

run_cl() executes a standard single-stage AO closed-loop simulation. It applies noise settings from the parameter file, builds the mis-registration-aware reconstructor, then iterates the loop for param['nLoop'] frames, recording residual variance and Strehl ratio.

API reference

OOPAO.closed_loop.run_cl.run_cl(param, obj)[source]

Run a single-stage AO closed loop.

Parameters:
  • param (dict) –

    Parameter dictionary. Expected keys include:

    • 'nLoop' — number of loop iterations.

    • 'gainCL' — integral controller gain.

    • 'nPhotonPerSubaperture' — NGS flux.

    • 'photonNoise' — bool, enable photon noise.

    • 'readoutNoise' — float, readout noise in electrons.

    • 'nModes' — number of controlled modes.

    • 'nSubaperture' — number of WFS subapertures.

  • obj (object) – AO system object with attributes tel, dm, wfs, ngs, atm, calib, M2C_cl, and param.

Returns:

Dictionary containing 'SR' (Strehl ratio per frame), 'var' (residual wavefront variance), and optionally saved interaction matrices.

Return type:

dict

Example

from OOPAO.closed_loop.run_cl import run_cl

out = run_cl(param, ao_obj)

import matplotlib.pyplot as plt
plt.plot(out['SR'])
plt.xlabel('Frame')
plt.ylabel('Strehl Ratio')