Skip to content

Cannot generate DM shape image #123

@shiqi1994

Description

@shiqi1994

Firstly, I would like to thank you for your great work!!

I have some trouble in generating multiple frames of DM shape images, here is my code:

import soapy

sim = soapy.Sim("conf/vicky.yaml")
sim.aoinit()
sim.makeIMat()
sim.aoloop()

soapy_config = sim.config

circle_mask = soapy.simulation.make_mask(soapy_config)
dm_cmds = sim.allDmCommands 
dmClass = soapy.DM.DM(soapy_config, n_dm=0, mask=circle_mask)
dmFrame = dmClass.dmFrame(dm_cmds)

And the warning massage is:

Traceback (most recent call last):

  File "/home/vicky/soapy/untitled3.py", line 24, in <module>
    dmFrame = dmClass.dmFrame(dm_cmds)

  File "/home/vicky/soapy/soapy/DM.py", line 164, in dmFrame
    self.dm_shape = self.makeDMFrame(dmCommands)

  File "/home/vicky/soapy/soapy/DM.py", line 200, in makeDMFrame
    dm_shape = (self.iMatShapes.T*actCoeffs.T).T.sum(0)

ValueError: operands could not be broadcast together with shapes (9,) (81,6) 

And the configuration about DM is:

DM:
  0:
    type: FastPiezo
    closed: False
    nxActuators: 9
    iMatValue: 500

May I ask how can I generate DM shape images?

And what the exact meaning of the nxActuators ?

Look forward to your kind replay! Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions