![]() |
COMPASS
5.4.4
End-to-end AO simulation tool using GPU acceleration
|
Functions | |
def | KLmodes (x, y, L0, filterPiston) |
Return modes <x, y> : x,y coordinates of the DM actuators. More... | |
def | computePistonFilteringMatrix (n) |
Creates a sqaure matrix that removes (=filter out) piston mode. More... | |
def | compute_Caa (vv1, vv2, s1, s2, Cn2h, L0, alt1, alt2, altitude) |
This function computes the covariance matrix between TWO wavefront-sensors, each pointing in some particular direction of a given Guide Star for a UNI turbulent layer at a given altitude. More... | |
def | macdo_x56 (x, k=10) |
Computation of the Mc Donald function. 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 | rodconan (r, L0, k=10) |
DOCUMENT rodconan(r,L0,k=) The phase structure function is computed from the expression Dphi(r) = k1 * L0**(5. More... | |
def | DPHI (x, y, L0) |
def | computeTTFiltMatrix (nbslopes) |
Returns a matrix <p1> that filters the average TT on the vector of slopes <vec> with nbslopes = x+y slopes. More... | |
def | filt_TTvec (nbslopes) |
Returns a matrix p that averages the slopes over x and y. More... | |
def | Filt_Zer (modesfilt, miz) |
def shesha.util.slopesCovariance.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 313 of file slopesCovariance.py.
def shesha.util.slopesCovariance.compute_Caa | ( | vv1, | |
vv2, | |||
s1, | |||
s2, | |||
Cn2h, | |||
L0, | |||
alt1, | |||
alt2, | |||
altitude | |||
) |
This function computes the covariance matrix between TWO wavefront-sensors, each pointing in some particular direction of a given Guide Star for a UNI turbulent layer at a given altitude.
The simulated guide star —IS ALWAYS— TT sensitive i.e if the GS is set at a finite altitude, it simulates a LGS with the perfect TT sensing capability. If needed, the TT filtering should be performed afterwards on the covariance matrix by applying an averaging slopes matrix for the given WFS (see computeTTFiltMatrix for TT filtering or Filt_Zer for filtering other Zernikes modes)
<vv1>, <vv2> is the array (N,2) of the subaperture coordinates projected onto altitude layer. vv[:,0] is the x-coordinate, vv([:,1] is y. vv1 is for WFS number 1, vv2 for the other. It's up to the user to order the subapertures in the way he expects to find them in the final cov matrix. <s1>, <s2> are the sizes of the subapertures in the pupil (i.e. at ground level, i.e. the real physical size in the telescope pupil, not the one projected onto the layer) <Cn2h> strengh of the layer: it must be equal to r0**(-5./3) with r0 in metres. Initially this parameter was r0 but the Learn & Apply fit was non-linear. Now the Learn will be searching for <Cn2h> which makes it a linear fit and convergence is faster. <L0> the outer scale (in metres) <alt1>, <alt2>: altitude of the source (the Guide Star) of the WFS (metres). A value of alt==0 is interpreted as alt==infinity. <altitude>: altitude of the layer (metres). Used to recompute the real ssp size at the given altitude.
Definition at line 176 of file slopesCovariance.py.
def shesha.util.slopesCovariance.computePistonFilteringMatrix | ( | n | ) |
Creates a sqaure matrix that removes (=filter out) piston mode.
<n> : size of the matrix
Definition at line 96 of file slopesCovariance.py.
def shesha.util.slopesCovariance.computeTTFiltMatrix | ( | nbslopes | ) |
Returns a matrix <p1> that filters the average TT on the vector of slopes <vec> with nbslopes = x+y slopes.
Definition at line 400 of file slopesCovariance.py.
def shesha.util.slopesCovariance.DPHI | ( | x, | |
y, | |||
L0 | |||
) |
Computes the phase structure function for a separation (x,y). The r0 is not taken into account : the final result of DPHI(x,y,L0) has to be scaled with r0**-5/3, with r0 expressed in meters, to get the right value.
Definition at line 370 of file slopesCovariance.py.
def shesha.util.slopesCovariance.filt_TTvec | ( | nbslopes | ) |
Returns a matrix p that averages the slopes over x and y.
Definition at line 421 of file slopesCovariance.py.
def shesha.util.slopesCovariance.Filt_Zer | ( | modesfilt, | |
miz | |||
) |
This function generates a matrix that filters all the zernikes modes up to <modesfilt> It requires a zernike interaction matrix <miz> of the given the WFS
The filtered vector can be computed using:
With <miz> computed using doit:
Definition at line 461 of file slopesCovariance.py.
def shesha.util.slopesCovariance.KLmodes | ( | x, | |
y, | |||
L0, | |||
filterPiston | |||
) |
Return modes <x, y> : x,y coordinates of the DM actuators.
Could come from the output of the function:
OR can be any x,y DM coordinates.
<L0> : outer scale, in the same units as x and y. <filterPiston> : True/False, to filter the piston out or not
example of use:
Definition at line 61 of file slopesCovariance.py.
def shesha.util.slopesCovariance.macdo_x56 | ( | x, | |
k = 10 |
|||
) |
Computation of the Mc Donald 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 270 of file slopesCovariance.py.
def shesha.util.slopesCovariance.rodconan | ( | r, | |
L0, | |||
k = 10 |
|||
) |
DOCUMENT rodconan(r,L0,k=) 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 339 of file slopesCovariance.py.