![]() |
COMPASS
5.4.4
End-to-end AO simulation tool using GPU acceleration
|
Pupil creation functions. More...
Functions | |
def | make_pupil (dim, pupd, tel, xc=-1, yc=-1, real=0, halfSpider=False) |
Initialize the system pupil. More... | |
def | make_pupil_generic (dim, pupd, t_spiders=0.01, spiders_type=SpiderType.SIX, xc=0, yc=0, real=0, cobs=0) |
Initialize the system pupil. More... | |
def | make_VLT (dim, pupd, tel) |
Initialize the VLT pupil. More... | |
def | make_EELT (dim, pupd, tel, N_seg=-1) |
Initialize the EELT pupil. More... | |
def | make_phase_ab (dim, pupd, tel, pup=None, xc=-1, yc=-1, real=0, halfSpider=False) |
Compute the EELT M1 phase aberration. More... | |
def | generateEeltPupilMask (npt, dspider, i0, j0, pixscale, gap, rotdegree, D=40.0, cobs=0, centerMark=0, halfSpider=False, pitch=1.244683637214, nseg=33, inner_rad=4.1, outer_rad=15.4, R=95.7853, nominalD=40, half_seg=0.75, refl=None, rotSpiderDegree=None, nmissing=0) |
Generates a boolean pupil mask of the binary EELT pupil on a map of size (npt, npt). More... | |
def | fillPolygon (x, y, i0, j0, scale, gap, N, index=0) |
From a list of points defined by their 2 coordinates list x and y, creates a filled polygon with sides joining the points. More... | |
def | compute6Segments (pupNoSpiders, N, pixscale, dspider, i0, j0, rot=0) |
def | compute1Spider (nspider, N, dspider, i0, j0, scale, rot) |
Fonction de fab pour creer le slaving. More... | |
def | fillSpider (N, nspider, dspider, i0, j0, scale, rot) |
Creates a boolean spider mask on a map of dimensions (N,N) The spider is centred at floating-point coords (i0,j0). More... | |
def | fillHalfSpider (N, nspider, dspider, i0, j0, scale, rot) |
def | createHexaPattern (pitch, supportSize) |
Cree une liste de coordonnees qui decrit un maillage hexagonal. More... | |
def | generateCoordSegments (D, rot, pitch=1.244683637214, nseg=33, inner_rad=4.1, outer_rad=15.4, R=95.7853, nominalD=40) |
Computes the coordinates of the corners of all the hexagonal segments of M1. More... | |
def | gendron () |
La fonction est appelee quand l'utilisateur a demande une pupille ELT, et renseigne un diametre de telescope different de 40 metres. More... | |
def | reorganizeSegmentsOrderESO (x, y) |
Reorganisation des segments facon ESO. More... | |
def | getdatatype (truc) |
Returns the data type of a numpy variable, either scalar value or array. More... | |
def | generateSegmentProperties (attribute, hx, hy, i0, j0, scale, gap, N, D, softGap=0, nominalD=40, pitch=1.244683637214, half_seg=0.75) |
Builds a 2D image of the pupil with some attributes for each of the segments. More... | |
def | centrePourVidal (N, i0, j0, centerMark) |
Renvoie une image de boolens (False) de taille (N,N) avec un point ou une croix (True) centree sur (i0, j0). More... | |
Variables | |
string | EELT_data = os.environ.get('SHESHA_ROOT') + "/data/apertures/" |
Pupil creation functions.
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.
def shesha.util.make_pupil.centrePourVidal | ( | N, | |
i0, | |||
j0, | |||
centerMark | |||
) |
Renvoie une image de boolens (False) de taille (N,N) avec un point ou une croix (True) centree sur (i0, j0).
N | int taille de l'image de sortie |
j0 | float i0, position du marqueur de sortie |
centerMark | int 0 (pour rien), 1 (option point) ou 2 (option croix) |
Definition at line 1155 of file make_pupil.py.
def shesha.util.make_pupil.compute1Spider | ( | nspider, | |
N, | |||
dspider, | |||
i0, | |||
j0, | |||
scale, | |||
rot | |||
) |
Fonction de fab pour creer le slaving.
La fonction cree un tableau de booleens avec une seule spider. Utilisee par la fonction compute6Segments()
Definition at line 781 of file make_pupil.py.
def shesha.util.make_pupil.compute6Segments | ( | pupNoSpiders, | |
N, | |||
pixscale, | |||
dspider, | |||
i0, | |||
j0, | |||
rot = 0 |
|||
) |
Utilisee dans compass/shesha/shesha/supervisor/canapassSupervisor.py pour le slaving des actus.
Definition at line 748 of file make_pupil.py.
def shesha.util.make_pupil.createHexaPattern | ( | pitch, | |
supportSize | |||
) |
Cree une liste de coordonnees qui decrit un maillage hexagonal.
Retourne un tuple (x,y).
Le maillage est centre sur 0, l'un des points est (0,0). Une des pointes de l'hexagone est dirigee selon l'axe Y, au sens ou le tuple de sortie est (x,y).
pitch | float distance between 2 neighbour points |
supportSize | int size of the support that need to be populated |
Definition at line 848 of file make_pupil.py.
def shesha.util.make_pupil.fillHalfSpider | ( | N, | |
nspider, | |||
dspider, | |||
i0, | |||
j0, | |||
scale, | |||
rot | |||
) |
def shesha.util.make_pupil.fillPolygon | ( | x, | |
y, | |||
i0, | |||
j0, | |||
scale, | |||
gap, | |||
N, | |||
index = 0 |
|||
) |
From a list of points defined by their 2 coordinates list x and y, creates a filled polygon with sides joining the points.
The polygon is created in an image of size (N, N). The origin (x,y)=(0,0) is mapped at pixel i0, j0 (both can be floating-point values). Arrays x and y are supposed to be in unit U, and scale is the pixel size in U units.
y | float x, list of points defining the polygon |
j0 | float i0, index of pixels where the pupil should be centred. Can be floating-point indexes. |
scale | float size of a pixel of the image, in same unit as x and y. |
N | float size of output image. :Example: x = np.array([1,-1,-1.5,0,1.1])
y = np.array([1,1.5,-0.2,-2,0])
N = 200
i0 = N/2
j0 = N/2
gap = 0.
scale = 0.03
pol = fillPolygon(x, y, i0, j0, scale, gap, N, index=2)
|
Definition at line 661 of file make_pupil.py.
def shesha.util.make_pupil.fillSpider | ( | N, | |
nspider, | |||
dspider, | |||
i0, | |||
j0, | |||
scale, | |||
rot | |||
) |
Creates a boolean spider mask on a map of dimensions (N,N) The spider is centred at floating-point coords (i0,j0).
N | int size of output image |
nspider | int number of spiders |
dspider | float width of spiders |
i0 | float coord of spiders symmetry centre |
j0 | float coord of spiders symmetry centre |
scale | float size of a pixel in same unit as dspider |
rot | float rotation angle in radians |
Definition at line 807 of file make_pupil.py.
def shesha.util.make_pupil.gendron | ( | ) |
La fonction est appelee quand l'utilisateur a demande une pupille ELT, et renseigne un diametre de telescope different de 40 metres.
Faut vraiment que je commente ou t'as compris ??
Definition at line 948 of file make_pupil.py.
def shesha.util.make_pupil.generateCoordSegments | ( | D, | |
rot, | |||
pitch = 1.244683637214 , |
|||
nseg = 33 , |
|||
inner_rad = 4.1 , |
|||
outer_rad = 15.4 , |
|||
R = 95.7853 , |
|||
nominalD = 40 |
|||
) |
Computes the coordinates of the corners of all the hexagonal segments of M1.
Result is a tuple of arrays(6, 798).
D | (float) : pupil diameter in meters (it must be set to 40.0 m for the ELT) |
rot | (float) : pupil rotation angle in radians |
pitch | (float): Segment pitch [meters] |
nseg | (int) : number of segments across the diameter |
inner_rad | (float): Inner radius [meters] |
outer_rad | (float): Outer radius [meters] |
R | (float): Curvature radius of the M1 |
nominalD | (float): diameter for nominal pupil |
Definition at line 885 of file make_pupil.py.
def shesha.util.make_pupil.generateEeltPupilMask | ( | npt, | |
dspider, | |||
i0, | |||
j0, | |||
pixscale, | |||
gap, | |||
rotdegree, | |||
D = 40.0 , |
|||
cobs = 0 , |
|||
centerMark = 0 , |
|||
halfSpider = False , |
|||
pitch = 1.244683637214 , |
|||
nseg = 33 , |
|||
inner_rad = 4.1 , |
|||
outer_rad = 15.4 , |
|||
R = 95.7853 , |
|||
nominalD = 40 , |
|||
half_seg = 0.75 , |
|||
refl = None , |
|||
rotSpiderDegree = None , |
|||
nmissing = 0 |
|||
) |
Generates a boolean pupil mask of the binary EELT pupil on a map of size (npt, npt).
npt | int size of the output array |
dspider | float width of spiders in meters |
j0 | float i0, index of pixels where the pupil should be centred = p_geom.pupdiam / 2. - 0.5 Can be floating-point indexes. |
pixscale | float size of a pixel of the image, in meters = ptel.diam/(p_geom.pupdiam / 2. - 0.5) |
gap | float gap between 2 segments in metres |
rotdegree | float rotation angle of the pupil, in degrees. |
D | float diameter of the pupil. For the nominal EELT, D shall be set to 40.0 |
centerMark | int when centerMark!=0, a pixel is added at the centre of symmetry of the pupil in order to debug things using compass. centerMark==1 draws a point centerMark==2 draws 2 lines |
halfSpider | bool half Spider computation flag |
pitch | float segment pitch |
nseg | int number of segments across the diameter |
inner_rad | float Inner radius [meters] |
outter_rad | float outter radius [meters] |
R | float M1 curvature radius |
nominalD | float diameter needed to get nominal aperture after projection |
half_seg | float segment half size |
refl | float std of the reflectivity of each segment :Example: npt = p_geom.pupdiam
D = p_tel.diam
i0 = npt / 2. - 0.5
j0 = npt / 2. - 0.5
rotdegree = 0.
pixscale = D/(npt / 2. - 0.5)
dspider = 0.51
gap = 0.0
pup = generateEeltPupilMask(npt, dspider, i0, j0, pixscale, gap, rotdegree)
|
Definition at line 552 of file make_pupil.py.
def shesha.util.make_pupil.generateSegmentProperties | ( | attribute, | |
hx, | |||
hy, | |||
i0, | |||
j0, | |||
scale, | |||
gap, | |||
N, | |||
D, | |||
softGap = 0 , |
|||
nominalD = 40 , |
|||
pitch = 1.244683637214 , |
|||
half_seg = 0.75 |
|||
) |
Builds a 2D image of the pupil with some attributes for each of the segments.
Those segments are described from arguments hx and hy, that are produced by the function generateCoordSegments(D, rot).
When attribute is a phase, then it must be a float array of dimension [3, 798] with the dimension 3 being piston, tip, and tilt. Units of phase is xxx rms, and the output of the procedure will be in units of xxx.
attribute | float/int/bool scalar value or 1D-array of the reflectivity of the segments or 2D array of phase If attribute is scalar, the value will be replicated for all segments. If attribute is a 1D array, then it shall contain the reflectivities of all segments. If attribute is a 2D array then it shall contain the piston, tip and tilt of the segments. The array shall be of dimension [3, 798] that contains [piston, tip, tilt] On output, the data type of the pupil map will be the same as attribute. |
hy | float hx, arrays [6,:] describing the segment shapes. They are generated using generateCoordSegments() |
dspider | float width of spiders in meters |
j0 | float i0, index of pixels where the pupil should be centred. Can be floating-point indexes. |
scale | float size of a pixel of the image, in meters. |
gap | float half-space between segments in meters |
N | int size of the output array (N,N) |
D | float diameter of the pupil. For the nominal EELT, D shall be set to 40.0 |
softGap | bool if False, the gap between segments is binary 0/1 depending if the pixel is within the gap or not. If True, the gap is a smooth region of a fwhm of 2 pixels with a depth related to the gap width. |
nominalD | float diameter needed to get nominal pupil aperture |
pitch | float segment pitch |
half_seg | float segment half size |
Definition at line 1073 of file make_pupil.py.
def shesha.util.make_pupil.getdatatype | ( | truc | ) |
Returns the data type of a numpy variable, either scalar value or array.
Definition at line 1013 of file make_pupil.py.
def shesha.util.make_pupil.make_EELT | ( | dim, | |
pupd, | |||
tel, | |||
N_seg = -1 |
|||
) |
Initialize the EELT pupil.
dim | (long) : linear size of ??? |
pupd | (long) : linear size of total pupil |
tel | (Param_tel) : Telescope structure |
N_seg | (int) |
TODO | complete |
TODO | add force rescal pup elt |
Definition at line 265 of file make_pupil.py.
def shesha.util.make_pupil.make_phase_ab | ( | dim, | |
pupd, | |||
tel, | |||
pup = None , |
|||
xc = -1 , |
|||
yc = -1 , |
|||
real = 0 , |
|||
halfSpider = False |
|||
) |
Compute the EELT M1 phase aberration.
dim | (long) : linear size of ??? |
pupd | (long) : linear size of total pupil |
tel | (Param_tel) : Telescope structure |
pup | (?) |
TODO | complete |
Definition at line 386 of file make_pupil.py.
def shesha.util.make_pupil.make_pupil | ( | dim, | |
pupd, | |||
tel, | |||
xc = -1 , |
|||
yc = -1 , |
|||
real = 0 , |
|||
halfSpider = False |
|||
) |
Initialize the system pupil.
dim | (long) : = p_geom.pupdiam |
pupd | (long) : linear size of total pupil = p_geom.pupdiam |
tel | (Param_tel) : Telescope structure |
xc | (int) = p_geom.pupdiam / 2. - 0.5 |
yc | (int) = p_geom.pupdiam / 2. - 0.5 |
real | (int) |
TODO | complete |
Definition at line 68 of file make_pupil.py.
def shesha.util.make_pupil.make_pupil_generic | ( | dim, | |
pupd, | |||
t_spiders = 0.01 , |
|||
spiders_type = SpiderType.SIX , |
|||
xc = 0 , |
|||
yc = 0 , |
|||
real = 0 , |
|||
cobs = 0 |
|||
) |
Initialize the system pupil.
dim | (long) : linear size of ??? |
pupd | (long) : linear size of total pupil |
t_spiders | (float) : secondary supports ratio. |
spiders_type | (str) : secondary supports type: "four" or "six". |
xc | (int) |
yc | (int) |
real | (int) |
cobs | (float) : central obstruction ratio. |
TODO | complete |
Definition at line 147 of file make_pupil.py.
def shesha.util.make_pupil.make_VLT | ( | dim, | |
pupd, | |||
tel | |||
) |
Initialize the VLT pupil.
dim | (long) : linear size of ??? |
pupd | (long) : linear size of total pupil |
tel | (Param_tel) : Telescope structure |
Definition at line 218 of file make_pupil.py.
def shesha.util.make_pupil.reorganizeSegmentsOrderESO | ( | x, | |
y | |||
) |
Reorganisation des segments facon ESO.
Voir ESO-193058 Standard Coordinate System and Basic Conventions
x | float tableau des centres X des segments |
y | float idem Y |
Definition at line 989 of file make_pupil.py.
string shesha.util.make_pupil.EELT_data = os.environ.get('SHESHA_ROOT') + "/data/apertures/" |
Definition at line 47 of file make_pupil.py.