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

Functions for DM KL initialization. More...

Functions

float make_radii (float cobs, int nr)
 TODO docstring. More...
 
np.ndarray make_kernels (float cobs, int nr, np.ndarray radp, bytes kl_type, float outscl=3.)
 This routine generates the kernel used to find the KL modes. More...
 
np.ndarray piston_orth (int nr)
 TODO docstring. More...
 
np.ndarray make_azimuth (int nord, int npp)
 TODO docstring. More...
 
np.ndarray radii (int nr, int npp, float cobs)
 This routine generates an nr x npp array with npp copies of the radial coordinate array. More...
 
np.ndarray polang (np.ndarray r)
 This routine generates an array with the same dimensions as r, but containing the azimuthal values for a polar coordinate system. More...
 
Tuple[np.ndarray, np.ndarray, np.ndarray] setpincs (np.ndarray ax, np.ndarray ay, np.ndarray px, np.ndarray py, float cobs)
 This routine determines a set of squares for interpolating from cartesian to polar coordinates, using only those points with cobs < r < 1 SEE pcgeom. More...
 
def pcgeom (nr, npp, cobs, ncp, ncmar)
 This routine builds a geom_struct. More...
 
def set_pctr (int dim, nr, npp, int nkl, float cobs, nord, ncmar=None, ncp=None)
 This routine calls pcgeom to build a geom_struct with the right initializations. More...
 
def gkl_fcom (np.ndarray kers, float cobs, int nf)
 This routine does the work : finding the eigenvalues and corresponding eigenvectors. More...
 
def gkl_sfi (p_dm, i)
 
def pol2car (pol, p_dm, mask=0)
 
def kl_view (p_dm, mask=1)
 

Detailed Description

Functions for DM KL initialization.

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

◆ gkl_fcom()

def shesha.util.kl_util.gkl_fcom ( np.ndarray  kers,
float  cobs,
int  nf 
)

This routine does the work : finding the eigenvalues and corresponding eigenvectors.

Sort them and select the right one. It returns the KL modes : in polar coordinates : rabas as well as the associated variance : evals. It also returns a bunch of indices used to recover the modes in cartesian coordinates (nord, npo and ordd).

Parameters
kerns(np.ndarray[ndim= ,dtype=np.float32]) :
cobs(float) : central obstruction
nf(int) :

Definition at line 458 of file kl_util.py.

Here is the call graph for this function:

◆ gkl_sfi()

def shesha.util.kl_util.gkl_sfi (   p_dm,
  i 
)

Definition at line 568 of file kl_util.py.

Here is the caller graph for this function:

◆ kl_view()

def shesha.util.kl_util.kl_view (   p_dm,
  mask = 1 
)

Definition at line 642 of file kl_util.py.

Here is the call graph for this function:

◆ make_azimuth()

np.ndarray shesha.util.kl_util.make_azimuth ( int  nord,
int  npp 
)

TODO docstring.

        nord:

        npp:

    :return:

        azbas:

Definition at line 151 of file kl_util.py.

◆ make_kernels()

np.ndarray shesha.util.kl_util.make_kernels ( float  cobs,
int  nr,
np.ndarray  radp,
bytes  kl_type,
float   outscl = 3. 
)

This routine generates the kernel used to find the KL modes.

The kernel constructed here should be simply a discretization of the continuous kernel. It needs rescaling before it is treated as a matrix for finding the eigen-values. The outer scale should be in units of the diameter of the telescope.

TODO
Parameters
cobs(float): central obstruction
nr(int) :
radp(float) :
kl_type(bytes) : "kolmo" or "karman"
outscl(float) : outter scale for Von Karman spectrum

:return:

kers :

Definition at line 85 of file kl_util.py.

◆ make_radii()

float shesha.util.kl_util.make_radii ( float  cobs,
int  nr 
)

TODO docstring.

Parameters
cobs(float) : central obstruction
nr(int) :

Definition at line 53 of file kl_util.py.

◆ pcgeom()

def shesha.util.kl_util.pcgeom (   nr,
  npp,
  cobs,
  ncp,
  ncmar 
)

This routine builds a geom_struct.

px and py are the x and y coordinates of points in the polar arrays. cr and cp are the r and phi coordinates of points in the cartesian grids. ncmar allows the possibility that there is a margin of ncmar points in the cartesian arrays outside the region of interest

TODO
nr:
npp:
Parameters
cobs(float) : central obstruction
ncp:
ncmar:
:returns:
ncp:
ncmar:
px:
py:
cr:
cp:
pincx:
pincy:
pincw:
ap:

Definition at line 348 of file kl_util.py.

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

◆ piston_orth()

np.ndarray shesha.util.kl_util.piston_orth ( int  nr)

TODO docstring.

        nr:

    :return:

        s:

Definition at line 127 of file kl_util.py.

Here is the caller graph for this function:

◆ pol2car()

def shesha.util.kl_util.pol2car (   pol,
  p_dm,
  mask = 0 
)

Definition at line 602 of file kl_util.py.

Here is the caller graph for this function:

◆ polang()

np.ndarray shesha.util.kl_util.polang ( np.ndarray  r)

This routine generates an array with the same dimensions as r, but containing the azimuthal values for a polar coordinate system.

TODO
r:
:return:
p:

Definition at line 214 of file kl_util.py.

Here is the caller graph for this function:

◆ radii()

np.ndarray shesha.util.kl_util.radii ( int  nr,
int  npp,
float  cobs 
)

This routine generates an nr x npp array with npp copies of the radial coordinate array.

Radial coordinate span the range from r=cobs to r=1 with successive annuli having equal areas (ie, the area between cobs and 1 is divided into nr equal rings, and the points are positioned at the half-area mark on each ring). There are no points on the border.

TODO
nr:
npp:
Parameters
cobs(float) : central obstruction
:return:
Parameters
r

Definition at line 187 of file kl_util.py.

Here is the caller graph for this function:

◆ set_pctr()

def shesha.util.kl_util.set_pctr ( int  dim,
  nr,
  npp,
int  nkl,
float  cobs,
  nord,
  ncmar = None,
  ncp = None 
)

This routine calls pcgeom to build a geom_struct with the right initializations.

bas is a gkl_basis_struct built with the gkl_bas routine.

TODO
    dim:

    nr:

    npp:

    nkl:

    cobs:

    nord:
Parameters
ncmar(optional)
ncp(optional)

:returns:

Parameters
ncp
ncmar
px
py
cr
cp
pincx
pincy
pincw
ap

Definition at line 431 of file kl_util.py.

Here is the call graph for this function:

◆ setpincs()

Tuple[np.ndarray, np.ndarray, np.ndarray] shesha.util.kl_util.setpincs ( np.ndarray  ax,
np.ndarray  ay,
np.ndarray  px,
np.ndarray  py,
float  cobs 
)

This routine determines a set of squares for interpolating from cartesian to polar coordinates, using only those points with cobs < r < 1 SEE pcgeom.

TODO
ax:
ay:
px:
py:
Parameters
cobs(float) : central obstruction
:return:
pincx:
pincy:
Parameters
pincw

Definition at line 257 of file kl_util.py.

Here is the caller graph for this function: