![]() |
COMPASS
5.0.0
End-to-end AO simulation tool using GPU acceleration
|
Stencil and matrices computation for the creation of a turbulent screen. More...
Functions | |
def | create_stencil (n) |
TODO docstring. More... | |
def | stencil_size (n) |
TODO docstring. More... | |
def | stencil_size_array (size) |
Compute_size2(np.ndarray[ndim=1, dtype=np.int64_t] size) More... | |
def | Cxz (n, Zx, Zy, Xx, Xy, istencil, L0) |
Cxz computes the covariance matrix between the new phase vector x (new column for the phase screen), and the already known phase values z. More... | |
def | Cxx (n, Zxn, Zyn, Xx, Xy, L0) |
Cxx computes the covariance matrix of the new phase vector x (new column for the phase screen). More... | |
def | Czz (n, Zx, Zy, ist, L0) |
Czz computes the covariance matrix of the already known phase values z. More... | |
def | AB (n, L0, deltax, deltay, rank=0) |
DOCUMENT AB, n, A, B, istencil This function initializes some matrices A, B and a list of stencil indexes istencil for iterative extrusion of a phase screen. More... | |
def | extrude (p, r0, A, B, istencil) |
DOCUMENT p1 = extrude(p,r0,A,B,istencil) More... | |
def | phase_struct (r, L0=None) |
TODO docstring. More... | |
def | rodconan (r, L0) |
The phase structure function is computed from the expression Dphi(r) = k1 * L0^(5. More... | |
def | asymp_macdo (x) |
Computes a term involved in the computation of the phase struct function with a finite outer scale according to the Von-Karman model. More... | |
def | macdo_x56 (x, k=10) |
Computation of the function f(x) = x^(5/6)*K_{5/6}(x) using a series for the esimation of K_{5/6}, taken from Rod Conan thesis : K_a(x)=1/2 \sum_{n=0}^\infty \frac{(-1)^n}{n!} \left(\Gamma(-n-a) (x/2)^{2n+a} + \Gamma(-n+a) (x/2)^{2n-a} \right) , with a = 5/6. More... | |
def | create_screen_assist (screen_size, L0, r0) |
def | create_screen (r0, pupixsize, screen_size, L0, A, B, ist) |
DOCUMENT create_screen screen = create_screen(r0,pupixsize,screen_size,&A,&B,&ist) More... | |
Stencil and matrices computation for the creation of a turbulent screen.
This file is part of COMPASS https://anr-compass.github.io/compass/
Copyright (C) 2011-2019 COMPASS Team https://github.com/ANR-COMPASS All rights reserved. Distributed under GNU - LGPL
COMPASS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
COMPASS: End-to-end AO simulation tool using GPU acceleration The COMPASS platform was designed to meet the need of high-performance for the simulation of AO systems.
The final product includes a software package for simulating all the critical subcomponents of AO, particularly in the context of the ELT and a real-time core based on several control approaches, with performances consistent with its integration into an instrument. Taking advantage of the specific hardware architecture of the GPU, the COMPASS tool allows to achieve adequate execution speeds to conduct large simulation campaigns called to the ELT.
The COMPASS platform can be used to carry a wide variety of simulations to both testspecific components of AO of the E-ELT (such as wavefront analysis device with a pyramid or elongated Laser star), and various systems configurations such as multi-conjugate AO.
COMPASS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with COMPASS. If not, see https://www.gnu.org/licenses/lgpl-3.0.txt.
def shesha.util.iterkolmo.AB | ( | n, | |
L0, | |||
deltax, | |||
deltay, | |||
rank = 0 |
|||
) |
DOCUMENT AB, n, A, B, istencil This function initializes some matrices A, B and a list of stencil indexes istencil for iterative extrusion of a phase screen.
The method used is described by Fried & Clark in JOSA A, vol 25, no 2, p463, Feb 2008. The iteration is : x = A(z-zRef) + B.noise + zRef with z a vector containing "old" phase values from the initial screen, that are listed thanks to the indexes in istencil.
SEE extrude createStencil Cxx Cxz Czz
Definition at line 202 of file iterkolmo.py.
def shesha.util.iterkolmo.asymp_macdo | ( | x | ) |
Computes a term involved in the computation of the phase struct function with a finite outer scale according to the Von-Karman model.
The term involves the MacDonald function (modified bessel function of second kind) K_{5/6}(x), and the algorithm uses the asymptotic form for x ~ infinity.
Definition at line 354 of file iterkolmo.py.
def shesha.util.iterkolmo.create_screen | ( | r0, | |
pupixsize, | |||
screen_size, | |||
L0, | |||
A, | |||
B, | |||
ist | |||
) |
DOCUMENT create_screen screen = create_screen(r0,pupixsize,screen_size,&A,&B,&ist)
creates a phase screen and fill it with turbulence r0 total r0 @ 0.5m pupixsize pupil pixel size (in meters) screen_size screen size (in pixels) A A array for future extrude B B array for future extrude ist istencil array for future extrude
Definition at line 454 of file iterkolmo.py.
def shesha.util.iterkolmo.create_screen_assist | ( | screen_size, | |
L0, | |||
r0 | |||
) |
def shesha.util.iterkolmo.create_stencil | ( | n | ) |
TODO docstring.
Definition at line 43 of file iterkolmo.py.
def shesha.util.iterkolmo.Cxx | ( | n, | |
Zxn, | |||
Zyn, | |||
Xx, | |||
Xy, | |||
L0 | |||
) |
Cxx computes the covariance matrix of the new phase vector x (new column for the phase screen).
Definition at line 148 of file iterkolmo.py.
def shesha.util.iterkolmo.Cxz | ( | n, | |
Zx, | |||
Zy, | |||
Xx, | |||
Xy, | |||
istencil, | |||
L0 | |||
) |
Cxz computes the covariance matrix between the new phase vector x (new column for the phase screen), and the already known phase values z.
The known values z are the values of the phase screen that are pointed by the stencil indexes (istencil)
Definition at line 121 of file iterkolmo.py.
def shesha.util.iterkolmo.Czz | ( | n, | |
Zx, | |||
Zy, | |||
ist, | |||
L0 | |||
) |
Czz computes the covariance matrix of the already known phase values z.
The known values z are the values of the phase screen that are pointed by the stencil indexes (istencil)
Definition at line 170 of file iterkolmo.py.
def shesha.util.iterkolmo.extrude | ( | p, | |
r0, | |||
A, | |||
B, | |||
istencil | |||
) |
DOCUMENT p1 = extrude(p,r0,A,B,istencil)
Extrudes a phase screen p1 from initial phase screen p. p1 prolongates p by 1 column on the right end. r0 is expressed in pixels
The method used is described by Fried & Clark in JOSA A, vol 25, no 2, p463, Feb 2008. The iteration is : x = A(z-zRef) + B.noise + zRef with z a vector containing "old" phase values from the initial screen, that are listed thanks to the indexes in istencil.
Examples n = 32; AB, n, A, B, istencil; p = array(0.0,n,n); p1 = extrude(p,r0,A,B,istencil); pli p1
SEE AB() createStencil() Cxx() Cxz() Czz()
Definition at line 277 of file iterkolmo.py.
def shesha.util.iterkolmo.macdo_x56 | ( | x, | |
k = 10 |
|||
) |
Computation of the function f(x) = x^(5/6)*K_{5/6}(x) using a series for the esimation of K_{5/6}, taken from Rod Conan thesis : K_a(x)=1/2 \sum_{n=0}^\infty \frac{(-1)^n}{n!} \left(\Gamma(-n-a) (x/2)^{2n+a} + \Gamma(-n+a) (x/2)^{2n-a} \right) , with a = 5/6.
Setting x22 = (x/2)^2, setting uda = (1/2)^a, and multiplying by x^a, this becomes : x^a * Ka(x) = 0.5 $ -1^n / n! [ G(-n-a).uda x22^(n+a) + G(-n+a)/uda x22^n ] Then we use the following recurrence formulae on the following quantities : G(-(n+1)-a) = G(-n-a) / -a-n-1 G(-(n+1)+a) = G(-n+a) / a-n-1 (n+1)! = n! * (n+1) x22^(n+1) = x22^n * x22 and at each iteration on n, one will use the values already computed at step (n-1). The values of G(a) and G(-a) are hardcoded instead of being computed.
The first term of the series has also been skipped, as it vanishes with another term in the expression of Dphi.
Definition at line 388 of file iterkolmo.py.
def shesha.util.iterkolmo.phase_struct | ( | r, | |
L0 = None |
|||
) |
TODO docstring.
Definition at line 294 of file iterkolmo.py.
def shesha.util.iterkolmo.rodconan | ( | r, | |
L0 | |||
) |
The phase structure function is computed from the expression Dphi(r) = k1 * L0^(5.
/3) * (k2 - (2.pi.r/L0)^5/6 K_{5/6}(2.pi.r/L0))
For small r, the expression is computed from a development of K_5/6 near 0. The value of k2 is not used, as this same value appears in the series and cancels with k2. For large r, the expression is taken from an asymptotic form.
Definition at line 309 of file iterkolmo.py.
def shesha.util.iterkolmo.stencil_size | ( | n | ) |
TODO docstring.
Definition at line 78 of file iterkolmo.py.
def shesha.util.iterkolmo.stencil_size_array | ( | size | ) |
Compute_size2(np.ndarray[ndim=1, dtype=np.int64_t] size)
Compute the size of a stencil, given the screen size
:parameters:
size (np.ndarray[ndim=1,dtype=np.int64_t]) :screen size
Definition at line 107 of file iterkolmo.py.