soapy icon indicating copy to clipboard operation
soapy copied to clipboard

Inquiry Regarding SOapy Adaptive Optics Configuration Parameters: Pupil Size, Simulation Performance, and Strehl Ratio Behaviour

Open gurwindersinghhundal opened this issue 1 year ago • 6 comments

Hi, I'd like to gather some information regarding parameters defined in YAML-based configuration files for different adaptive optics systems, specifically focusing on SOapy AO.

  1. What does "pupil size" mean, as indicated by something like "pupilSize: 100" in the configuration file?

  2. For a particular pupil size, the AO simulations perform well. For instance, with a 2m class telescope, considering a 17x17 Shack-Hartmann wavefront sensor (SHWS) lenslet array and an 18x18 deformable mirror, selecting a pupil size of 100 leads to successful NGS (Natural Guide Star) AO simulations. However, when I increase the pupil size to 264, especially for off-axis fields of view (FOV) of the detector, the AO simulation either stops working or freezes intermittently. Could you please explain why this happens?

  3. I've observed that the Strehl ratio remains constant regardless of the magnitude of the guide star. Ideally, it should decrease as the magnitude of the star increases. Can you help identify the reason for this or suggest any changes needed to achieve this variation?

gurwindersinghhundal avatar Feb 23 '24 11:02 gurwindersinghhundal

Hi @gurwindersinghhundal, thanks for your questions.

  1. Pupil size is the number of simulation elements (pixels) across the telescope pupil. So larger numbers increase the resolution of the simulation in the pupil (aperture) plane.
  2. Could you share your config file? Increasing the pupilSize should not break the simulation in this way
  3. By default no noise is included in either the WFS or science cameras. You need to set photonNoise: True in your WFS/science camera for the guide star magnitude to make a difference. You can also add read noise in electrons with the eReadNoise parameter.

ojdf avatar Feb 28 '24 11:02 ojdf

I have the following questions:

  1. How is pupil size related to wavefront sensor subapertures and deformable mirror? I mean, how does pupil size affect the wavefront sensor?

  2. I added photon noise to the wavefront sensor (WFS) in the configuration file (for NGS). It gives good Strehl ratios until the magnitude of 10/11. However, suddenly, it decreases to 1% when I choose a guide star magnitude of 12 with the AO loop on. Ideally, it should decrease almost linearly until the magnitude of 18 with the AO loop on. It gives the good strehl with AO loop off, by setting the gain of DM and WFS on GUI to zero.

  3. I have performed above simulations in visible band. The same phenomenon occurs across different spectral bands (J, H, K bands).

I have attached the following configuration files below: a) sh_8x8.yaml (default conf file provided by soapy) b) sh_8x8_IIA.yaml (my configuration file)

gurwindersinghhundal avatar Mar 05 '24 05:03 gurwindersinghhundal

this is default configuration file provided by the soapy : sh_8x8.yaml (NGS) simName: pupilSize: 100 nGS: 1 nDM: 2 nSci: 1 nIters: 5000 loopTime: 0.0025 threads: 4

verbosity: 2

saveCMat: False saveSlopes: True saveDmCommands: False saveLgsPsf: False saveSciPsf: True

Atmosphere: scrnNo: 4 scrnHeights: [0, 5000, 10000, 15000] scrnStrengths: [0.5, 0.3, 0.1, 0.1] windDirs: [0, 45, 90, 135] windSpeeds: [10, 10, 15, 20] wholeScrnSize: 2048 r0: 0.16 L0: [20, 20, 20, 20] infinite: True

Telescope: telDiam: 8. obsDiam: 1.1 mask: circle

WFS: 0: type: ShackHartmann GSPosition: [0, 0] GSHeight: 0 GSMag: 8 nxSubaps: 8 pxlsPerSubap: 10 subapFOV: 2.5 wavelength: 600e-9

DM: 0: type: TT closed: True iMatValue: 0.25

1: type: FastPiezo closed: True nxActuators: 9 iMatValue: 500

Reconstructor: type: MVM svdConditioning: 0.03 gain: 0.6

Science: 0: position: [0, 0] FOV: 1 wavelength: 1.65e-6 pxls: 64

gurwindersinghhundal avatar Mar 05 '24 05:03 gurwindersinghhundal

This is my configuration file: sh_8x8_IIA.yaml

simName: pupilSize: 100 nGS: 1 nDM: 2 nSci: 1 nIters: 500 loopTime: 0.0025 threads: 4

verbosity: 2

saveCMat: False saveSlopes: True saveDmCommands: False saveLgsPsf: False saveSciPsf: True

Atmosphere: scrnNo: 4 scrnHeights: [0, 5000, 10000, 15000] scrnStrengths: [0.5, 0.3, 0.1, 0.1] windDirs: [0, 45, 90, 135] windSpeeds: [10, 10, 15, 20] wholeScrnSize: 2048 r0: 0.13 L0: [20, 20, 20, 20] infinite: True

Telescope: telDiam: 2.01 obsDiam: 0.337 mask: circle

WFS: 0: type: ShackHartmann GSPosition: [0, 0] GSHeight: 0 GSMag: 8 nxSubaps: 11 pxlsPerSubap: 10 subapFOV: 2.5 wavelength: 600e-9 photonNoise: True eReadNoise: 0 DM: 0: type: TT closed: True iMatValue: 0.25

1: type: FastPiezo closed: True nxActuators: 12 iMatValue: 500

Reconstructor: type: MVM svdConditioning: 0.03 gain: 0.6

Science: 0: position: [0, 0] FOV: 60 wavelength: 0.65e-6 pxls: 256

gurwindersinghhundal avatar Mar 05 '24 05:03 gurwindersinghhundal

I have the following questions:

How is pupil size related to wavefront sensor subapertures and deformable mirror? I mean, how does pupil size affect the wavefront sensor?

I added photon noise to the wavefront sensor (WFS) in the configuration file (for NGS). It gives good Strehl ratios until the magnitude of 10/11. However, suddenly, it decreases to 1% when I choose a guide star magnitude of 12 with the AO loop on. Ideally, it should decrease almost linearly until the magnitude of 18 with the AO loop on. It gives the good strehl with AO loop off, by setting the gain of DM and WFS on GUI to zero.

I have performed above simulations in visible band. The same phenomenon occurs across different spectral bands (J, H, K bands).

I have attached the following configuration files below: a) sh_8x8.yaml (default conf file provided by soapy) b) sh_8x8_IIA.yaml (my configuration file)

gurwindersinghhundal avatar Mar 08 '24 04:03 gurwindersinghhundal

Pupil size defines the resolution of the turbulent phase screens that are the input to the WFS. There are some rules of thumb around this, usually you want to at least Nyquist sample the WFS subaperture size and/or r0, whichever is smaller. A pupilsize of 100 should accomplish this (100/17=5.8 pixels per subap). I tried your config file and the "freezes" you are getting are because of errors in the code that are shown in the terminal (not the GUI). When using 264 pixels and looking off-axis you get

numpy.linalg.LinAlgError: Could not invert Covariance Matrix to for A and B Matrices. Try with a larger pixel scale or smaller L0

This means your pixel scale is too small (equivalently, pupilSize too large) to compute the phase screens. This is a separate issue but can easily be solved by using a smaller pupilSize.

I don't believe the strehl ratio will necessarily decrease linearly with increasing noise. What you describe sounds like the loop collapsing at higher noise. This usually means you need to adjust the gain values for the DM(s) until you get a stable loop. You will need to perform this adjustment for each different noise value.

ojdf avatar Mar 13 '24 14:03 ojdf