AOtools / soapy

A Python Adaptive Optics Simulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learn & Apply algorithm

littlepitta opened this issue · comments

I read Vidal's and your thesis paper and used Soapy to set up a learn & apply algorithm simulation.

Here's what I have done.
I used reconstructor as LearnAndApply,
and put 2 DMs: TT with closed and FastPiezo with open, so that TT can work as a so-called "truth sensor".
However, I came up with an error that saying the matrix shape didn't fit.
I think it is something to do with WFS-nxSubaps and DM-nxActuators problem, but I couldn't figure out how to fix it.

Anyway, 2 DMs didn't work, so I only used one DM which is FastPiezo.
Now this time, the simulation works fine but the value of the Strehl ratio is too low like 0.2 or so.
(there is no value in cMat.fits, maybe this is why?)
When I used reconstructor as MVM with closed DM, the Strehl ratio was high around 0.4.

To sum up,

  1. How do I use 2 DMs?
  2. How do I get a fair Strehl ratio with the Learn&Apply algorithm?

Sorry for the long post.
Thanks

Hi @littlepitta, as a starting point can you post the config file that you are using? Thanks

Sorry for the late reply.
Currently, my computer is not available right now, so I'm just writing with my memory.

By the way, I referred to the samples in the conf folder at first, sh_8x8_learn&apply.yaml should be fixed because the reconstructor is not LearnAndApply, but MVM.

I'm thinking of using 3 Laser Tomography along with 1 on-axis sensor.
So I came up with the following

nGS: 4 
nDM: 2
nSci: 1

for WFS,

WFS
  0:
    GSPosition: [0, 0]
    GSHeight: 0
 ....

  1:
    GSPosition: [0, 10]
    GSHeight: 90000
    wavelength: 589e-9
    nxSubaps: 10
...

and WFS 2,3 are all the same but GSPosition.

for DM,

DM:
  0:
    type: TT
    closed: False
    iMatValue: 0.5
    gain: 0.6
 
  1:
    type: FastPiezo
    closed: False
    nxActuators: 10
    iMatValue: 1000
    svdConditioning: 0.05
    gain: 0.6

for Reconstructor,

Reconstructor:
  type: LearnAndApply
  svdConditioning: 0.05
  gain: 0.6
...

And this conf file does not work. It says that the matrix shape doesn't fit.
However, these two conf works

Single DM + L&A Reconstructor -> Strehl ratio 0.2
2DMs + MVM Reconstructor ->Strehl ratio 0.4

I cannot figure out why.

One last question, does gui mode works in Linux?
I tried Soapy with 3 OS: Mac, Windows, Ubuntu, Mac & Windows work fine but gui doesn't work in Ubuntu.
(It could be my problem though)

Thanks!

Hi, I've had a look at the LearnAndApply reconstructor. It has been a long time since it has been used so there were various updates that needed to happen. Please try out the sh_8x8_learn&apply.yaml config in my fork https://github.com/ojdf/soapy/tree/learn-apply-fixes

Re: gui, I've just tested on Rocky Linux 8 and it works, are you using the most recent version of soapy?

@ojdf Hi, thanks for the reply.
I found your fork sh_8x8_learn&apply.yaml, but I have a few questions including recent changes.

  1. The system changed into closed loop
  2. TT DM was removed.
    I thought that Learn&Apply algorithm is open loop system with "truth sensor" closed. Is that applied in yaml file?

Thanks!

p.s.
[https://github.com/ojdf/soapy/tree/learn-apply-fixes]
is this the most recent ver.?

Hi @littlepitta I've merged the L&A changes into the master soapy branch now so this is the most up to date version.

Re: closed loop, if you change to open loop it still works, but not as well. I will leave this open for now in case @andrewpaulreeves wants to chime in.