![]() |
COMPASS
5.0.0
End-to-end AO simulation tool using GPU acceleration
|
Functions | |
def | init_config (config) |
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) |
def | compute_btt2 () |
def | compute_btt () |
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 | |
c = ch.carmaWrap_context(devices=np.array([6], dtype=np.int32)) | |
string | param_file = "/home/fferreira/compass/trunk/shesha/data/par/par4roket/correlation_study/roket_8m_1layer.py" |
_ _ | |_ ___ ___| |_ ___ | __/ _ \/ __| __/ __| | || __/__ \ |___ \ _____||___/__|___/ More... | |
bool | error_flag = True |
string | filename = param_file.split('/')[-1] |
string | param_path = param_file.split(filename)[0] |
int | nfiltered = 20 |
int | N_preloop = 1000 |
niters = config.p_loop.niter | |
list | winddirs = [0, 45, 90, 135, 180] |
list | windspeeds = [5., 10., 15., 20.] |
d = float(sys.argv[1]) | |
s = float(sys.argv[2]) | |
g = float(sys.argv[3]) | |
string | savename = "roket_8m_1layer_dir%d_speed%d_g%d_cpu.h5" % (d, s, g * 10) |
atm | |
wfs | |
tel | |
dms | |
tar | |
rtc | |
Btt | |
P | |
Dm | |
cmat | |
R = rtc.get_cmat(0) | |
imat = rtc.get_imat(0) | |
RD = np.dot(R, imat).astype(np.float32) | |
tuple | gRD = (np.identity(RD.shape[0]) - config.p_controllers[0].gain * RD).astype(np.float32) |
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 | |
def script_roket_cpu.compute_btt | ( | ) |
Definition at line 488 of file script_roket_cpu.py.
def script_roket_cpu.compute_btt2 | ( | ) |
| _ ) __ _ __(_)___ | _ \/ _` (-< (_-< |___/_,_/__/_/__/
Definition at line 437 of file script_roket_cpu.py.
def script_roket_cpu.compute_cmatWithBtt | ( | Btt, | |
nfilt | |||
) |
Definition at line 536 of file script_roket_cpu.py.
def script_roket_cpu.compute_cmatWithBtt2 | ( | Btt, | |
nfilt | |||
) |
Definition at line 554 of file script_roket_cpu.py.
def script_roket_cpu.cov_cor | ( | P, | |
noise, | |||
trunc, | |||
alias, | |||
H, | |||
bp, | |||
tomo | |||
) |
/ __|_____ ____ _ _ _(_)__ _ _ _ __ ___ / _|___ __ ___ _ _ _ _ ___| |__ _| |_(_)___ _ _ | (__/ _ \ V / _‘ | ’_| / _‘ | ’ \/ _/ -_) > _|_ _| / _/ _ \ '_| '_/ -_) / _‘ | _| / _ \ ’ \ ______/_/__,_|_| |___,_|_||______| _____| _____/_| |_| ___|___,_|__|____/_||_|
Definition at line 581 of file script_roket_cpu.py.
def script_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 | |||
) |
| __|_ _ _ _ ___ _ _ | _ )_ _ ___ __ _| |____| |_____ __ ___ _ | _|| '_| '_/ _ \ '_| | _ \ '_/ -_) _| / / _
/ _ \ 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 307 of file script_roket_cpu.py.
def script_roket_cpu.init_config | ( | config | ) |
(_)_ __ (_) |_ ___ | | '_ | | __/ __| | | | | | | |___ \ |_|_| |_|_|__|___/
Definition at line 32 of file script_roket_cpu.py.
def script_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 140 of file script_roket_cpu.py.
def script_roket_cpu.preloop | ( | n | ) |
Definition at line 228 of file script_roket_cpu.py.
def script_roket_cpu.save_it | ( | filename | ) |
/ __| __ ___ _____ __ \/ _` \ V / -_) |___/__,_|_/___|
Definition at line 617 of file script_roket_cpu.py.
script_roket_cpu.alias_wfs_com = alias_wfs_com[N_preloop:, :] |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.atm |
Definition at line 694 of file script_roket_cpu.py.
script_roket_cpu.bp_com = bp_com[N_preloop:, :] |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.Btt |
Definition at line 696 of file script_roket_cpu.py.
script_roket_cpu.c = ch.carmaWrap_context(devices=np.array([6], dtype=np.int32)) |
Definition at line 21 of file script_roket_cpu.py.
script_roket_cpu.cmat |
Definition at line 698 of file script_roket_cpu.py.
script_roket_cpu.com |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.d = float(sys.argv[1]) |
Definition at line 685 of file script_roket_cpu.py.
script_roket_cpu.Dm |
Definition at line 698 of file script_roket_cpu.py.
script_roket_cpu.dms |
Definition at line 694 of file script_roket_cpu.py.
bool script_roket_cpu.error_flag = True |
Definition at line 671 of file script_roket_cpu.py.
string script_roket_cpu.filename = param_file.split('/')[-1] |
Definition at line 673 of file script_roket_cpu.py.
script_roket_cpu.fit |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.g = float(sys.argv[3]) |
Definition at line 687 of file script_roket_cpu.py.
tuple script_roket_cpu.gRD = (np.identity(RD.shape[0]) - config.p_controllers[0].gain * RD).astype(np.float32) |
Definition at line 703 of file script_roket_cpu.py.
script_roket_cpu.H_com = H_com[N_preloop:, :] |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.imat = rtc.get_imat(0) |
Definition at line 701 of file script_roket_cpu.py.
int script_roket_cpu.N_preloop = 1000 |
Definition at line 679 of file script_roket_cpu.py.
int script_roket_cpu.nfiltered = 20 |
Definition at line 678 of file script_roket_cpu.py.
script_roket_cpu.niters = config.p_loop.niter |
Definition at line 680 of file script_roket_cpu.py.
script_roket_cpu.noise_com = noise_com[N_preloop:, :] |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.P |
Definition at line 696 of file script_roket_cpu.py.
string script_roket_cpu.param_file = "/home/fferreira/compass/trunk/shesha/data/par/par4roket/correlation_study/roket_8m_1layer.py" |
_ _ | |_ ___ ___| |_ ___ | __/ _ \/ __| __/ __| | || __/__ \ |___ \ _____||___/__|___/
Definition at line 670 of file script_roket_cpu.py.
string script_roket_cpu.param_path = param_file.split(filename)[0] |
Definition at line 674 of file script_roket_cpu.py.
script_roket_cpu.psf_ortho |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.R = rtc.get_cmat(0) |
Definition at line 700 of file script_roket_cpu.py.
Definition at line 702 of file script_roket_cpu.py.
script_roket_cpu.rtc |
Definition at line 694 of file script_roket_cpu.py.
script_roket_cpu.s = float(sys.argv[2]) |
Definition at line 686 of file script_roket_cpu.py.
Definition at line 689 of file script_roket_cpu.py.
script_roket_cpu.SR |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.SR2 |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.tar |
Definition at line 694 of file script_roket_cpu.py.
script_roket_cpu.tel |
Definition at line 694 of file script_roket_cpu.py.
script_roket_cpu.tomo_com = tomo_com[N_preloop:, :] |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.trunc_com = trunc_com[N_preloop:, :] |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.wf_com |
Definition at line 705 of file script_roket_cpu.py.
script_roket_cpu.wfs |
Definition at line 694 of file script_roket_cpu.py.
list script_roket_cpu.winddirs = [0, 45, 90, 135, 180] |
Definition at line 682 of file script_roket_cpu.py.
list script_roket_cpu.windspeeds = [5., 10., 15., 20.] |
Definition at line 683 of file script_roket_cpu.py.