COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
PTEL.py
1 
37 
38 import numpy as np
39 from . import config_setter_utils as csu
40 import shesha.constants as const
41 
42 
43 
46 class Param_tel:
47 
48  def __init__(self):
49  """ telescope diameter (in meters)."""
50  self.__diam__diam = 0.0
51  """ central obstruction ratio."""
52  self.__cobs__cobs = 0.0
53  """ EELT aperture type: "Nominal", "BP1", "BP3", "BP5" (for back-up plan with 1, 3, or 5 missing annulus)."""
54  self.__type_ap__type_ap = const.ApertureType.GENERIC
55  """ secondary supports ratio."""
56  self.__t_spiders__t_spiders = -1.
57  """ secondary supports type: "four" or "six"."""
58  self.__spiders_type__spiders_type = None
59  """ rotation angle of pupil."""
60  self.__pupangle__pupangle = 0.0
61  """ number of missing segments for EELT pupil (max is 20)."""
62  self.__nbrmissing__nbrmissing = 0
63  """ Gap between segments [meters]"""
64  self.__gap__gap = 0.0
65  """ std of reflectivity errors for EELT segments (fraction)."""
66  self.__referr__referr = 0.0
67  """ std of piston errors for EELT segments """
68  self.__std_piston__std_piston = 0.0
69  """ std of tip-tilt errors for EELT segments. """
70  self.__std_tt__std_tt = 0.0
71  """ Vector for define segments numbers need. """
72  self.__vect_seg__vect_seg = None
73 
74  def get_diam(self):
75  """ Get the telescope diameter
76 
77  :return: (float) : telescope diameter (in meters)
78  """
79  return self.__diam__diam
80 
81  def set_diam(self, d):
82  """ Set the telescope diameter
83 
84  :param d: (float) : telescope diameter (in meters)
85  """
86  self.__diam__diam = csu.enforce_float(d)
87 
88  diam = property(get_diam, set_diam)
89 
90  def get_cobs(self):
91  """ Get the central obstruction ratio
92 
93  :return: (float) : central obstruction ratio
94  """
95  return self.__cobs__cobs
96 
97  def set_cobs(self, c):
98  """ Set the central obstruction ratio
99 
100  :param c: (float) : central obstruction ratio
101  """
102  self.__cobs__cobs = csu.enforce_float(c)
103 
104  cobs = property(get_cobs, set_cobs)
105 
106  def get_type_ap(self):
107  """ Get the EELT aperture type
108 
109  :return: (str) : EELT aperture type
110  """
111  return self.__type_ap__type_ap
112 
113  def set_type_ap(self, t):
114  """ Set the EELT aperture type
115 
116  :param t: (str) : EELT aperture type
117  """
118  self.__type_ap__type_ap = const.check_enum(const.ApertureType, t)
119 
120  type_ap = property(get_type_ap, set_type_ap)
121 
122  def get_t_spiders(self):
123  """ Get the secondary supports ratio
124 
125  :return: (float) : secondary supports ratio
126  """
127  return self.__t_spiders__t_spiders
128 
129  def set_t_spiders(self, spider):
130  """ Set the secondary supports ratio
131 
132  :param spider: (float) : secondary supports ratio
133  """
134  self.__t_spiders__t_spiders = csu.enforce_float(spider)
135 
136  t_spiders = property(get_t_spiders, set_t_spiders)
137 
138  def get_spiders_type(self):
139  """ Get the secondary supports type
140 
141  :return: (str) : secondary supports type
142  """
143  return self.__spiders_type__spiders_type
144 
145  def set_spiders_type(self, spider):
146  """ Set the secondary supports type
147 
148  :param spider: (str) : secondary supports type
149  """
150  self.__spiders_type__spiders_type = const.check_enum(const.SpiderType, spider)
151 
152  spiders_type = property(get_spiders_type, set_spiders_type)
153 
154  def get_pupangle(self):
155  """ Get the rotation angle of pupil
156 
157  :return: (float) : rotation angle of pupil
158  """
159  return self.__pupangle__pupangle
160 
161  def set_pupangle(self, p):
162  """ Set the rotation angle of pupil
163 
164  :param p: (float) : rotation angle of pupil
165  """
166  self.__pupangle__pupangle = csu.enforce_float(p)
167 
168  pupangle = property(get_pupangle, set_pupangle)
169 
170  def get_nbrmissing(self):
171  """ Get the number of missing segments for EELT pupil
172 
173  :return: (long) : number of missing segments for EELT pupil (max is 20)
174  """
175  return self.__nbrmissing__nbrmissing
176 
177  def set_nbrmissing(self, nb):
178  """ Set the number of missing segments for EELT pupil
179 
180  :param nb: (long) : number of missing segments for EELT pupil (max is 20)
181  """
182  self.__nbrmissing__nbrmissing = csu.enforce_int(nb)
183 
184  nbrmissing = property(get_nbrmissing, set_nbrmissing)
185 
186  def get_gap(self):
187  """ Get the Gap between segments
188 
189  :return: (float) : Gap between segments (meters)
190  """
191  return self.__gap__gap
192 
193  def set_gap(self, gap):
194  """ Set the Gap between segments
195 
196  :param gap: (float) : Gap between segments (meters)
197  """
198  self.__gap__gap = csu.enforce_float(gap)
199 
200  gap = property(get_gap, set_gap)
201 
202  def get_referr(self):
203  """ Get the std of reflectivity errors for EELT segments
204 
205  :return: (float) : std of reflectivity errors for EELT segments (fraction)
206  """
207  return self.__referr__referr
208 
209  def set_referr(self, ref):
210  """ Set the std of reflectivity errors for EELT segments
211 
212  :param ref: (float) : std of reflectivity errors for EELT segments (fraction)
213  """
214  self.__referr__referr = csu.enforce_float(ref)
215 
216  referr = property(get_referr, set_referr)
217 
218  def get_std_piston(self):
219  """ Get the std of piston errors for EELT segments
220 
221  :return: (float) : std of piston errors for EELT segments
222  """
223  return self.__std_piston__std_piston
224 
225  def set_std_piston(self, piston):
226  """ Set the std of piston errors for EELT segments
227 
228  :param piston: (float) : std of piston errors for EELT segments
229  """
230  self.__std_piston__std_piston = csu.enforce_float(piston)
231 
232  std_piston = property(get_std_piston, set_std_piston)
233 
234  def get_std_tt(self):
235  """ Get the std of tip-tilt errors for EELT segments
236 
237  :return: (float) : std of tip-tilt errors for EELT segments
238  """
239  return self.__std_tt__std_tt
240 
241  def set_std_tt(self, tt):
242  """ Set the std of tip-tilt errors for EELT segments
243 
244  :param tt: (float) : std of tip-tilt errors for EELT segments
245  """
246  self.__std_tt__std_tt = csu.enforce_float(tt)
247 
248  std_tt = property(get_std_tt, set_std_tt)
249 
250  def get_vect_seg(self):
251  """ Get the segment number for construct ELT pupil"
252 
253  :return: (list of int32) : segment numbers
254  """
255  return self.__vect_seg__vect_seg
256 
257  def set_vect_seg(self, vect):
258  """ Set the segment number for construct ELT pupil"
259 
260  :param vect: (list of int32) : segment numbers
261  """
262  self.__vect_seg__vect_seg = csu.enforce_array(vect, len(vect), dtype=np.int32,
263  scalar_expand=False)
264 
265  vect_seg = property(get_vect_seg, set_vect_seg)
P-Class (parametres) Param_tel.
Definition: PTEL.py:46
def set_referr(self, ref)
Set the std of reflectivity errors for EELT segments.
Definition: PTEL.py:213
def __init__(self)
telescope diameter (in meters).
Definition: PTEL.py:49
def set_std_piston(self, piston)
Set the std of piston errors for EELT segments.
Definition: PTEL.py:229
def get_gap(self)
Get the Gap between segments.
Definition: PTEL.py:190
def get_std_piston(self)
Get the std of piston errors for EELT segments.
Definition: PTEL.py:222
def set_gap(self, gap)
Set the Gap between segments.
Definition: PTEL.py:197
def set_vect_seg(self, vect)
Set the segment number for construct ELT pupil".
Definition: PTEL.py:261
def get_t_spiders(self)
Get the secondary supports ratio.
Definition: PTEL.py:126
def get_std_tt(self)
Get the std of tip-tilt errors for EELT segments.
Definition: PTEL.py:238
def get_nbrmissing(self)
Get the number of missing segments for EELT pupil.
Definition: PTEL.py:174
def get_spiders_type(self)
Get the secondary supports type.
Definition: PTEL.py:142
def set_type_ap(self, t)
Set the EELT aperture type.
Definition: PTEL.py:117
def get_type_ap(self)
Get the EELT aperture type.
Definition: PTEL.py:110
def get_cobs(self)
Get the central obstruction ratio.
Definition: PTEL.py:94
def get_diam(self)
Get the telescope diameter.
Definition: PTEL.py:78
def set_pupangle(self, p)
Set the rotation angle of pupil.
Definition: PTEL.py:165
def set_std_tt(self, tt)
Set the std of tip-tilt errors for EELT segments.
Definition: PTEL.py:245
def get_referr(self)
Get the std of reflectivity errors for EELT segments.
Definition: PTEL.py:206
def set_spiders_type(self, spider)
Set the secondary supports type.
Definition: PTEL.py:149
def get_vect_seg(self)
Get the segment number for construct ELT pupil".
Definition: PTEL.py:254
def get_pupangle(self)
Get the rotation angle of pupil.
Definition: PTEL.py:158
def set_diam(self, d)
Set the telescope diameter.
Definition: PTEL.py:85
def set_t_spiders(self, spider)
Set the secondary supports ratio.
Definition: PTEL.py:133
def set_nbrmissing(self, nb)
Set the number of missing segments for EELT pupil.
Definition: PTEL.py:181
def set_cobs(self, c)
Set the central obstruction ratio.
Definition: PTEL.py:101
Numerical constants for shesha and config enumerations for safe-typing.
Definition: constants.py:1