Reconstructors

Classes simulating AO reconstructors.

soapy.RECON module

class soapy.RECON.ANN(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: soapy.RECON.Reconstructor

Reconstructs using a neural net Assumes on axis slopes are WFS 0

Net must be set by setting sim.recon.net = net before loop is run net object must have a run method, which accepts slopes and returns on Axis slopes

calcCMat(callback=None, progressCallback=None)[source]
reconstruct(slopes)[source]

Determine DM commands using previously made reconstructor from slopes. Uses Artificial Neural Network.

Slopes are normalised before being run through the network.

Parameters:slopes (ndarray) – array of slopes to reconstruct from
Returns:array to comands to be sent to DM
Return type:ndarray
class soapy.RECON.GLAO_4LGS(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: soapy.RECON.MVM

Reconstructor of LGS TT prediction algorithm.

Uses one TT DM and a high order DM. The TT WFS controls the TT DM and the second WFS controls the high order DM. The TT WFS and DM are assumed to be the first in the system.

initControlMatrix()[source]
reconstruct(slopes)[source]

Determine DM commands using previously made reconstructor from slopes. :param slopes: array of slopes to reconstruct from :type slopes: ndarray

Returns:array to commands to be sent to DM
Return type:ndarray
removeCommonTT(slopes, wfsList)[source]
class soapy.RECON.LearnAndApply(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: soapy.RECON.MVM

Class to perform a simply learn and apply algorithm, where “learn” slopes are recorded, and an interaction matrix between off-axis and on-axis WFS is computed from these slopes.

Assumes that on-axis sensor is WFS 0

calcCMat(callback=None, progressCallback=None)[source]

Uses the slopes recorded in the “learn” and DM interaction matrices to create a CMat.

initControlMatrix()[source]
learn(callback=None, progressCallback=None)[source]

Takes “self.learnFrames” WFS frames, and computes the tomographic reconstructor for the system. This method uses the “truth” sensor, and assumes that this is WFS0

loadCMat()[source]
reconstruct(slopes)[source]

Determine DM commands using previously made reconstructor from slopes. :param slopes: array of slopes to reconstruct from :type slopes: ndarray

Returns:array of commands to be sent to DM
Return type:ndarray
saveCMat()[source]
class soapy.RECON.LearnAndApplyLTAO(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: soapy.RECON.LearnAndApply, soapy.RECON.MVM_SeparateDMs

Class to perform a simply learn and apply algorithm, where “learn” slopes are recorded, and an interaction matrix between off-axis and on-axis WFS is computed from these slopes.

This is an `` Assumes that on-axis sensor is WFS 1

calcCMat(callback=None, progressCallback=None)[source]

Uses the slopes recorded in the “learn” and DM interaction matrices to create a CMat.

initControlMatrix()[source]
reconstruct(slopes)[source]

Determine DM commands using previously made reconstructor from slopes. :param slopes: array of slopes to reconstruct from :type slopes: ndarray

Returns:array to comands to be sent to DM
Return type:ndarray
class soapy.RECON.LgsTT(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: soapy.RECON.LearnAndApply

Reconstructor of LGS TT prediction algorithm.

Uses one TT DM and a high order DM. The TT WFS controls the TT DM and the second WFS controls the high order DM. The TT WFS and DM are assumed to be the first in the system.

calcCMat(callback=None, progressCallback=None)[source]

Uses the slopes recorded in the “learn” and DM interaction matrices to create a CMat.

initControlMatrix()[source]
reconstruct(slopes)[source]

Determine DM commands using previously made reconstructor from slopes. :param slopes: array of slopes to reconstruct from :type slopes: ndarray

Returns:array to commands to be sent to DM
Return type:ndarray
removeCommonTT(slopes, wfsList)[source]
class soapy.RECON.MVM(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: soapy.RECON.Reconstructor

Re-constructor which combines all DM interaction matrices from all DMs and WFSs and inverts the resulting matrix to form a global interaction matrix.

calcCMat(callback=None, progressCallback=None)[source]

Uses DM object makeIMat methods, then inverts each to create a control matrix

class soapy.RECON.MVM_SeparateDMs(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: soapy.RECON.Reconstructor

Re-constructor which treats a each DM Separately.

Similar to MVM re-constructor, except each DM has its own control matrix. Its is assumed that each DM is “associated” with a different WFS.

calcCMat(callback=None, progressCallback=None)[source]

Uses DM object makeIMat methods, then inverts each to create a control matrix

reconstruct(slopes)[source]

Returns DM commands given some slopes

First, if there’s a TT mirror, remove the TT from the TT WFS (the 1st WFS slopes) and get TT commands to send to the mirror. These slopes may then be used to reconstruct commands for others DMs, or this could be the responsibility of other WFSs depending on the config file.

class soapy.RECON.Reconstructor(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: object

initControlMatrix()[source]
loadCMat()[source]
loadIMat()[source]
makeCMat(loadIMat=True, loadCMat=True, callback=None, progressCallback=None)[source]
makeIMat(callback, progressCallback)[source]
reconstruct(slopes)[source]
saveCMat()[source]
saveIMat()[source]
class soapy.RECON.WooferTweeter(soapyConfig, dms, wfss, atmos, runWfsFunc=None)[source]

Bases: soapy.RECON.Reconstructor

Reconstructs a 2 DM system, where 1 DM is of low order, high stroke and the other has a higher, but low stroke.

Reconstructs dm commands for each DM, then removes the low order component from the high order commands by propagating back to the slopes corresponding to the lower order DM shape, and propagating to the high order DM shape.

calcCMat(callback=None, progressCallback=None)[source]

Creates control Matrix. Assumes that DM 0 is low order, and DM 1 is high order.