COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
PDMS.py
1 
37 
38 import numpy as np
39 import shesha.constants as scons
40 from . import config_setter_utils as csu
41 
42 
43 
46 class Param_dm:
47 
48  def __init__(self):
49 
50  # DM properties
51  self.__nact__nact = 0 # linear number of actuators across the pupil diameter
52  self.__alt__alt = 0.0 # DM conjugation altitude
53  self.__thresh__thresh = 0.0 # Threshold on response for selection
54  self.__keep_all_actu__keep_all_actu = False # if True, don't mask actu by pupil
55  self.__coupling__coupling = 0.2 # Actuator coupling (< .3)
56  self.__gain__gain = 1.0 # Actuator gains
57  self.__pupoffset__pupoffset = np.array([0, 0])
58  self.__dim_screen__dim_screen = 0 # Phase screen dimension
59  # Global offset in pupil (x,y) of the whole actuator pattern
60 
61  self.__unitpervolt__unitpervolt = 0.01
62  # Influence function sensitivity in unit/volt. Optional [0.01]
63  # Stackarray: mic/volt, Tip-tilt: arcsec/volt.
64  self.__push4imat__push4imat = 1. # nominal voltage for imat
65 
66  # Margins for actuator selection
67  self.__margin_out__margin_out = None # outer margin (pitches) from pupil diameter
68  # inner margin (pitches) from central obstruction
69  self.__margin_in__margin_in = 0.
70  self.__pzt_extent__pzt_extent = 5. # Extent of pzt DM (pitches)
71  self.__segmented_mirror__segmented_mirror = False # Crop influence functions where spiders are.
72 
73  # KL DM
74  self.__nfunc__nfunc = 0
75  self.__nkl__nkl = 0 # Number of KL for KL dm
76  self.__outscl__outscl = None # Outer scale in units of telescope diam for Karman KL
77  self.__nr__nr = None # number of radial points
78  self.__npp__npp = None # number of elements
79  self.__ord__ord = None # the radial orders of the basis
80  self.__rabas__rabas = None # the radial array of the basis
81  self.__azbas__azbas = None # the azimuthal array of the basis
82  self.__ncp__ncp = None # dim of grid
83  self.__cr__cr = None # radial coord in cartesien grid
84  self.__cp__cp = None # phi coord in cartesien grid
85  self.__ap__ap = None
86  self.__nfunc__nfunc = 0
87 
88  # Hidden variable safe-typed in shesha_constants
89  self.__type__type = None # Private storage of type
90  self.__type_pattern__type_pattern = None # Private storage of type_pattern
91  self.__influ_type__influ_type = scons.InfluType.DEFAULT # Private storage of influ_type
92  self.__type_kl__type_kl = scons.KLType.KOLMO # Private storage for KL type
93 
94  # HDF5 storage management
95  self.__file_influ_fits__file_influ_fits = None # Filename for influ hdf5 file
96  self.__center_name__center_name = None # Center name in hdf5
97  self.__cube_name__cube_name = None # Influence function cube name in hdf5
98  self.__x_name__x_name = None # x coord name in hdf5
99  self.__y_name__y_name = None # y coord name in hdf5
100  self.__influ_res__influ_res = None # influence resolution name in hdf5
101  self.__diam_dm__diam_dm = None # diam of the tel pupil projected on the dm plane
102  self.__diam_dm_proj__diam_dm_proj = None # diam of the dm pupil projected on the tel pupil plane
103 
104  # PXD cleanup
105  # internal kwrd
106  self.__pitch__pitch = None
107  """ inter-actuator space in pixels"""
108  self.__ntotact__ntotact = None
109  """ total number of actuators over the full area of the pupil"""
110  self.__influsize__influsize = None
111  """ influ function support size"""
112  self.__n1__n1 = None
113  """ position of leftmost pixel in largest support"""
114  self.__n2__n2 = None
115  """ position of rightmost pixel in largest support"""
116  self.__puppixoffset__puppixoffset = None
117  self.__influ__influ = None
118  """ influence functions"""
119  self.__xpos__xpos = None
120  """ x positions of influ functions"""
121  self.__ypos__ypos = None
122  """ y positions of influ functions"""
123  self.__i1__i1 = None
124  self.__j1__j1 = None
125  self.__influpos__influpos = None
126  self.__ninflu__ninflu = None
127  """ Influence functions"""
128  self.__influstart__influstart = None # np.ndarray - Influence function handling
129 
130  # Registration
131  self.__G__G = 1.0
132  """ Magnifying factor"""
133  self.__theta__theta = 0.0
134  """ WFS rotation angle in the pupil"""
135  self.__dx__dx = 0.0
136  """ X axis misalignment in meters"""
137  self.__dy__dy = 0.0
138  """ Y axis misalignment in meters"""
139 
140  def get_ap(self):
141  """ Get ap TODO!!!
142 
143  :return: (float) : TODO
144  """
145  return self.__ap__ap
146 
147  def set_ap(self, ap):
148  """ Set ap TODO!!!
149 
150  :param ap: (float) : TODO
151  """
152  self.__ap__ap = csu.enforce_arrayMultiDim(ap, (ap.shape[0], ap.shape[1]),
153  dtype=np.float32)
154 
155  ap = property(get_ap, set_ap)
156 
157  def get_nfunc(self):
158  """ Get nfunc TODO !!!
159 
160  :return: (int) : TODO
161  """
162  return self.__nfunc__nfunc
163 
164  def set_nfunc(self, nfunc):
165  """ Set nfunc TODO !!!
166 
167  :param nfunc: (int) : TODO
168  """
169  self.__nfunc__nfunc = csu.enforce_int(nfunc)
170 
171  nfunc = property(get_nfunc, set_nfunc)
172 
173  def get_pzt_extent(self):
174  """ Get extent of pzt dm in pich unit default = 5
175 
176  :return: (int) : extent pzt dm
177  """
178  return self.__pzt_extent__pzt_extent
179 
180  def set_pzt_extent(self, p):
181  """ Set extent of pzt dm in pich unit default = 5
182 
183  :param p: (int) : extent pzt dm
184  """
185  self.__pzt_extent__pzt_extent = csu.enforce_int(p)
186 
187  pzt_extent = property(get_pzt_extent, set_pzt_extent)
188 
190  return self.__segmented_mirror__segmented_mirror
191 
192  def set_segmented_mirror(self, b):
193  """ Define mirror influence functions to be cropped by the spiders
194  (more generally, pupil edges)
195 
196  :param p: (bool) : segment the mirror
197  """
198  self.__segmented_mirror__segmented_mirror = csu.enforce_or_cast_bool(b)
199 
200  segmented_mirror = property(get_segmented_mirror, set_segmented_mirror)
201 
202  def get_influ_type(self):
203  """ Get the influence function type for pzt DM
204 
205  :return: (str) : centroider type
206  """
207  return self.__influ_type__influ_type
208 
209  def set_influ_type(self, t):
210  """ Set the influence function type for pzt DM
211 
212  :param t: (str) : centroider type
213  """
214  self.__influ_type__influ_type = scons.check_enum(scons.InfluType, t)
215 
216  influ_type = property(get_influ_type, set_influ_type)
217 
218  def get_influpos(self):
219  """ Get the influence functions pixels that contributes to each DM pixel
220 
221  :return: (np.ndarray[ndim=1, drype=np.int32]) : influpos
222  """
223  return self.__influpos__influpos
224 
225  def set_influpos(self, ip):
226  """ Set the influence functions pixels that contributes to each DM pixel
227 
228  :param ip: (np.ndarray[ndim=1, drype=np.int32]) : influpos
229  """
230  self.__influpos__influpos = csu.enforce_array(ip, ip.size, dtype=np.int32)
231 
232  _influpos = property(get_influpos, set_influpos)
233 
234  def get_ninflu(self):
235  """ Get the number of influence functions pixels that contributes
236  to each DM pixel
237 
238  :return: (np.ndarray[ndim=1, drype=np.int32]) : ninflu
239  """
240  return self.__ninflu__ninflu
241 
242  def set_ninflu(self, n):
243  """ Set the number of influence functions pixels that contributes
244  to each DM pixel
245 
246  :param n: (np.ndarray[ndim=1, drype=np.int32]) : ninflu
247  """
248  self.__ninflu__ninflu = csu.enforce_array(n, n.size, dtype=np.int32)
249 
250  _ninflu = property(get_ninflu, set_ninflu)
251 
252  def get_influstart(self):
253  """ Get the index where to start a new DM pixel shape in the array influpos
254  to each DM pixel
255 
256  :return: (np.ndarray[ndim=1, drype=np.int32]) : influstart
257  """
258  return self.__influstart__influstart
259 
260  def set_influstart(self, n):
261  """ Set the index where to start a new DM pixel shape in the array influpos
262  to each DM pixel
263 
264  :param n: (np.ndarray[ndim=1, drype=np.int32]) : influstart
265  """
266  self.__influstart__influstart = csu.enforce_array(n, n.size, dtype=np.int32)
267 
268  _influstart = property(get_influstart, set_influstart)
269 
270  def get_gain(self):
271  """ Get the gain to apply to the actuators of the dm
272 
273  :return: (float) : gain
274  """
275  return self.__gain__gain
276 
277  def set_gain(self, g):
278  """ Set the gain to apply to the actuators of the dm
279 
280  :param g: (float) : gain
281  """
282  self.__gain__gain = csu.enforce_float(g)
283 
284  gain = property(get_gain, set_gain)
285 
286  def _get_dim_screen(self):
287  """ Get the phase screen dimension
288 
289  :return: (long) : phase screen dimension
290  """
291  return self.__dim_screen__dim_screen
292 
293  def _set_dim_screen(self, n):
294  """ Set the phase screen dimension
295 
296  :param n: (long) : phase screen dimension
297  """
298  self.__dim_screen__dim_screen = csu.enforce_int(n)
299 
300  _dim_screen = property(_get_dim_screen, _set_dim_screen)
301 
302  def get_nkl(self):
303  """ Get the number of KL modes used for computation of covmat in case of minimum variance controller
304 
305  :return: (long) : number of KL modes
306  """
307  return self.__nkl__nkl
308 
309  def set_nkl(self, n):
310  """ Set the number of KL modes used for computation of covmat in case of minimum variance controller
311 
312  :param n: (long) : number of KL modes
313  """
314  self.__nkl__nkl = csu.enforce_int(n)
315 
316  nkl = property(get_nkl, set_nkl)
317 
318  def get_type_kl(self):
319  """ Get the type of KL used for computation
320 
321  :return: (string) : KL types : kolmo or karman
322  """
323  return self.__type_kl__type_kl
324 
325  def set_type_kl(self, t):
326  """ Set the type of KL used for computation
327 
328  :param t: (string) : KL types : kolmo or karman
329  """
330  self.__type_kl__type_kl = scons.check_enum(scons.KLType, t)
331 
332  type_kl = property(get_type_kl, set_type_kl)
333 
334  def get_type(self):
335  """ Get the dm type
336 
337  :return: (str) : type of dm
338  """
339  return self.__type__type
340 
341  def set_type(self, t):
342  """ set the dm type
343 
344  :param t: (str) : type of dm
345  """
346  self.__type__type = scons.check_enum(scons.DmType, t)
347 
348  type = property(get_type, set_type)
349 
350  def get_type_pattern(self):
351  """ Get the pattern type
352 
353  :return: (str) : type of pattern
354  """
355  return self.__type_pattern__type_pattern
356 
357  def set_type_pattern(self, t):
358  """ set the pattern type
359 
360  :param t: (str) : type of pattern
361  """
362  self.__type_pattern__type_pattern = scons.check_enum(scons.PatternType, t)
363 
364  type_pattern = property(get_type_pattern, set_type_pattern)
365 
366  def get_file_influ_fits(self):
367  """ Get the name of hdf5 influence file
368 
369  :return: (str) : Hdf5 file influence name
370  """
371  return self.__file_influ_fits__file_influ_fits
372 
373  def set_file_influ_fits(self, f):
374  """ set the name of hdf5 influence file
375 
376  :param filename: (str) : Hdf5 file influence name
377  """
378  self.__file_influ_fits__file_influ_fits = f
379 
380  file_influ_fits = property(get_file_influ_fits, set_file_influ_fits)
381 
382  def get_center_name(self):
383  """ Get the name of hdf5 influence file
384 
385  :return: (str) : Hdf5 file influence name
386  """
387  return self.__center_name__center_name
388 
389  def set_center_name(self, f):
390  """ set the name of hdf5 influence file
391 
392  :param filename: (str) : Hdf5 file influence name
393  """
394  self.__center_name__center_name = f
395 
396  center_name = property(get_center_name, set_center_name)
397 
398  def get_cube_name(self):
399  """ Get the name of influence cube in hdf5
400 
401  :return: (str) : name of influence cube
402  """
403  return self.__cube_name__cube_name
404 
405  def set_cube_name(self, cubename):
406  """ set the name of influence cube in hdf5
407 
408  :param cubename: (str) : name of influence cube
409  """
410  self.__cube_name__cube_name = cubename
411 
412  cube_name = property(get_cube_name, set_cube_name)
413 
414  def get_x_name(self):
415  """ Get the name of x coord of influence fonction in file
416 
417  :return: (str) : name of x coord of influence
418  """
419  return self.__x_name__x_name
420 
421  def set_x_name(self, xname):
422  """ set the name of x coord of influence fonction in file
423 
424  :param t: (str) : name of x coord of influence
425  """
426  self.__x_name__x_name = xname
427 
428  x_name = property(get_x_name, set_x_name)
429 
430  def get_y_name(self):
431  """ Get the name of y coord of influence fonction in file
432 
433  :return: (str) : name of y coord of influence
434  """
435  return self.__y_name__y_name
436 
437  def set_y_name(self, yname):
438  """ set the name of y coord of influence fonction in file
439 
440  :param yname: (str) : name of y coord of influence
441  """
442  self.__y_name__y_name = yname
443 
444  y_name = property(get_y_name, set_y_name)
445 
446  def get_influ_res(self):
447  """ Get the name of influence fonction resolution in file
448 
449  :return: (str) : name of resoltion (meter/pixel) of influence
450  """
451  return self.__influ_res__influ_res
452 
453  def set_influ_res(self, res):
454  """ set the name of influence fonction resolution in file
455 
456  :param res: (str) : name of resoltion (meter/pixel) of influence
457  """
458  self.__influ_res__influ_res = res
459 
460  influ_res = property(get_influ_res, set_influ_res)
461 
462  def get_diam_dm(self):
463  """ Get the diameter of the tel pupil projected on the dm plane
464 
465  :return: (float) : diameter (meters) of the tel pupil projected on the dm plane
466  """
467  return self.__diam_dm__diam_dm
468 
469  def set_diam_dm(self, di):
470  """ Set the diameter of the tel pupil projected on the dm plane
471 
472  :param di: (float) : diameter (meters) of the tel pupil projected on the dm plane
473  """
474  self.__diam_dm__diam_dm = di
475 
476  diam_dm = property(get_diam_dm, set_diam_dm)
477 
478  def get_diam_dm_proj(self):
479  """ Get the diameter of the dm pupil projected on the tel pupil plane
480 
481  :return: (float) : diameter (meters) of the dm pupil projected on the tel pupil plane
482  """
483  return self.__diam_dm_proj__diam_dm_proj
484 
485  def set_diam_dm_proj(self, dp):
486  """ Set the diameter of the dm pupil projected on the tel pupil plane
487 
488  :param dp: (float) : diameter (meters) of the dm pupil projected on the tel pupil plane
489  """
490  self.__diam_dm_proj__diam_dm_proj = dp
491 
492  diam_dm_proj = property(get_diam_dm_proj, set_diam_dm_proj)
493 
494  def get_nact(self):
495  """ Get the number of actuator
496 
497  :return: (long) : number of actuators in the dm
498  """
499  return self.__nact__nact
500 
501  def set_nact(self, n):
502  """ set the number of actuator
503 
504  :param n: (long) : number of actuators in the dm
505  """
506  self.__nact__nact = csu.enforce_int(n)
507 
508  nact = property(get_nact, set_nact)
509 
510  def get_margin_out(self):
511  """ Get the margin for outside actuator select
512 
513  :return: (float) : unit is actuator pitch (+) for extra (-) for intra
514  """
515  return self.__margin_out__margin_out
516 
517  def set_margin_out(self, n):
518  """ set the margin for outside actuator select
519 
520  :param n: (float) : unit is actuator pitch (+) for extra (-) for intra
521  """
522  self.__margin_out__margin_out = csu.enforce_float(n)
523 
524  margin_out = property(get_margin_out, set_margin_out)
525 
526  def get_margin_in(self):
527  """ Get the margin for inside actuator select (central obstruction)
528 
529  :return: (float) : unit is actuator pitch (+) for extra (-) for intra
530  """
531  return self.__margin_in__margin_in
532 
533  def set_margin_in(self, n):
534  """ set the margin for inside actuator select (central obstruction)
535 
536  :param n: (float) : unit is actuator pitch (+) for extra (-) for intra
537  """
538  self.__margin_in__margin_in = csu.enforce_float(n)
539 
540  margin_in = property(get_margin_in, set_margin_in)
541 
542  def get_alt(self):
543  """ Get the conjugaison altitude
544 
545  :return: (float) : conjugaison altitude (im m)
546  """
547  return self.__alt__alt
548 
549  def set_alt(self, a):
550  """ set the conjugaison altitude
551 
552  :param a: (float) : conjugaison altitude (im m)
553  """
554  self.__alt__alt = csu.enforce_float(a)
555 
556  alt = property(get_alt, set_alt)
557 
558  def get_thresh(self):
559  """ Get the threshold on response for selection
560 
561  :return: (float) : threshold on response for selection (<1)
562  """
563  return self.__thresh__thresh
564 
565  def set_thresh(self, t):
566  """ set the threshold on response for selection
567 
568  :param t: (float) : threshold on response for selection (<1)
569  """
570  self.__thresh__thresh = csu.enforce_float(t)
571 
572  thresh = property(get_thresh, set_thresh)
573 
574  def get_keep_all_actu(self):
575  """ Get the flag for keeping all actuators
576 
577  :return: (bool) : keep all actuator flag (boolean)
578  """
579  return self.__keep_all_actu__keep_all_actu
580 
581  def set_keep_all_actu(self, k):
582  """ set the flag for keeping all actuators
583 
584  :param k: (f) : keep all actuator flag (boolean)
585  """
586  self.__keep_all_actu__keep_all_actu = csu.enforce_or_cast_bool(k)
587 
588  keep_all_actu = property(get_keep_all_actu, set_keep_all_actu)
589 
590  def get_coupling(self):
591  """ Get the actuators coupling
592 
593  :return: (float) : actuators coupling (<0.3)
594  """
595  return self.__coupling__coupling
596 
597  def set_coupling(self, c):
598  """ set the actuators coupling
599 
600  :param c: (float) : actuators coupling (<0.3)
601  """
602  self.__coupling__coupling = csu.enforce_float(c)
603 
604  coupling = property(get_coupling, set_coupling)
605 
606  def get_unitpervolt(self):
607  """ Get the Influence function sensitivity
608 
609  :return: (float) : Influence function sensitivity in unit/volt
610  """
611  return self.__unitpervolt__unitpervolt
612 
613  def set_unitpervolt(self, u):
614  """ set the Influence function sensitivity
615 
616  :param u: (float) : Influence function sensitivity in unit/volt
617  """
618  self.__unitpervolt__unitpervolt = csu.enforce_float(u)
619 
620  unitpervolt = property(get_unitpervolt, set_unitpervolt)
621 
622  def get_push4imat(self):
623  """ Get the nominal voltage for imat
624 
625  :return: (float) : nominal voltage for imat
626  """
627  return self.__push4imat__push4imat
628 
629  def set_push4imat(self, p):
630  """ set the nominal voltage for imat
631 
632  :param p: (float) : nominal voltage for imat
633  """
634  self.__push4imat__push4imat = csu.enforce_float(p)
635 
636  push4imat = property(get_push4imat, set_push4imat)
637 
638  def get_ntotact(self):
639  """ Get the total number of actuators
640 
641  :return: (long) : total number of actuators
642  """
643  return self.__ntotact__ntotact
644 
645  def set_ntotact(self, n):
646  """ set the total number of actuators
647 
648  :param n: (long) : total number of actuators
649  """
650  self.__ntotact__ntotact = csu.enforce_int(n)
651 
652  _ntotact = property(get_ntotact, set_ntotact)
653 
654  def get_pitch(self):
655  """ Get the actuators pitch [pixels]
656 
657  :return: (float) : actuators pitch [pixels]
658  """
659  return self.__pitch__pitch
660 
661  def set_pitch(self, p):
662  """ set the actuators pitch [pixels]
663 
664  :param p: (float) : actuators pitch [pixels]
665  """
666  self.__pitch__pitch = csu.enforce_float(p)
667 
668  _pitch = property(get_pitch, set_pitch)
669 
670  def get_influsize(self):
671  """ Get the actuators influsize [pixels]
672 
673  :return: (int) : actuators influsize [pixels]
674  """
675  return self.__influsize__influsize
676 
677  def set_influsize(self, s):
678  """ set the actuators influsize [pixels]
679 
680  :param s: (int) : actuators influsize [pixels]
681  """
682  self.__influsize__influsize = csu.enforce_int(s)
683 
684  _influsize = property(get_influsize, set_influsize)
685 
686  def get_n1(self):
687  """ Get the position of bottom left pixel in the largest support
688 
689  :return: (int) : actuators n1 [pixels]
690  """
691  return self.__n1__n1
692 
693  def set_n1(self, n):
694  """ set the position of bottom left pixel in the largest support
695 
696  :param n: (int) : actuators n1 [pixels]
697  """
698  self.__n1__n1 = csu.enforce_int(n)
699 
700  _n1 = property(get_n1, set_n1)
701 
702  def get_n2(self):
703  """ Get the position of bottom right pixel in the largest support
704 
705  :return: (int) : actuators n2 [pixels]
706  """
707  return self.__n2__n2
708 
709  def set_n2(self, n):
710  """ set the position of bottom right pixel in the largest support
711 
712  :param n: (int) : actuators n2 [pixels]
713  """
714  self.__n2__n2 = csu.enforce_int(n)
715 
716  _n2 = property(get_n2, set_n2)
717 
718  def get_xpos(self):
719  """ Get the x positions of influ functions (lower left corner)
720 
721  :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : x positions of influ functions
722  """
723  return self.__xpos__xpos
724 
725  def set_xpos(self, xpos):
726  """ Set the x positions of influ functions (lower left corner)
727 
728  :param xpos: (np.ndarray[ndim=1,dtype=np.float32_t]) : x positions of influ functions
729  """
730  self.__xpos__xpos = csu.enforce_array(xpos, self.__ntotact__ntotact, dtype=np.float32)
731 
732  _xpos = property(get_xpos, set_xpos)
733 
734  def get_ypos(self):
735  """ Get the y positions of influ functions (lower left corner)
736 
737  :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : y positions of influ functions
738  """
739  return self.__ypos__ypos
740 
741  def set_ypos(self, ypos):
742  """ Set the y positions of influ functions (lower left corner)
743 
744  :param ypos: (np.ndarray[ndim=1,dtype=np.float32_t]) : y positions of influ functions
745  """
746  self.__ypos__ypos = csu.enforce_array(ypos, self.__ntotact__ntotact, dtype=np.float32)
747 
748  _ypos = property(get_ypos, set_ypos)
749 
750  def get_i1(self):
751  """ Get the X-position of the bottom left corner of each influence function
752 
753  :return: (np.ndarray[ndim=1,dtype=np.int32_t]) :
754  """
755  return self.__i1__i1
756 
757  def set_i1(self, i1):
758  """ Set the X-position of the bottom left corner of each influence function
759 
760  :param i1: (np.ndarray[ndim=1,dtype=np.int32_t]) :
761  """
762  self.__i1__i1 = csu.enforce_array(i1, self.__ntotact__ntotact, dtype=np.int32)
763 
764  _i1 = property(get_i1, set_i1)
765 
766  def get_j1(self):
767  """ Get the Y-position of the bottom left corner of each influence function
768 
769  :return: (np.ndarray[ndim=1,dtype=np.int32_t]) :
770  """
771  return self.__j1__j1
772 
773  def set_j1(self, j1):
774  """ Set the Y-position of the bottom left corner of each influence function
775 
776  :param j1: (np.ndarray[ndim=1,dtype=np.int32_t]) :
777  """
778  self.__j1__j1 = csu.enforce_array(j1, self.__ntotact__ntotact, dtype=np.int32)
779 
780  _j1 = property(get_j1, set_j1)
781 
782  def get_influ(self):
783  """ Get the influence function
784 
785  :return: (np.ndarray[ndim=3,dtype=np.float32_t]) : influence function
786  """
787  return self.__influ__influ
788 
789  def set_influ(self, influ):
790  """ Set the influence function
791 
792  :param influ: (np.ndarray[ndim=3,dtype=np.float32_t]) : influence function
793  """
794  self.__influ__influ = csu.enforce_arrayMultiDim(influ,
795  (self.__influsize__influsize, self.__influsize__influsize,
796  self._ntotact_ntotact), dtype=np.float32)
797 
798  _influ = property(get_influ, set_influ)
799 
800  def get_pupoffset(self):
801  """ Get the pupil offset in meters
802 
803  :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : offsets [m]
804  """
805  return self.__pupoffset__pupoffset
806 
807  def set_pupoffset(self, off):
808  """ Set the pupil offset in meters
809 
810  :param off: (np.ndarray[ndim=1,dtype=np.float32_t]) : offsets [m]
811  """
812  self.__pupoffset__pupoffset = csu.enforce_array(off, 2, dtype=np.float32)
813 
814  pupoffset = property(get_pupoffset, set_pupoffset)
815 
816  def get_puppixoffset(self):
817  """ Get the pupil offset in pixels
818 
819  :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : offsets [pixels]
820  """
821  return self.__puppixoffset__puppixoffset
822 
823  def set_puppixoffset(self, off):
824  """ Set the pupil offset in pixels
825 
826  :param off: (np.ndarray[ndim=1,dtype=np.float32_t]) : offsets [pixels]
827  """
828  self.__puppixoffset__puppixoffset = csu.enforce_array(off, 2, dtype=np.float32)
829 
830  _puppixoffset = property(get_puppixoffset, set_puppixoffset)
831 
832  def get_outscl(self):
833  """ Get the outer scale for KL with Von Karman spectrum
834 
835  :return: (float) : outer scale [m]
836  """
837  return self.__outscl__outscl
838 
839  def set_outscl(self, L0):
840  """ Set the outer scale for KL with Von Karman spectrum
841 
842  :param L0: (float) : outer scale [m]
843  """
844  self.__outscl__outscl = csu.enforce_float(L0)
845 
846  outscl = property(get_outscl, set_outscl)
847 
848  def get_nr(self):
849  """ Get the number of radial points for KL
850 
851  :return: (int) : number of radial points
852  """
853  return self.__nr__nr
854 
855  def set_nr(self, n):
856  """ Set the number of radial points for KL
857 
858  :param n: (int) : number of radial points
859  """
860  self.__nr__nr = csu.enforce_int(n)
861 
862  _nr = property(get_nr, set_nr)
863 
864  def get_npp(self):
865  """ Get the number of elements (?) for KL
866 
867  :return: (int) : number of elements
868  """
869  return self.__npp__npp
870 
871  def set_npp(self, n):
872  """ Set the number of elements (?) for KL
873 
874  :param n: (int) : number of elements
875  """
876  self.__npp__npp = csu.enforce_int(n)
877 
878  _npp = property(get_npp, set_npp)
879 
880  def get_ncp(self):
881  """ Get the dimension of grid (?)
882 
883  :return: (int) : dimension
884  """
885  return self.__ncp__ncp
886 
887  def set_ncp(self, n):
888  """ Set the dimension of grid (?)
889 
890  :param n: (int) : dimension
891  """
892  self.__ncp__ncp = csu.enforce_int(n)
893 
894  _ncp = property(get_ncp, set_ncp)
895 
896  def get_ord(self):
897  """ Get the radial orders of the basis
898 
899  :return: (int) : radial order of the basis
900  """
901  return self.__ord__ord
902 
903  def set_ord(self, n):
904  """ Set the radial orders of the basis
905 
906  :param n: (int) : radial order of the basis
907  """
908  self.__ord__ord = csu.enforce_array(n, n.size, dtype=np.int32)
909 
910  _ord = property(get_ord, set_ord)
911 
912  def get_rabas(self):
913  """ Get the radial array of the KL basis
914 
915  :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : radial array
916  """
917  return self.__rabas__rabas
918 
919  def set_rabas(self, r):
920  """ Set the radial array of the KL basis
921 
922  :param r: (np.ndarray[ndim=1,dtype=np.float32_t]) : radial array
923  """
924  self.__rabas__rabas = csu.enforce_arrayMultiDim(r, r.shape, dtype=np.float32)
925 
926  _rabas = property(get_rabas, set_rabas)
927 
928  def get_azbas(self):
929  """ Get the azimuthal array of the KL basis
930 
931  :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : azimuthal array
932  """
933  return self.__azbas__azbas
934 
935  def set_azbas(self, r):
936  """ Set the azimuthal array of the KL basis
937 
938  :param r: (np.ndarray[ndim=1,dtype=np.float32_t]) : azimuthal array
939  """
940  self.__azbas__azbas = csu.enforce_arrayMultiDim(r, r.shape, dtype=np.float32)
941 
942  _azbas = property(get_azbas, set_azbas)
943 
944  def get_cr(self):
945  """ Get the radial coordinates in carthesian grid
946 
947  :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : radial coordinates in carthesian grid
948  """
949  return self.__cr__cr
950 
951  def set_cr(self, r):
952  """ Set the radial coordinates in carthesian grid
953 
954  :param r: (np.ndarray[ndim=1,dtype=np.float32_t]) : radial coordinates in carthesian grid
955  """
956  self.__cr__cr = csu.enforce_arrayMultiDim(r, r.shape, dtype=np.float32)
957 
958  _cr = property(get_cr, set_cr)
959 
960  def get_cp(self):
961  """ Get the phi coordinates in carthesian grid
962 
963  :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : phi coordinates in carthesian grid
964  """
965  return self.__cp__cp
966 
967  def set_cp(self, r):
968  """ Set the phi coordinates in carthesian grid
969 
970  :param r: (np.ndarray[ndim=1,dtype=np.float32_t]) : phi coordinates in carthesian grid
971  """
972  self.__cp__cp = csu.enforce_arrayMultiDim(r, r.shape, dtype=np.float32)
973 
974  _cp = property(get_cp, set_cp)
975 
976  def get_G(self):
977  """ Get the magnifying factor
978 
979  :return: (float) : magnifying factor
980  """
981  return self.__G__G
982 
983  def set_G(self, G):
984  """ Set the magnifying factor
985 
986  :param G: (float) : magnifying factor
987  """
988  self.__G__G = csu.enforce_float(G)
989 
990  G = property(get_G, set_G)
991 
992  def get_theta(self):
993  """ Get the rotation angle in the pupil
994 
995  :return: (float) : rotation angle (rad)
996  """
997  return self.__theta__theta
998 
999  def set_theta(self, theta):
1000  """ Set the rotation angle in the pupil
1001 
1002  :param theta: (float) : rotation angle (rad)
1003  """
1004  self.__theta__theta = csu.enforce_float(theta)
1005 
1006  theta = property(get_theta, set_theta)
1007 
1008  def get_dx(self):
1009  """ Get the X axis misalignment
1010 
1011  :return: (float) : dx (pix)
1012  """
1013  return self.__dx__dx
1014 
1015  def set_dx(self, dx):
1016  """ Set the X axis misalignment
1017 
1018  :param dx: (float) : dx (pix)
1019  """
1020  self.__dx__dx = csu.enforce_float(dx)
1021 
1022  dx = property(get_dx, set_dx)
1023 
1024  def get_dy(self):
1025  """ Get the Y axis misalignment
1026 
1027  :return: (float) : dy (pix)
1028  """
1029  return self.__dy__dy
1030 
1031  def set_dy(self, dy):
1032  """ Set the Y axis misalignment
1033 
1034  :param dy: (float) : dy (pix)
1035  """
1036  self.__dy__dy = csu.enforce_float(dy)
1037 
1038  dy = property(get_dy, set_dy)
P-Class (parametres) Param_dm.
Definition: PDMS.py:46
def get_nr(self)
Get the number of radial points for KL.
Definition: PDMS.py:901
def get_unitpervolt(self)
Get the Influence function sensitivity.
Definition: PDMS.py:626
def get_n2(self)
Get the position of bottom right pixel in the largest support.
Definition: PDMS.py:734
def set_cube_name(self, cubename)
set the name of influence cube in hdf5
Definition: PDMS.py:425
def set_cr(self, r)
Set the radial coordinates in carthesian grid.
Definition: PDMS.py:1022
def set_thresh(self, t)
set the threshold on response for selection
Definition: PDMS.py:585
def get_margin_out(self)
Get the margin for outside actuator select.
Definition: PDMS.py:530
def set_nfunc(self, nfunc)
Set nfunc TODO !!!
Definition: PDMS.py:168
def get_ypos(self)
Get the y positions of influ functions (lower left corner)
Definition: PDMS.py:772
def get_pzt_extent(self)
Get extent of pzt dm in pich unit default = 5.
Definition: PDMS.py:177
def get_nfunc(self)
Get nfunc TODO !!!
Definition: PDMS.py:161
def set_puppixoffset(self, off)
Set the pupil offset in pixels.
Definition: PDMS.py:873
def set_type_kl(self, t)
Set the type of KL used for computation.
Definition: PDMS.py:345
def get_y_name(self)
Get the name of y coord of influence fonction in file.
Definition: PDMS.py:450
def get_xpos(self)
Get the x positions of influ functions (lower left corner)
Definition: PDMS.py:753
def get_theta(self)
Get the rotation angle in the pupil.
Definition: PDMS.py:1069
def set_influsize(self, s)
set the actuators influsize [pixels]
Definition: PDMS.py:703
def set_ntotact(self, n)
set the total number of actuators
Definition: PDMS.py:665
def set_ypos(self, ypos)
Set the y positions of influ functions (lower left corner)
Definition: PDMS.py:779
def set_pitch(self, p)
set the actuators pitch [pixels]
Definition: PDMS.py:684
def get_influ_type(self)
Get the influence function type for pzt DM.
Definition: PDMS.py:206
def set_gain(self, g)
Set the gain to apply to the actuators of the dm.
Definition: PDMS.py:290
def set_margin_out(self, n)
set the margin for outside actuator select
Definition: PDMS.py:537
def get_diam_dm(self)
Get the diameter of the tel pupil projected on the dm plane.
Definition: PDMS.py:482
def set_alt(self, a)
set the conjugaison altitude
Definition: PDMS.py:569
def set_influstart(self, n)
Set the index where to start a new DM pixel shape in the array influpos to each DM pixel.
Definition: PDMS.py:271
def set_keep_all_actu(self, k)
set the flag for keeping all actuators
Definition: PDMS.py:601
def set_type(self, t)
set the dm type
Definition: PDMS.py:361
def get_dy(self)
Get the Y axis misalignment.
Definition: PDMS.py:1101
def get_n1(self)
Get the position of bottom left pixel in the largest support.
Definition: PDMS.py:715
def set_outscl(self, L0)
Set the outer scale for KL with Von Karman spectrum.
Definition: PDMS.py:892
def set_G(self, G)
Set the magnifying factor.
Definition: PDMS.py:1060
def set_nr(self, n)
Set the number of radial points for KL.
Definition: PDMS.py:908
def set_y_name(self, yname)
set the name of y coord of influence fonction in file
Definition: PDMS.py:457
def set_dx(self, dx)
Set the X axis misalignment.
Definition: PDMS.py:1092
def get_outscl(self)
Get the outer scale for KL with Von Karman spectrum.
Definition: PDMS.py:885
def get_cr(self)
Get the radial coordinates in carthesian grid.
Definition: PDMS.py:1015
def get_cube_name(self)
Get the name of influence cube in hdf5.
Definition: PDMS.py:418
def set_ap(self, ap)
Set ap TODO!!!
Definition: PDMS.py:151
def get_ap(self)
Get ap TODO!!!
Definition: PDMS.py:144
def set_pzt_extent(self, p)
Set extent of pzt dm in pich unit default = 5.
Definition: PDMS.py:184
def get_i1(self)
Get the X-position of the bottom left corner of each influence function.
Definition: PDMS.py:791
def get_influ(self)
Get the influence function.
Definition: PDMS.py:829
def get_pupoffset(self)
Get the pupil offset in meters.
Definition: PDMS.py:850
def set_ninflu(self, n)
Set the number of influence functions pixels that contributes to each DM pixel.
Definition: PDMS.py:250
def set_influpos(self, ip)
Set the influence functions pixels that contributes to each DM pixel.
Definition: PDMS.py:229
def get_influpos(self)
Get the influence functions pixels that contributes to each DM pixel.
Definition: PDMS.py:222
def get_j1(self)
Get the Y-position of the bottom left corner of each influence function.
Definition: PDMS.py:810
def set_coupling(self, c)
set the actuators coupling
Definition: PDMS.py:617
def get_nact(self)
Get the number of actuator.
Definition: PDMS.py:514
def get_file_influ_fits(self)
Get the name of hdf5 influence file.
Definition: PDMS.py:386
def set_i1(self, i1)
Set the X-position of the bottom left corner of each influence function.
Definition: PDMS.py:798
def get_nkl(self)
Get the number of KL modes used for computation of covmat in case of minimum variance controller.
Definition: PDMS.py:322
def set_cp(self, r)
Set the phi coordinates in carthesian grid.
Definition: PDMS.py:1041
def get_influstart(self)
Get the index where to start a new DM pixel shape in the array influpos to each DM pixel.
Definition: PDMS.py:263
def get_type_kl(self)
Get the type of KL used for computation.
Definition: PDMS.py:338
def get_ncp(self)
Get the dimension of grid (?)
Definition: PDMS.py:939
def get_cp(self)
Get the phi coordinates in carthesian grid.
Definition: PDMS.py:1034
def set_azbas(self, r)
Set the azimuthal array of the KL basis.
Definition: PDMS.py:1003
def get_keep_all_actu(self)
Get the flag for keeping all actuators.
Definition: PDMS.py:594
def get_pitch(self)
Get the actuators pitch [pixels].
Definition: PDMS.py:677
def get_influ_res(self)
Get the name of influence fonction resolution in file.
Definition: PDMS.py:466
def set_file_influ_fits(self, f)
set the name of hdf5 influence file
Definition: PDMS.py:393
def get_type_pattern(self)
Get the pattern type.
Definition: PDMS.py:370
def set_j1(self, j1)
Set the Y-position of the bottom left corner of each influence function.
Definition: PDMS.py:817
def set_diam_dm_proj(self, dp)
Set the diameter of the dm pupil projected on the tel pupil plane.
Definition: PDMS.py:505
def set_ord(self, n)
Set the radial orders of the basis.
Definition: PDMS.py:965
def get_center_name(self)
Get the name of hdf5 influence file.
Definition: PDMS.py:402
def set_diam_dm(self, di)
Set the diameter of the tel pupil projected on the dm plane.
Definition: PDMS.py:489
def get_influsize(self)
Get the actuators influsize [pixels].
Definition: PDMS.py:696
def set_pupoffset(self, off)
Set the pupil offset in meters.
Definition: PDMS.py:857
def get_dx(self)
Get the X axis misalignment.
Definition: PDMS.py:1085
def get_G(self)
Get the magnifying factor.
Definition: PDMS.py:1053
def get_coupling(self)
Get the actuators coupling.
Definition: PDMS.py:610
def set_influ(self, influ)
Set the influence function.
Definition: PDMS.py:836
def set_n2(self, n)
set the position of bottom right pixel in the largest support
Definition: PDMS.py:741
def get_thresh(self)
Get the threshold on response for selection.
Definition: PDMS.py:578
def set_dy(self, dy)
Set the Y axis misalignment.
Definition: PDMS.py:1108
def get_margin_in(self)
Get the margin for inside actuator select (central obstruction)
Definition: PDMS.py:546
def set_center_name(self, f)
set the name of hdf5 influence file
Definition: PDMS.py:409
def get_push4imat(self)
Get the nominal voltage for imat.
Definition: PDMS.py:642
def get_puppixoffset(self)
Get the pupil offset in pixels.
Definition: PDMS.py:866
def get_ninflu(self)
Get the number of influence functions pixels that contributes to each DM pixel.
Definition: PDMS.py:242
def set_unitpervolt(self, u)
set the Influence function sensitivity
Definition: PDMS.py:633
def set_npp(self, n)
Set the number of elements (?) for KL.
Definition: PDMS.py:927
def set_theta(self, theta)
Set the rotation angle in the pupil.
Definition: PDMS.py:1076
def get_gain(self)
Get the gain to apply to the actuators of the dm.
Definition: PDMS.py:283
def get_diam_dm_proj(self)
Get the diameter of the dm pupil projected on the tel pupil plane.
Definition: PDMS.py:498
def get_ord(self)
Get the radial orders of the basis.
Definition: PDMS.py:958
def set_type_pattern(self, t)
set the pattern type
Definition: PDMS.py:377
def set_influ_type(self, t)
Set the influence function type for pzt DM.
Definition: PDMS.py:213
def set_push4imat(self, p)
set the nominal voltage for imat
Definition: PDMS.py:649
def set_rabas(self, r)
Set the radial array of the KL basis.
Definition: PDMS.py:984
def set_n1(self, n)
set the position of bottom left pixel in the largest support
Definition: PDMS.py:722
def set_influ_res(self, res)
set the name of influence fonction resolution in file
Definition: PDMS.py:473
def get_segmented_mirror(self)
Definition: PDMS.py:189
def get_azbas(self)
Get the azimuthal array of the KL basis.
Definition: PDMS.py:996
def set_nact(self, n)
set the number of actuator
Definition: PDMS.py:521
def get_npp(self)
Get the number of elements (?) for KL.
Definition: PDMS.py:920
def get_x_name(self)
Get the name of x coord of influence fonction in file.
Definition: PDMS.py:434
def get_type(self)
Get the dm type.
Definition: PDMS.py:354
def set_ncp(self, n)
Set the dimension of grid (?)
Definition: PDMS.py:946
def get_ntotact(self)
Get the total number of actuators.
Definition: PDMS.py:658
def get_rabas(self)
Get the radial array of the KL basis.
Definition: PDMS.py:977
def set_nkl(self, n)
Set the number of KL modes used for computation of covmat in case of minimum variance controller.
Definition: PDMS.py:329
def set_x_name(self, xname)
set the name of x coord of influence fonction in file
Definition: PDMS.py:441
def get_alt(self)
Get the conjugaison altitude.
Definition: PDMS.py:562
def set_segmented_mirror(self, b)
Define mirror influence functions to be cropped by the spiders (more generally, pupil edges)
Definition: PDMS.py:197
def set_xpos(self, xpos)
Set the x positions of influ functions (lower left corner)
Definition: PDMS.py:760
def set_margin_in(self, n)
set the margin for inside actuator select (central obstruction)
Definition: PDMS.py:553
Numerical constants for shesha and config enumerations for safe-typing.
Definition: constants.py:1