COMPASS
5.0.0
End-to-end AO simulation tool using GPU acceleration
constants.py
1
37
38
import
numpy
as
np
39
40
41
class
CONST
:
42
RAD2ARCSEC = 3600. * 360. / (2 * np.pi)
43
ARCSEC2RAD = 2. * np.pi / (360. * 3600.)
44
RAD2DEG = 180. / np.pi
45
DEG2RAD = np.pi / 180.
46
47
48
def
check_enum
(cls, name):
49
"""
50
Create a safe-type enum instance from bytes contents
51
"""
52
53
if
not
isinstance(name, str)
or
\
54
not
name
in
vars(cls).values():
55
raise
ValueError(
"Invalid enumeration value for enum %s, value %s"
% (cls, name))
56
return
name
57
58
59
class
DmType
:
60
"""
61
Types of deformable mirrors
62
"""
63
64
PZT =
'pzt'
65
TT =
'tt'
66
KL =
'kl'
67
68
69
class
PatternType
:
70
"""
71
Types of Piezo DM patterns
72
"""
73
74
SQUARE =
'square'
75
HEXA =
'hexa'
76
HEXAM4 =
'hexaM4'
77
78
79
class
KLType
:
80
"""
81
Possible KLs for computations
82
"""
83
84
KOLMO =
'kolmo'
85
KARMAN =
'karman'
86
87
88
class
InfluType
:
89
"""
90
Influence function types
91
"""
92
93
DEFAULT =
'default'
94
RADIALSCHWARTZ =
'radialSchwartz'
95
SQUARESCHWARTZ =
'squareSchwartz'
96
BLACKNUTT =
'blacknutt'
97
GAUSSIAN =
'gaussian'
98
BESSEL =
'bessel'
99
PETAL =
'petal'
100
101
102
class
ControllerType
:
103
"""
104
Controller types
105
"""
106
107
GENERIC =
'generic'
108
LS =
'ls'
109
MV =
'mv'
110
CURED =
'cured'
111
GEO =
'geo'
112
113
114
class
CentroiderType
:
115
"""
116
Centroider types
117
"""
118
119
COG =
'cog'
120
TCOG =
'tcog'
121
WCOG =
'wcog'
122
BPCOG =
'bpcog'
123
CORR =
'corr'
124
PYR =
'pyr'
125
MASKEDPIX =
'maskedpix'
126
127
128
class
CentroiderFctType
:
129
MODEL =
'model'
130
GAUSS =
'gauss'
131
132
133
class
PyrCentroiderMethod
:
134
"""
135
Pyramid centroider methods
136
Local flux normalization (eq SH quad-cell, ray optics. Ragazzonni 1996)
137
Global flux normalization (Verinaud 2004, most > 2010 Pyr applications)
138
Resulting (A+/-B-/+C-D)/(A+B+C+D) or sin((A+/-B-/+C-D)/(A+B+C+D))
139
ref. code sutra_centroider_pyr.h
140
"""
141
NOSINUSGLOBAL = 0
142
SINUSGLOBAL = 1
143
NOSINUSLOCAL = 2
144
SINUSLOCAL = 3
145
OTHER = 4
146
147
148
class
WFSType
:
149
"""
150
WFS Types
151
"""
152
SH =
'sh'
153
PYRHR =
'pyrhr'
154
PYRLR =
'pyrlr'
155
156
157
class
TargetImageType
:
158
"""
159
Target Images
160
"""
161
162
SE =
'se'
163
LE =
'le'
164
165
166
class
ApertureType
:
167
"""
168
Telescope apertures
169
"""
170
GENERIC =
'Generic'
171
EELT_NOMINAL =
'EELT-Nominal'
# Alexis Carlotti method
172
EELT =
'EELT'
# E. Gendron method
173
EELT_BP1 =
'EELT-BP1'
174
EELT_BP3 =
'EELT-BP3'
175
EELT_BP5 =
'EELT-BP5'
176
EELT_CUSTOM =
'EELT-Custom'
177
VLT =
'VLT'
178
KECK =
'keck'
179
180
181
class
SpiderType
:
182
"""
183
Spiders
184
"""
185
FOUR =
'four'
186
SIX =
'six'
187
188
189
class
ProfType
:
190
"""
191
Sodium profile for LGS
192
"""
193
GAUSS1 =
'Gauss1'
194
GAUSS2 =
'Gauss2'
195
GAUSS3 =
'Gauss3'
196
EXP =
'Exp'
197
FILES = dict({
198
GAUSS1:
"allProfileNa_withAltitude_1Gaussian.npy"
,
199
GAUSS2:
"allProfileNa_withAltitude_2Gaussian.npy"
,
200
GAUSS3:
"allProfileNa_withAltitude_3Gaussian.npy"
,
201
EXP:
"allProfileNa_withAltitude.npy"
202
})
203
204
205
class
FieldStopType
:
206
"""
207
WFS field stop
208
"""
209
SQUARE =
'square'
210
ROUND =
'round'
shesha.constants.SpiderType
Spiders.
Definition:
constants.py:184
shesha.constants.ApertureType
Telescope apertures.
Definition:
constants.py:169
shesha.constants.PatternType
Types of Piezo DM patterns.
Definition:
constants.py:72
shesha.constants.check_enum
def check_enum(cls, name)
Create a safe-type enum instance from bytes contents.
Definition:
constants.py:51
shesha.constants.WFSType
WFS Types.
Definition:
constants.py:151
shesha.constants.TargetImageType
Target Images.
Definition:
constants.py:160
shesha.constants.PyrCentroiderMethod
Definition:
constants.py:140
shesha.constants.CentroiderType
Centroider types.
Definition:
constants.py:117
shesha.constants.CentroiderFctType
Definition:
constants.py:128
shesha.constants.KLType
Possible KLs for computations.
Definition:
constants.py:82
shesha.constants.ControllerType
Controller types.
Definition:
constants.py:105
shesha.constants.DmType
Types of deformable mirrors.
Definition:
constants.py:62
shesha.constants.ProfType
Sodium profile for LGS.
Definition:
constants.py:192
shesha.constants.InfluType
Influence function types.
Definition:
constants.py:91
shesha.constants.CONST
Definition:
constants.py:41
shesha.constants.FieldStopType
WFS field stop.
Definition:
constants.py:208
shesha
shesha
constants.py
Generated by
1.8.18