![]() |
COMPASS
5.0.0
End-to-end AO simulation tool using GPU acceleration
|
Functions | |
def | loop (n) |
def | preloop (n) |
def | error_breakdown (com, noise_com, alias_wfs_com, tomo_com, H_com, trunc_com, bp_com, wf_com, mod_com, fit, psf_ortho, i, Ee, Ff, gamma, gRD) |
def | centroid_gain (E, F) |
def | compute_btt2 () |
def | compute_cmatWithBtt (Btt, nfilt) |
def | compute_cmatWithBtt2 (Btt, nfilt) |
def | cov_cor (P, noise, trunc, alias, H, bp, tomo) |
def | save_it (filename) |
Variables | |
string | error = 'command line should be at least:"python -i test.py parameters_filename"\n with "parameters_filename" the path to the parameters file' |
param_file = sys.argv[1] | |
filename = param_file.split('/')[-1] | |
param_path = param_file.split(filename)[0] | |
savename = sys.argv[2] | |
string | simul_name = "" |
dictionary | matricesToLoad = {} |
int | clean = 1 |
param_dict = h5u.params_dictionary(config) | |
c = ch.carmaWrap_context(devices=np.array([6], dtype=np.int32)) | |
wfs | |
tel | |
atm | |
dms = ao.dm_init(config.p_dms, config.p_wfss, wfs, config.p_geom, config.p_tel) | |
tar | |
rtc | |
bool | error_flag = True in [w.roket for w in config.p_wfss] |
nfiltered = int(config.p_controllers[0].maxcond) | |
_ _ | |_ ___ ___| |_ ___ | __/ _ \/ __| __/ __| | || __/__ \ |___ \ _____||___/__|___/ More... | |
niters = config.p_loop.niter | |
int | N_preloop = 1000 |
Btt | |
P | |
Dm | |
cmat | |
R = rtc.get_cmat(0) | |
imat = rtc.get_imat(0) | |
RD = np.dot(R, imat) | |
Nact = ao.create_nact_geom(config.p_dms, 0) | |
int | gamma = 1. / 0.51495 |
com | |
noise_com = noise_com[N_preloop:, :] | |
alias_wfs_com = alias_wfs_com[N_preloop:, :] | |
tomo_com = tomo_com[N_preloop:, :] | |
H_com = H_com[N_preloop:, :] | |
trunc_com = trunc_com[N_preloop:, :] | |
bp_com = bp_com[N_preloop:, :] | |
wf_com | |
fit | |
SR | |
SR2 | |
psf_ortho | |
E = E[N_preloop:, :] | |
F = F[N_preloop:, :] | |
def roket_cpu.centroid_gain | ( | E, | |
F | |||
) |
Definition at line 461 of file roket_cpu.py.
def roket_cpu.compute_btt2 | ( | ) |
| _ ) __ _ __(_)___ | _ \/ _` (-< (_-< |___/_,_/__/_/__/
Definition at line 476 of file roket_cpu.py.
def roket_cpu.compute_cmatWithBtt | ( | Btt, | |
nfilt | |||
) |
Definition at line 527 of file roket_cpu.py.
def roket_cpu.compute_cmatWithBtt2 | ( | Btt, | |
nfilt | |||
) |
Definition at line 545 of file roket_cpu.py.
def roket_cpu.cov_cor | ( | P, | |
noise, | |||
trunc, | |||
alias, | |||
H, | |||
bp, | |||
tomo | |||
) |
/ __|_____ ____ _ _ _(_)__ _ _ _ __ ___ / _|___ __ ___ _ _ _ _ ___| |__ _| |_(_)___ _ _ | (__/ _ \ V / _‘ | ’_| / _‘ | ’ \/ _/ -_) > _|_ _| / _/ _ \ '_| '_/ -_) / _‘ | _| / _ \ ’ \ ______/_/__,_|_| |___,_|_||______| _____| _____/_| |_| ___|___,_|__|____/_||_|
Definition at line 572 of file roket_cpu.py.
def roket_cpu.error_breakdown | ( | com, | |
noise_com, | |||
alias_wfs_com, | |||
tomo_com, | |||
H_com, | |||
trunc_com, | |||
bp_com, | |||
wf_com, | |||
mod_com, | |||
fit, | |||
psf_ortho, | |||
i, | |||
Ee, | |||
Ff, | |||
gamma, | |||
gRD | |||
) |
| __|_ _ _ _ ___ _ _ | _ )_ _ ___ __ _| |____| |_____ __ ___ _ | _|| '_| '_/ _ \ '_| | _ \ '_/ -_) _| / / _
/ _ \ V V / ' \ |___|_| |_| ___/_| |___/_| _____,_|____,____/_/_/|_||_|
Compute the error breakdown of the AO simulation. Returns the error commands of each contributors. Suppose no delay (for now) and only 2 controllers : the main one, controller #0, (specified on the parameter file) and the geometric one, controller #1 (automatically added if roket is asked in the parameter file) Commands are computed by applying the loop filter on various kind of commands : (see schema_simulation_budget_erreur_v2)
- Ageom : Aliasing contribution on WFS direction Obtained by computing commands from DM orthogonal phase (projection + slopes_geom) - B : Projection on the target direction Obtained as the commmands output of the geometric controller - C : Wavefront Obtained by computing commands from DM parallel phase (RD*B) - E : Wavefront + aliasing + ech/trunc + tomo Obtained by performing the AO loop iteration without noise on the WFS - F : Wavefront + aliasing + tomo Obtained by performing the AO loop iteration without noise on the WFS and using phase deriving slopes - G : tomo
Note rtc.get_err returns to -CMAT.slopes
:parameters: noise_com np.array((niter,nactu)) : Noise contribution Computed with com-E
alias_wfs_com np.array((niter,nactu)) : Aliasing on WFS direction contribution Computed with Ageom
tomo_com np.array((niter,nactu)) : Tomographic error contribution Computed with C-B
H_com np.array((niter,nactu)) : Filtered modes error Computed with B
trunc_com np.array((niter,nactu)) : sampling/truncature error contribution Computed with E-F
bp_com np.array((niter,nactu)) : Bandwidth error
wf_com np.array((niter,nactu)) : Reconstructed wavefront
mod_com np.array((niter,nactu)) : commanded modes
fit np.array((niter)) : fitting value
i (int) : current iteration number
Definition at line 334 of file roket_cpu.py.
def roket_cpu.loop | ( | n | ) |
/_\ / _ \ | |___ ___ _ __ / _ \ (_) | | / _ \/ _ \ '_ \ /_/ ____/ |____/___/ .__/ |_|
Performs the main AO loop for n interations. First, initialize buffers for error breakdown computations. Then, at the end of each iteration, just before applying the new DM shape, calls the error_breakdown function.
:param n: (int) : number of iterations
:return: com (np.array((n,nactus))) : full command buffer
noise_com (np.array((n,nactus))) : noise contribution for error breakdown
alias_wfs_com (np.array((n,nactus))) : aliasing estimation in the WFS direction
tomo_com (np.array((n,nactus))) : tomography error estimation
H_com (np.array((n,nactus))) : Filtered modes contribution for error breakdown
trunc_com (np.array((n,nactus))) : Truncature and sampling error of WFS
bp_com (np.array((n,nactus))) : Bandwidth error estimation on target
mod_com (np.array((n,nactus))) : Commanded modes expressed on the actuators
fit (float) : fitting (mean variance of the residual target phase after projection)
SR (float) : final strehl ratio returned by the simulation
Definition at line 161 of file roket_cpu.py.
def roket_cpu.preloop | ( | n | ) |
Definition at line 255 of file roket_cpu.py.
def roket_cpu.save_it | ( | filename | ) |
/ __| __ ___ _____ __ \/ _` \ V / -_) |___/__,_|_/___|
Definition at line 610 of file roket_cpu.py.
roket_cpu.alias_wfs_com = alias_wfs_com[N_preloop:, :] |
Definition at line 692 of file roket_cpu.py.
roket_cpu.atm |
Definition at line 86 of file roket_cpu.py.
roket_cpu.bp_com = bp_com[N_preloop:, :] |
Definition at line 692 of file roket_cpu.py.
roket_cpu.Btt |
Definition at line 671 of file roket_cpu.py.
roket_cpu.c = ch.carmaWrap_context(devices=np.array([6], dtype=np.int32)) |
Definition at line 76 of file roket_cpu.py.
int roket_cpu.clean = 1 |
Definition at line 67 of file roket_cpu.py.
roket_cpu.cmat |
Definition at line 673 of file roket_cpu.py.
roket_cpu.com |
Definition at line 692 of file roket_cpu.py.
roket_cpu.Dm |
Definition at line 673 of file roket_cpu.py.
roket_cpu.dms = ao.dm_init(config.p_dms, config.p_wfss, wfs, config.p_geom, config.p_tel) |
Definition at line 92 of file roket_cpu.py.
roket_cpu.E = E[N_preloop:, :] |
Definition at line 692 of file roket_cpu.py.
string roket_cpu.error = 'command line should be at least:"python -i test.py parameters_filename"\n with "parameters_filename" the path to the parameters file' |
Definition at line 22 of file roket_cpu.py.
bool roket_cpu.error_flag = True in [w.roket for w in config.p_wfss] |
Definition at line 123 of file roket_cpu.py.
roket_cpu.F = F[N_preloop:, :] |
Definition at line 692 of file roket_cpu.py.
roket_cpu.filename = param_file.split('/')[-1] |
Definition at line 28 of file roket_cpu.py.
roket_cpu.fit |
Definition at line 692 of file roket_cpu.py.
int roket_cpu.gamma = 1. / 0.51495 |
Definition at line 679 of file roket_cpu.py.
roket_cpu.H_com = H_com[N_preloop:, :] |
Definition at line 692 of file roket_cpu.py.
roket_cpu.imat = rtc.get_imat(0) |
Definition at line 676 of file roket_cpu.py.
roket_cpu.matricesToLoad = {} |
Definition at line 65 of file roket_cpu.py.
int roket_cpu.N_preloop = 1000 |
Definition at line 669 of file roket_cpu.py.
roket_cpu.Nact = ao.create_nact_geom(config.p_dms, 0) |
Definition at line 678 of file roket_cpu.py.
roket_cpu.nfiltered = int(config.p_controllers[0].maxcond) |
_ _ | |_ ___ ___| |_ ___ | __/ _ \/ __| __/ __| | || __/__ \ |___ \ _____||___/__|___/
Definition at line 667 of file roket_cpu.py.
roket_cpu.niters = config.p_loop.niter |
Definition at line 668 of file roket_cpu.py.
roket_cpu.noise_com = noise_com[N_preloop:, :] |
Definition at line 692 of file roket_cpu.py.
roket_cpu.P |
Definition at line 671 of file roket_cpu.py.
roket_cpu.param_dict = h5u.params_dictionary(config) |
Definition at line 70 of file roket_cpu.py.
roket_cpu.param_file = sys.argv[1] |
Definition at line 26 of file roket_cpu.py.
roket_cpu.param_path = param_file.split(filename)[0] |
Definition at line 29 of file roket_cpu.py.
roket_cpu.psf_ortho |
Definition at line 692 of file roket_cpu.py.
roket_cpu.R = rtc.get_cmat(0) |
Definition at line 675 of file roket_cpu.py.
Definition at line 677 of file roket_cpu.py.
roket_cpu.rtc |
Definition at line 101 of file roket_cpu.py.
string roket_cpu.savename = sys.argv[2] |
Definition at line 44 of file roket_cpu.py.
string roket_cpu.simul_name = "" |
(_)_ __ (_) |_ ___ | | '_ | | __/ __| | | | | | | |___ \ |_|_| |_|_|__|___/
Definition at line 58 of file roket_cpu.py.
roket_cpu.SR |
Definition at line 692 of file roket_cpu.py.
roket_cpu.SR2 |
Definition at line 692 of file roket_cpu.py.
roket_cpu.tar |
Definition at line 96 of file roket_cpu.py.
roket_cpu.tel |
Definition at line 81 of file roket_cpu.py.
roket_cpu.tomo_com = tomo_com[N_preloop:, :] |
Definition at line 692 of file roket_cpu.py.
roket_cpu.trunc_com = trunc_com[N_preloop:, :] |
Definition at line 692 of file roket_cpu.py.
roket_cpu.wf_com |
Definition at line 692 of file roket_cpu.py.
roket_cpu.wfs |
Definition at line 81 of file roket_cpu.py.