COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
shesha.util.iterkolmo Namespace Reference

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)
 screen_size screen size (in pixels) L0 L0 in pixel r0 total r0 @ 0.5 microns More...
 
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...
 

Detailed Description

Stencil and matrices computation for the creation of a turbulent screen.

Author
COMPASS Team https://github.com/ANR-COMPASS
Version
5.4.4
Date
2022/01/24

This file is part of COMPASS https://anr-compass.github.io/compass/

Copyright (C) 2011-2023 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.

Function Documentation

◆ AB()

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 204 of file iterkolmo.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asymp_macdo()

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.

Warnings
  • This function makes a floating point interrupt for x=0 and should not be used in this case.
  • Works only for x>0.

Definition at line 361 of file iterkolmo.py.

Here is the caller graph for this function:

◆ create_screen()

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 461 of file iterkolmo.py.

Here is the call graph for this function:

◆ create_screen_assist()

def shesha.util.iterkolmo.create_screen_assist (   screen_size,
  L0,
  r0 
)

screen_size screen size (in pixels) L0 L0 in pixel r0 total r0 @ 0.5 microns

Definition at line 431 of file iterkolmo.py.

Here is the call graph for this function:

◆ create_stencil()

def shesha.util.iterkolmo.create_stencil (   n)

TODO docstring.

Definition at line 43 of file iterkolmo.py.

Here is the caller graph for this function:

◆ Cxx()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cxz()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Czz()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extrude()

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 ALSO: AB() createStencil() Cxx() Cxz() Czz()

Definition at line 284 of file iterkolmo.py.

Here is the caller graph for this function:

◆ macdo_x56()

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 395 of file iterkolmo.py.

Here is the caller graph for this function:

◆ phase_struct()

def shesha.util.iterkolmo.phase_struct (   r,
  L0 = None 
)

TODO docstring.

Definition at line 301 of file iterkolmo.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rodconan()

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 316 of file iterkolmo.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stencil_size()

def shesha.util.iterkolmo.stencil_size (   n)

TODO docstring.

Definition at line 78 of file iterkolmo.py.

Here is the caller graph for this function:

◆ stencil_size_array()

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.

Here is the call graph for this function: