COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
PATMOS.py
1 
37 
38 import numpy as np
39 from . import config_setter_utils as csu
40 
41 
44 
45 
47 
48  def __init__(self):
49  """ Number of turbulent layers."""
50  self.__nscreens = 0
51  """ Global r0."""
52  self.__r0 = None
53  """ Pupil pixel size (in meters)."""
54  self.__pupixsize = None
55  """ L0 per layers in meters."""
56  self.__L0 = None
57  """ Linear size of phase screens."""
58  self.__dim_screens = None
59  """ Altitudes of each layer."""
60  self.__alt = None
61  """ Wind directions of each layer."""
62  self.__winddir = None
63  """ Wind speeds of each layer."""
64  self.__windspeed = None
65  """ Fraction of r0 for each layer."""
66  self.__frac = None
67  """ x translation speed (in pix / iteration) for each layer."""
68  self.__deltax = None
69  """ y translation speed (in pix / iteration) for each layer."""
70  self.__deltay = None
71  """ RNG Seeds for each layer."""
72  self.__seeds = None
73 
74  def get_nscreens(self):
75  """ Set the number of turbulent layers
76 
77  :return: (long) number of screens.
78  """
79  return self.__nscreens
80 
81  def set_nscreens(self, n):
82  """ Set the number of turbulent layers
83 
84  :param n: (long) number of screens.
85  """
86  self.__nscreens = csu.enforce_int(n)
87 
88  nscreens = property(get_nscreens, set_nscreens)
89 
90  def get_r0(self):
91  """ Get the global r0
92 
93  :return: (float) : global r0
94  """
95  return self.__r0
96 
97  def set_r0(self, r):
98  """ Set the global r0
99 
100  :param r: (float) : global r0
101  """
102  self.__r0 = csu.enforce_float(r)
103 
104  r0 = property(get_r0, set_r0)
105 
106  def get_pupixsize(self):
107  """ Get the pupil pixel size
108 
109  :return: (float) : pupil pixel size
110  """
111  return self.__pupixsize
112 
113  def set_pupixsize(self, xsize):
114  """ Set the pupil pixel size
115 
116  :param xsize: (float) : pupil pixel size
117  """
118  self.__pupixsize = csu.enforce_float(xsize)
119 
120  pupixsize = property(get_pupixsize, set_pupixsize)
121 
122  def get_L0(self):
123  """ Get the L0 per layers
124 
125  :return: (lit of float) : L0 for each layers
126  """
127  return self.__L0
128 
129  def set_L0(self, l):
130  """ Set the L0 per layers
131 
132  :param l: (lit of float) : L0 for each layers
133  """
134  self.__L0 = csu.enforce_array(l, size=self.nscreens, dtype=np.float32,
135  scalar_expand=True)
136 
137  L0 = property(get_L0, set_L0)
138 
139  def get_dim_screens(self):
140  """ Get the size of the phase screens
141 
142  :return: (lit of float) : phase screens sizes
143  """
144  return self.__dim_screens
145 
146  def set_dim_screens(self, l):
147  """ Set the size of the phase screens
148 
149  :param l: (lit of float) : phase screens sizes
150  """
151  self.__dim_screens = csu.enforce_array(l, size=self.nscreens, dtype=np.int64,
152  scalar_expand=False)
153 
154  dim_screens = property(get_dim_screens, set_dim_screens)
155 
156  def get_alt(self):
157  """ Get the altitudes of each layer
158 
159  :return: (lit of float) : altitudes
160  """
161  return self.__alt
162 
163  def set_alt(self, h):
164  """ Set the altitudes of each layer
165 
166  :param h: (lit of float) : altitudes
167  """
168  self.__alt = csu.enforce_array(h, size=self.nscreens, dtype=np.float32,
169  scalar_expand=False)
170 
171  alt = property(get_alt, set_alt)
172 
173  def get_winddir(self):
174  """ Get the wind direction for each layer
175 
176  :return: (lit of float) : wind directions
177  """
178  return self.__winddir
179 
180  def set_winddir(self, l):
181  """ Set the wind direction for each layer
182 
183  :param l: (lit of float) : wind directions
184  """
185  self.__winddir = csu.enforce_array(l, size=self.nscreens, dtype=np.float32,
186  scalar_expand=True)
187 
188  winddir = property(get_winddir, set_winddir)
189 
190  def get_windspeed(self):
191  """ Get the the wind speed for each layer
192 
193  :return: (list of float) : wind speeds
194  """
195  return self.__windspeed
196 
197  def set_windspeed(self, l):
198  """ Set the the wind speed for each layer
199 
200  :param l: (list of float) : wind speeds
201  """
202  self.__windspeed = csu.enforce_array(l, size=self.nscreens, dtype=np.float32,
203  scalar_expand=True)
204 
205  windspeed = property(get_windspeed, set_windspeed)
206 
207  def get_frac(self):
208  """ Get the fraction of r0 for each layers
209 
210  :return: (lit of float) : fraction of r0
211  """
212  return self.__frac
213 
214  def set_frac(self, l):
215  """ Set the fraction of r0 for each layers
216 
217  :param l: (lit of float) : fraction of r0
218  """
219  self.__frac = csu.enforce_array(l, size=self.nscreens, dtype=np.float32,
220  scalar_expand=True)
221 
222  frac = property(get_frac, set_frac)
223 
224  def get_deltax(self):
225  """ Get the translation speed on axis x for each layer
226 
227  :return: (lit of float) : translation speed
228  """
229  return self.__deltax
230 
231  def set_deltax(self, l):
232  """ Set the translation speed on axis x for each layer
233 
234  :param l: (lit of float) : translation speed
235  """
236  self.__deltax = csu.enforce_array(l, size=self.nscreens, dtype=np.float32,
237  scalar_expand=True)
238 
239  _deltax = property(get_deltax, set_deltax)
240 
241  def get_deltay(self):
242  """ Get the translation speed on axis y for each layer
243 
244  :return: (lit of float) : translation speed
245  """
246  return self.__deltay
247 
248  def set_deltay(self, l):
249  """ Set the translation speed on axis y for each layer
250 
251  :param l: (lit of float) : translation speed
252  """
253  self.__deltay = csu.enforce_array(l, size=self.nscreens, dtype=np.float32,
254  scalar_expand=True)
255 
256  _deltay = property(get_deltay, set_deltay)
257 
258  def get_seeds(self):
259  """ Get the seed for each layer
260 
261  :return: (lit of int) : seed
262  """
263  return self.__seeds
264 
265  def set_seeds(self, l):
266  """ Set the seed for each layer
267 
268  :param l: (lit of int) : seed
269  """
270  self.__seeds = csu.enforce_array(l, size=self.nscreens, dtype=np.int64,
271  scalar_expand=True)
272 
273  seeds = property(get_seeds, set_seeds)
shesha.config.PATMOS.Param_atmos
P-Class (parametres) Param_atmos.
Definition: PATMOS.py:46
shesha.config.PATMOS.Param_atmos.get_windspeed
def get_windspeed(self)
Get the the wind speed for each layer.
Definition: PATMOS.py:194
shesha.config.PATMOS.Param_atmos.set_L0
def set_L0(self, l)
Set the L0 per layers.
Definition: PATMOS.py:133
shesha.config.PATMOS.Param_atmos.__r0
__r0
Definition: PATMOS.py:52
shesha.config.PATMOS.Param_atmos.set_dim_screens
def set_dim_screens(self, l)
Set the size of the phase screens.
Definition: PATMOS.py:150
shesha.config.PATMOS.Param_atmos.get_deltax
def get_deltax(self)
Get the translation speed on axis x for each layer.
Definition: PATMOS.py:228
shesha.config.PATMOS.Param_atmos.nscreens
nscreens
Definition: PATMOS.py:88
shesha.config.PATMOS.Param_atmos.get_dim_screens
def get_dim_screens(self)
Get the size of the phase screens.
Definition: PATMOS.py:143
shesha.config.PATMOS.Param_atmos.get_seeds
def get_seeds(self)
Get the seed for each layer.
Definition: PATMOS.py:268
shesha.config.PATMOS.Param_atmos.get_frac
def get_frac(self)
Get the fraction of r0 for each layers.
Definition: PATMOS.py:211
shesha.config.PATMOS.Param_atmos.__alt
__alt
Definition: PATMOS.py:60
shesha.config.PATMOS.Param_atmos.get_alt
def get_alt(self)
Get the altitudes of each layer.
Definition: PATMOS.py:160
shesha.config.PATMOS.Param_atmos.get_pupixsize
def get_pupixsize(self)
Get the pupil pixel size.
Definition: PATMOS.py:110
shesha.config.PATMOS.Param_atmos.set_deltax
def set_deltax(self, l)
Set the translation speed on axis x for each layer.
Definition: PATMOS.py:235
shesha.config.PATMOS.Param_atmos.get_winddir
def get_winddir(self)
Get the wind direction for each layer.
Definition: PATMOS.py:177
shesha.config.PATMOS.Param_atmos.set_winddir
def set_winddir(self, l)
Set the wind direction for each layer.
Definition: PATMOS.py:184
shesha.config.PATMOS.Param_atmos.set_windspeed
def set_windspeed(self, l)
Set the the wind speed for each layer.
Definition: PATMOS.py:201
shesha.config.PATMOS.Param_atmos.__seeds
__seeds
Definition: PATMOS.py:72
shesha.config.PATMOS.Param_atmos.__deltay
__deltay
Definition: PATMOS.py:70
shesha.config.PATMOS.Param_atmos.set_pupixsize
def set_pupixsize(self, xsize)
Set the pupil pixel size.
Definition: PATMOS.py:117
shesha.config.PATMOS.Param_atmos.set_frac
def set_frac(self, l)
Set the fraction of r0 for each layers.
Definition: PATMOS.py:218
shesha.config.PATMOS.Param_atmos.__deltax
__deltax
Definition: PATMOS.py:68
shesha.config.PATMOS.Param_atmos.set_seeds
def set_seeds(self, l)
Set the seed for each layer.
Definition: PATMOS.py:275
shesha.config.PATMOS.Param_atmos.set_alt
def set_alt(self, h)
Set the altitudes of each layer.
Definition: PATMOS.py:167
shesha.config.PATMOS.Param_atmos.get_nscreens
def get_nscreens(self)
Set the number of turbulent layers.
Definition: PATMOS.py:78
shesha.config.PATMOS.Param_atmos.set_deltay
def set_deltay(self, l)
Set the translation speed on axis y for each layer.
Definition: PATMOS.py:255
shesha.config.PATMOS.Param_atmos.set_r0
def set_r0(self, r)
Set the global r0.
Definition: PATMOS.py:101
shesha.config.PATMOS.Param_atmos.get_r0
def get_r0(self)
Get the global r0.
Definition: PATMOS.py:94
shesha.config.PATMOS.Param_atmos.__init__
def __init__(self)
Number of turbulent layers.
Definition: PATMOS.py:49
shesha.config.PATMOS.Param_atmos.get_L0
def get_L0(self)
Get the L0 per layers.
Definition: PATMOS.py:126
shesha.config.PATMOS.Param_atmos.__L0
__L0
Definition: PATMOS.py:56
shesha.config.PATMOS.Param_atmos.__dim_screens
__dim_screens
Definition: PATMOS.py:58
shesha.config.PATMOS.Param_atmos.set_nscreens
def set_nscreens(self, n)
Set the number of turbulent layers.
Definition: PATMOS.py:85
shesha.config.PATMOS.Param_atmos.__pupixsize
__pupixsize
Definition: PATMOS.py:54
shesha.config.PATMOS.Param_atmos.__winddir
__winddir
Definition: PATMOS.py:62
shesha.config.PATMOS.Param_atmos.__nscreens
__nscreens
Definition: PATMOS.py:50
shesha.config.PATMOS.Param_atmos.get_deltay
def get_deltay(self)
Get the translation speed on axis y for each layer.
Definition: PATMOS.py:248
shesha.config.PATMOS.Param_atmos.__frac
__frac
Definition: PATMOS.py:66
shesha.config.PATMOS.Param_atmos.__windspeed
__windspeed
Definition: PATMOS.py:64