COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
sutraWrap.py
1 
37 """Binding module for libsutra"""
38 from __future__ import annotations
39 import sutraWrap
40 import typing
41 import carmaWrap
42 import numpy
43 _Shape = typing.Tuple[int, ...]
44 
45 __all__ = [
46  "Atmos",
47  "CentroiderBPCOG_FF",
48  "CentroiderBPCOG_UF",
49  "CentroiderCORR_FF",
50  "CentroiderCORR_UF",
51  "CentroiderMASKEDPIX_FF",
52  "CentroiderMASKEDPIX_UF",
53  "CentroiderPYR_FF",
54  "CentroiderPYR_UF",
55  "CentroiderTCOG_FF",
56  "CentroiderTCOG_UF",
57  "CentroiderWCOG_FF",
58  "CentroiderWCOG_UF",
59  "Centroider_FF",
60  "Centroider_UF",
61  "ControllerCURED_FF",
62  "ControllerCURED_FU",
63  "ControllerGENERICLINEAR_FF",
64  "ControllerGENERICLINEAR_FU",
65  "ControllerGENERIC_FF",
66  "ControllerGENERIC_FU",
67  "ControllerGEO_FF",
68  "ControllerGEO_FU",
69  "ControllerLS_FF",
70  "ControllerLS_FU",
71  "ControllerMV_FF",
72  "ControllerMV_FU",
73  "Controller_FF",
74  "Controller_FU",
75  "Coronagraph",
76  "Dm",
77  "Dms",
78  "Gamora",
79  "Groot",
80  "LGS",
81  "PYRWFS",
82  "PerfectCoronagraph",
83  "Rtc_FFF",
84  "Rtc_FFU",
85  "Rtc_UFF",
86  "Rtc_UFU",
87  "SHWFS",
88  "Sensors",
89  "Source",
90  "StellarCoronagraph",
91  "Target",
92  "Telescope",
93  "Tscreen",
94  "Wfs"
95 ]
96 
97 
98 class Atmos():
99  def __init__(self, context: carmaWrap.context, nscreens: int, global_r0: float, r0_per_layer: numpy.ndarray[numpy.float32], size1: numpy.ndarray[numpy.int64], size2: numpy.ndarray[numpy.int64], altitude: numpy.ndarray[numpy.float32], windspeed: numpy.ndarray[numpy.float32], winddir: numpy.ndarray[numpy.float32], deltax: numpy.ndarray[numpy.float32], deltay: numpy.ndarray[numpy.float32], device: int) -> None:
100  """
101  Create and initialise an atmos object
102 
103  Attributes:
104  context: (CarmaContext) : current carma context
105 
106  nscreens: (float) : number of turbulent layers
107 
108  global_r0: (float): global r0
109 
110  r0_per_layer: (float) : r0 per layer
111 
112  size1: (np.ndarray[ndim=1, dtype=np.int64_t]) : First size of screens
113 
114  size2: (np.ndarray[ndim=1, dtype=np.int64_t]) : Second size of screens
115 
116  altitude: (np.ndarray[ndim=1,dtype=np.float32_t]) : altitudes [m]
117 
118  windspeed: (np.ndarray[ndim=1,dtype=np.float32_t]) : wind speed [m/s]
119 
120  winddir: (np.ndarray[ndim=1,dtype=np.float32_t]) : wind direction [deg]
121 
122  deltax: (np.ndarray[ndim=1,dtype=np.float32_t]) : extrude deltax pixels in the x-direction at each iteration
123 
124  deltay: (np.ndarray[ndim=1,dtype=np.float32_t]) : extrude deltay pixels in the y-direction at each iteration
125 
126  device: (int): GPU device index
127 
128  """
129  def __str__(self) -> str: ...
130  def add_screen(self, altitude: float, size: int, stencil_size: int, r0: float, windspeed: float, winddir: float, deltax: float, deltay: float, device: int) -> int:
131  """
132  Add a screen to the atmos object.
133 
134  Args:
135  altitude: (float) : altitude of the screen in meters
136 
137  size: (long) : dimension of the screen (size x size)
138 
139  stencil_size: (long): dimension of the stencil
140 
141  r0: (float) : frac of r0**(5/3)
142 
143  windspeed: (float) : windspeed of the screen [m/s]
144 
145  winddir: (float) : wind direction (deg)
146 
147  deltax: (float) : extrude deltax pixels in the x-direction at each iteration
148 
149  deltay: (float) : extrude deltay pixels in the y-direction at each iteration
150 
151  device: (int) : device number
152 
153  """
154  def del_screen(self, idx: int) -> int:
155  """
156  Delete the selected screen
157 
158  Args:
159  idx: (int): index of the screen
160 
161  """
162  def init_screen(self, idx: int, A: numpy.ndarray[numpy.float32], B: numpy.ndarray[numpy.float32], istencilx: numpy.ndarray[numpy.uint32], istencily: numpy.ndarray[numpy.uint32], seed: int) -> int:
163  """
164  Initialize an newly allocated screen
165 
166  Args:
167  idx: (int): index of the screen
168 
169  A: (np.ndarray[ndim=2, dtype=np.float32]): A matrix (cf. Assemat)
170 
171  B: (np.ndarray[ndim=2, dtype=np.float32]): B matrix (cf. Assemat)
172 
173  istencilx: (np.ndarray[ndim=2, dtype=int32]): X stencil index
174 
175  istencily: (np.ndarray[ndim=2, dtype=int32]): Y stencil index
176 
177  seed: (int): seed for RNG
178 
179  """
180  def move_atmos(self) -> int:
181  """
182  Move the turbulence in the atmos screen following loaded
183  parameters such as windspeed and wind direction
184  """
185  def refresh_screen(self, idx: int) -> int:
186  """
187  Refresh the selected screen by extrusion
188 
189  Args:
190  idx: (int): index of the screen
191 
192  """
193  def set_r0(self, r0: float) -> int:
194  """
195  Change the current global r0 of all layers
196 
197  Args:
198  r0: (float): r0 @ 0.5 microns
199 
200  """
201  def set_seed(self, idx: int, seed: float) -> int:
202  """
203  Set the seed of the selected screen RNG
204 
205  Args:
206  idx: (int): index of the screen
207 
208  seed: (int) :new seed
209 
210  """
211  @property
212  def d_screens(self) -> typing.List[Tscreen]:
213  """
214  Vector of tscreens
215 
216  :type: typing.List[Tscreen]
217  """
218  @property
219  def nscreens(self) -> int:
220  """
221  Number of turbulent screens
222 
223  :type: int
224  """
225  @property
226  def r0(self) -> float:
227  """
228  Global r0
229 
230  :type: float
231  """
232  pass
233 class Centroider_FF():
234  def calibrate_img(self) -> int:
235  """
236  Performs the raw WFS frame calibration
237  """
238  def calibrate_img_validPix(self) -> int:
239  """
240  Performs the raw WFS frame calibration only on useful pixels
241  """
242  def get_cog(self) -> int:
243  """
244  Computes centroids and stores it in d_slopes of the WFS
245  """
246  def init_calib(self, n: int, m: int) -> int:
247  """
248  Initialize data used for calibration
249 
250  Args:
251  n: (int): image support height
252 
253  m: (int): image support width
254  """
255  def init_img_raw(self, n: int, m: int) -> int:
256  """
257  Initialize array to store raw WFS image in RTC standalone mode
258 
259  Args:
260  n: (int): image support height
261 
262  m: (int): image support width
263  """
264  @typing.overload
265  def load_img(self, img: numpy.ndarray[numpy.float32], m: int, n: int, location: int) -> int:
266  """
267  Load an image in a RTC standalone (host to device)
268 
269  Args:
270  img: (np.ndarray[ndim=2, dtype=np.float32_t]): SH image
271 
272  m: (int): Image support size X
273 
274  n: (int): Image support size Y
275 
276  location: (int): If -1, image is located on the CPU (hostToDevice). Else, it is the GPU index where the image is located
277 
278 
279 
280  Load a square image (n, n) in a RTC standalone
281 
282  Args:
283  img: (np.ndarray[ndim=2, dtype=np.float32_t]): SH image
284 
285  n: (int): Image support size along one axis
286 
287  Kwargs:
288  location: (int): (optionnal) If -1 (default), image is located on the CPU (hostToDevice). Else, it is the GPU index where the image is located
289 
290 
291 
292  Load an image in a RTC standalone from a CarmaObj
293 
294  Args:
295  img: (CarmaObj): SH image
296  """
297  @typing.overload
298  def load_img(self, img: numpy.ndarray[numpy.float32], n: int, location: int = -1) -> int: ...
299  @typing.overload
300  def load_img(self, img: carmaWrap.obj_float) -> int: ...
301  def load_validpos(self, validx: numpy.ndarray[numpy.int32], validy: numpy.ndarray[numpy.int32], N: int) -> int:
302  """
303  Load the validx and validy arrays
304 
305  Args:
306  validx: (np.array[ndim=1,dtype=np.float32]): X positions of the valid ssp
307 
308  validy: (np.array[ndim=1,dtype=np.float32]): Y positions of the valid ssp
309 
310  N: (int): arrays size
311  """
312  def set_centroids_ref(self, refslopes: numpy.ndarray[numpy.float32]) -> int:
313  """
314  Set the references slopes
315 
316  Args:
317  refslopes: (np.array[ndim1,dtype=np.float32]): reference slopes to set
318  """
319  def set_dark(self, dark: numpy.ndarray[numpy.float32], n: int) -> int:
320  """
321  Set the dark frame for calibration
322 
323  Args:
324  dark: (np.ndarray[ndim=2, dtype=np.float32_t): dark frame (size n by n)
325 
326  n: (int): image support size
327  """
328  def set_flat(self, flat: numpy.ndarray[numpy.float32], n: int) -> int:
329  """
330  Set the flat frame for calibration
331 
332  Args:
333  flat: (np.ndarray[ndim=2, dtype=np.float32_t): flat frame (size n by n)
334 
335  n: (int): image support size
336  """
337  def set_lutPix(self, lutPix: numpy.ndarray[numpy.int32], n: int) -> int:
338  """
339  Set the lookup Table Pixel vector for calibration
340 
341  Args:
342  lutPix: (np.ndarray[ndim=1, dtype=np.float32_t): lutPix vector
343 
344  n: (int): image pixel size
345  """
346  def set_npix(self, npix: int) -> int:
347  """
348  Set the number of pixels per subap for a RTC standalone
349 
350  Args:
351  npix: (int): number of pixel along a subap. side
352  """
353  def set_nxsub(self, nxsub: int) -> int:
354  """
355  Set the number of ssp across the pupil diameter for a RTC standalone
356 
357  Args:
358  nxsub: (int): number of ssp across the pupil diameter
359  """
360  def set_offset(self, offset: float) -> int:
361  """
362  Set the controider offset [pixels]
363 
364  Args:
365  offset: (float): new offset [pixels]
366  """
367  def set_scale(self, scale: float) -> int:
368  """
369  Set the controider scale factor
370 
371  Args:
372  scale: (float): new scale factor
373  """
374  @property
375  def context(self) -> carmaWrap.context:
376  """
377  GPU context
378 
379  :type: carmaWrap.context
380  """
381  @property
382  def d_TT_slopes(self) -> carmaWrap.obj_float:
383  """
384  Tip/tilt slopes removed after filtering
385 
386  :type: carmaWrap.obj_float
387  """
388  @property
389  def d_bincube(self) -> carmaWrap.obj_float:
390  """
391  Bincube of the WFS image
392 
393  :type: carmaWrap.obj_float
394  """
395  @property
396  def d_centroids_ref(self) -> carmaWrap.obj_float:
397  """
398  Reference slopes vector
399 
400  :type: carmaWrap.obj_float
401  """
402  @property
403  def d_dark(self) -> carmaWrap.obj_float:
404  """
405  Dark frame for calibration
406 
407  :type: carmaWrap.obj_float
408  """
409  @property
410  def d_flat(self) -> carmaWrap.obj_float:
411  """
412  Flat frame for calibration
413 
414  :type: carmaWrap.obj_float
415  """
416  @property
417  def d_img(self) -> carmaWrap.obj_float:
418  """
419  Calibrated WFS image
420 
421  :type: carmaWrap.obj_float
422  """
423  @property
424  def d_img_raw(self) -> carmaWrap.obj_float:
425  """
426  Raw WFS image
427 
428  :type: carmaWrap.obj_float
429  """
430  @property
431  def d_intensities(self) -> carmaWrap.obj_float:
432  """
433  intensities of the WFS image
434 
435  :type: carmaWrap.obj_float
436  """
437  @property
438  def d_lutPix(self) -> carmaWrap.obj_int:
439  """
440  Lookup Table of pixels for calibration
441 
442  :type: carmaWrap.obj_int
443  """
444  @property
445  def d_ref_Tilt(self) -> carmaWrap.obj_float:
446  """
447  Tilt mode reference for filtering
448 
449  :type: carmaWrap.obj_float
450  """
451  @property
452  def d_ref_Tip(self) -> carmaWrap.obj_float:
453  """
454  Tip mode reference for filtering
455 
456  :type: carmaWrap.obj_float
457  """
458  @property
459  def d_validMask(self) -> carmaWrap.obj_int:
460  """
461  Flat frame for calibration
462 
463  :type: carmaWrap.obj_int
464  """
465  @property
466  def d_validx(self) -> carmaWrap.obj_int:
467  """
468  X positions of the valid ssp
469 
470  :type: carmaWrap.obj_int
471  """
472  @property
473  def d_validy(self) -> carmaWrap.obj_int:
474  """
475  Y positions of the valid ssp
476 
477  :type: carmaWrap.obj_int
478  """
479  @property
480  def device(self) -> int:
481  """
482  GPU device index
483 
484  :type: int
485  """
486  @property
487  def filter_TT(self) -> bool:
488  """
489  Tip/tilt filtering flag
490 
491  :type: bool
492  """
493  @property
494  def npix(self) -> int:
495  """
496  Number of pixels along a side of WFS subap.
497 
498  :type: int
499  """
500  @property
501  def nslopes(self) -> int:
502  """
503  Number of slopes
504 
505  :type: int
506  """
507  @property
508  def nvalid(self) -> int:
509  """
510  Number of valid ssp of the WFS
511 
512  :type: int
513  """
514  @property
515  def nxsub(self) -> int:
516  """
517  Number of ssp across the pupil diameter
518 
519  :type: int
520  """
521  @property
522  def offset(self) -> float:
523  """
524  Offset for centroiding computation
525 
526  :type: float
527  """
528  @property
529  def scale(self) -> float:
530  """
531  Scale factor to get slopes in arcsec
532 
533  :type: float
534  """
535  @property
536  def type(self) -> str:
537  """
538  Centroider type
539 
540  :type: str
541  """
542  @property
543  def wfs(self) -> Wfs:
544  """
545  SutraWfs handled by this centroider
546 
547  :type: Wfs
548  """
549  pass
550 class Centroider_UF():
551  def calibrate_img(self) -> int:
552  """
553  Performs the raw WFS frame calibration
554  """
555  def calibrate_img_validPix(self) -> int:
556  """
557  Performs the raw WFS frame calibration only on useful pixels
558  """
559  def get_cog(self) -> int:
560  """
561  Computes centroids and stores it in d_slopes of the WFS
562  """
563  def init_calib(self, n: int, m: int) -> int:
564  """
565  Initialize data used for calibration
566 
567  Args:
568  n: (int): image support height
569 
570  m: (int): image support width
571  """
572  def init_img_raw(self, n: int, m: int) -> int:
573  """
574  Initialize array to store raw WFS image in RTC standalone mode
575 
576  Args:
577  n: (int): image support height
578 
579  m: (int): image support width
580  """
581  @typing.overload
582  def load_img(self, img: numpy.ndarray[numpy.uint16], m: int, n: int, location: int) -> int:
583  """
584  Load an image in a RTC standalone (host to device)
585 
586  Args:
587  img: (np.ndarray[ndim=2, dtype=np.float32_t]): SH image
588 
589  m: (int): Image support size X
590 
591  n: (int): Image support size Y
592 
593  location: (int): If -1, image is located on the CPU (hostToDevice). Else, it is the GPU index where the image is located
594 
595 
596 
597  Load a square image (n, n) in a RTC standalone
598 
599  Args:
600  img: (np.ndarray[ndim=2, dtype=np.float32_t]): SH image
601 
602  n: (int): Image support size along one axis
603 
604  Kwargs:
605  location: (int): (optionnal) If -1 (default), image is located on the CPU (hostToDevice). Else, it is the GPU index where the image is located
606 
607 
608 
609  Load an image in a RTC standalone from a CarmaObj
610 
611  Args:
612  img: (CarmaObj): SH image
613  """
614  @typing.overload
615  def load_img(self, img: numpy.ndarray[numpy.uint16], n: int, location: int = -1) -> int: ...
616  @typing.overload
617  def load_img(self, img: carmaWrap.obj_uint16) -> int: ...
618  def load_validpos(self, validx: numpy.ndarray[numpy.int32], validy: numpy.ndarray[numpy.int32], N: int) -> int:
619  """
620  Load the validx and validy arrays
621 
622  Args:
623  validx: (np.array[ndim=1,dtype=np.float32]): X positions of the valid ssp
624 
625  validy: (np.array[ndim=1,dtype=np.float32]): Y positions of the valid ssp
626 
627  N: (int): arrays size
628  """
629  def set_centroids_ref(self, refslopes: numpy.ndarray[numpy.float32]) -> int:
630  """
631  Set the references slopes
632 
633  Args:
634  refslopes: (np.array[ndim1,dtype=np.float32]): reference slopes to set
635  """
636  def set_dark(self, dark: numpy.ndarray[numpy.float32], n: int) -> int:
637  """
638  Set the dark frame for calibration
639 
640  Args:
641  dark: (np.ndarray[ndim=2, dtype=np.float32_t): dark frame (size n by n)
642 
643  n: (int): image support size
644  """
645  def set_flat(self, flat: numpy.ndarray[numpy.float32], n: int) -> int:
646  """
647  Set the flat frame for calibration
648 
649  Args:
650  flat: (np.ndarray[ndim=2, dtype=np.float32_t): flat frame (size n by n)
651 
652  n: (int): image support size
653  """
654  def set_lutPix(self, lutPix: numpy.ndarray[numpy.int32], n: int) -> int:
655  """
656  Set the lookup Table Pixel vector for calibration
657 
658  Args:
659  lutPix: (np.ndarray[ndim=1, dtype=np.float32_t): lutPix vector
660 
661  n: (int): image pixel size
662  """
663  def set_npix(self, npix: int) -> int:
664  """
665  Set the number of pixels per subap for a RTC standalone
666 
667  Args:
668  npix: (int): number of pixel along a subap. side
669  """
670  def set_nxsub(self, nxsub: int) -> int:
671  """
672  Set the number of ssp across the pupil diameter for a RTC standalone
673 
674  Args:
675  nxsub: (int): number of ssp across the pupil diameter
676  """
677  def set_offset(self, offset: float) -> int:
678  """
679  Set the controider offset [pixels]
680 
681  Args:
682  offset: (float): new offset [pixels]
683  """
684  def set_scale(self, scale: float) -> int:
685  """
686  Set the controider scale factor
687 
688  Args:
689  scale: (float): new scale factor
690  """
691  @property
692  def context(self) -> carmaWrap.context:
693  """
694  GPU context
695 
696  :type: carmaWrap.context
697  """
698  @property
699  def d_TT_slopes(self) -> carmaWrap.obj_float:
700  """
701  Tip/tilt slopes removed after filtering
702 
703  :type: carmaWrap.obj_float
704  """
705  @property
706  def d_bincube(self) -> carmaWrap.obj_float:
707  """
708  Bincube of the WFS image
709 
710  :type: carmaWrap.obj_float
711  """
712  @property
713  def d_centroids_ref(self) -> carmaWrap.obj_float:
714  """
715  Reference slopes vector
716 
717  :type: carmaWrap.obj_float
718  """
719  @property
720  def d_dark(self) -> carmaWrap.obj_float:
721  """
722  Dark frame for calibration
723 
724  :type: carmaWrap.obj_float
725  """
726  @property
727  def d_flat(self) -> carmaWrap.obj_float:
728  """
729  Flat frame for calibration
730 
731  :type: carmaWrap.obj_float
732  """
733  @property
734  def d_img(self) -> carmaWrap.obj_float:
735  """
736  Calibrated WFS image
737 
738  :type: carmaWrap.obj_float
739  """
740  @property
741  def d_img_raw(self) -> carmaWrap.obj_uint16:
742  """
743  Raw WFS image
744 
745  :type: carmaWrap.obj_uint16
746  """
747  @property
748  def d_intensities(self) -> carmaWrap.obj_float:
749  """
750  intensities of the WFS image
751 
752  :type: carmaWrap.obj_float
753  """
754  @property
755  def d_lutPix(self) -> carmaWrap.obj_int:
756  """
757  Lookup Table of pixels for calibration
758 
759  :type: carmaWrap.obj_int
760  """
761  @property
762  def d_ref_Tilt(self) -> carmaWrap.obj_float:
763  """
764  Tilt mode reference for filtering
765 
766  :type: carmaWrap.obj_float
767  """
768  @property
769  def d_ref_Tip(self) -> carmaWrap.obj_float:
770  """
771  Tip mode reference for filtering
772 
773  :type: carmaWrap.obj_float
774  """
775  @property
776  def d_validMask(self) -> carmaWrap.obj_int:
777  """
778  Flat frame for calibration
779 
780  :type: carmaWrap.obj_int
781  """
782  @property
783  def d_validx(self) -> carmaWrap.obj_int:
784  """
785  X positions of the valid ssp
786 
787  :type: carmaWrap.obj_int
788  """
789  @property
790  def d_validy(self) -> carmaWrap.obj_int:
791  """
792  Y positions of the valid ssp
793 
794  :type: carmaWrap.obj_int
795  """
796  @property
797  def device(self) -> int:
798  """
799  GPU device index
800 
801  :type: int
802  """
803  @property
804  def filter_TT(self) -> bool:
805  """
806  Tip/tilt filtering flag
807 
808  :type: bool
809  """
810  @property
811  def npix(self) -> int:
812  """
813  Number of pixels along a side of WFS subap.
814 
815  :type: int
816  """
817  @property
818  def nslopes(self) -> int:
819  """
820  Number of slopes
821 
822  :type: int
823  """
824  @property
825  def nvalid(self) -> int:
826  """
827  Number of valid ssp of the WFS
828 
829  :type: int
830  """
831  @property
832  def nxsub(self) -> int:
833  """
834  Number of ssp across the pupil diameter
835 
836  :type: int
837  """
838  @property
839  def offset(self) -> float:
840  """
841  Offset for centroiding computation
842 
843  :type: float
844  """
845  @property
846  def scale(self) -> float:
847  """
848  Scale factor to get slopes in arcsec
849 
850  :type: float
851  """
852  @property
853  def type(self) -> str:
854  """
855  Centroider type
856 
857  :type: str
858  """
859  @property
860  def wfs(self) -> Wfs:
861  """
862  SutraWfs handled by this centroider
863 
864  :type: Wfs
865  """
866  pass
868  def init_corr(self, isizex: int, isizey: int, interpmat: numpy.ndarray[numpy.float32]) -> int:
869  """
870  Initializes corr computation
871 
872  Args:
873  isizex: (int): TODO: docstring
874 
875  isizey: (int):
876 
877  interpmat: (np.array[ndim=,dtype=np.float32]):
878 
879  """
880  def load_corr(self, corr: numpy.ndarray[numpy.float32], corr_norm: numpy.ndarray[numpy.float32], ndim: int) -> int:
881  """
882  Load arrays for correlation computation
883 
884  Args:
885  corr: (np.array[ndim=,dtype=np.float32): TODO: docstring
886 
887  corr_norm: (np.array[ndim=,dtype=np.float32):
888 
889  ndim: (int):
890 
891  """
892  @property
893  def d_corr(self) -> carmaWrap.obj_float:
894  """
895  TODO: docstring
896 
897  :type: carmaWrap.obj_float
898  """
899  @property
900  def d_corrfnct(self) -> carmaWrap.obj_float_complex:
901  """
902  TODO: docstring
903 
904  :type: carmaWrap.obj_float_complex
905  """
906  @property
907  def d_corrmax(self) -> carmaWrap.obj_int:
908  """
909  TODO: docstring
910 
911  :type: carmaWrap.obj_int
912  """
913  @property
914  def d_corrnorm(self) -> carmaWrap.obj_float:
915  """
916  TODO: docstring
917 
918  :type: carmaWrap.obj_float
919  """
920  @property
921  def d_corrspot(self) -> carmaWrap.obj_float_complex:
922  """
923  TODO: docstring
924 
925  :type: carmaWrap.obj_float_complex
926  """
927  @property
928  def d_interpmat(self) -> carmaWrap.obj_float:
929  """
930  TODO: docstring
931 
932  :type: carmaWrap.obj_float
933  """
934  @property
935  def interp_sizex(self) -> int:
936  """
937  TODO: docstring
938 
939  :type: int
940  """
941  @property
942  def interp_sizey(self) -> int:
943  """
944  TODO: docstring
945 
946  :type: int
947  """
948  @property
949  def npix(self) -> int:
950  """
951  TODO: docstring
952 
953  :type: int
954  """
955  pass
956 class CentroiderCORR_UF(Centroider_UF):
957  def init_corr(self, isizex: int, isizey: int, interpmat: numpy.ndarray[numpy.float32]) -> int:
958  """
959  Initializes corr computation
960 
961  Args:
962  isizex: (int): TODO: docstring
963 
964  isizey: (int):
965 
966  interpmat: (np.array[ndim=,dtype=np.float32]):
967 
968  """
969  def load_corr(self, corr: numpy.ndarray[numpy.float32], corr_norm: numpy.ndarray[numpy.float32], ndim: int) -> int:
970  """
971  Load arrays for correlation computation
972 
973  Args:
974  corr: (np.array[ndim=,dtype=np.float32): TODO: docstring
975 
976  corr_norm: (np.array[ndim=,dtype=np.float32):
977 
978  ndim: (int):
979 
980  """
981  @property
982  def d_corr(self) -> carmaWrap.obj_float:
983  """
984  TODO: docstring
985 
986  :type: carmaWrap.obj_float
987  """
988  @property
989  def d_corrfnct(self) -> carmaWrap.obj_float_complex:
990  """
991  TODO: docstring
992 
993  :type: carmaWrap.obj_float_complex
994  """
995  @property
996  def d_corrmax(self) -> carmaWrap.obj_int:
997  """
998  TODO: docstring
999 
1000  :type: carmaWrap.obj_int
1001  """
1002  @property
1003  def d_corrnorm(self) -> carmaWrap.obj_float:
1004  """
1005  TODO: docstring
1006 
1007  :type: carmaWrap.obj_float
1008  """
1009  @property
1010  def d_corrspot(self) -> carmaWrap.obj_float_complex:
1011  """
1012  TODO: docstring
1013 
1014  :type: carmaWrap.obj_float_complex
1015  """
1016  @property
1017  def d_interpmat(self) -> carmaWrap.obj_float:
1018  """
1019  TODO: docstring
1020 
1021  :type: carmaWrap.obj_float
1022  """
1023  @property
1024  def interp_sizex(self) -> int:
1025  """
1026  TODO: docstring
1027 
1028  :type: int
1029  """
1030  @property
1031  def interp_sizey(self) -> int:
1032  """
1033  TODO: docstring
1034 
1035  :type: int
1036  """
1037  @property
1038  def npix(self) -> int:
1039  """
1040  TODO: docstring
1041 
1042  :type: int
1043  """
1044  pass
1045 class CentroiderMASKEDPIX_FF(Centroider_FF):
1046  def fill_mask(self) -> int:
1047  """
1048  Fill the mask of valid pixels
1049  """
1050  def fill_selected_pix(self, centroids: carmaWrap.obj_float) -> None:
1051  """
1052  Return the given pixels vector in an image format
1053 
1054  Args:
1055  centroids: (CarmaObj): Pixels to map on the image
1056  """
1057  @property
1058  def d_mask(self) -> carmaWrap.obj_float:
1059  """
1060  Mask of valid pixels
1061 
1062  :type: carmaWrap.obj_float
1063  """
1064  @property
1065  def d_selected_pix(self) -> carmaWrap.obj_float:
1066  """
1067  Selected pixels as an image
1068 
1069  :type: carmaWrap.obj_float
1070  """
1071  pass
1072 class CentroiderMASKEDPIX_UF(Centroider_UF):
1073  def fill_mask(self) -> int:
1074  """
1075  Fill the mask of valid pixels
1076  """
1077  def fill_selected_pix(self, centroids: carmaWrap.obj_float) -> None:
1078  """
1079  Return the given pixels vector in an image format
1080 
1081  Args:
1082  centroids: (CarmaObj): Pixels to map on the image
1083  """
1084  @property
1085  def d_mask(self) -> carmaWrap.obj_float:
1086  """
1087  Mask of valid pixels
1088 
1089  :type: carmaWrap.obj_float
1090  """
1091  @property
1092  def d_selected_pix(self) -> carmaWrap.obj_float:
1093  """
1094  Selected pixels as an image
1096  :type: carmaWrap.obj_float
1097  """
1098  pass
1099 class CentroiderPYR_FF(Centroider_FF):
1100  def set_pyr_method(self, method: int) -> int:
1101  """
1102  Set the pyramid method for slopes computation
1103 
1104  Args:
1105  method : (int) : new centroiding method (0: nosinus global
1106  1: sinus global
1107  2: nosinus local
1108  3: sinus local)
1109  favor use of shesha_constant.PyrCentroiderMethod
1110 
1111 
1112  """
1113  def set_pyr_thresh(self, thresh: float) -> int:
1114  """
1115  Set the pyramid threshold value
1116 
1117  Args:
1118  thresh : (float) : threshold value
1120  """
1121  @property
1122  def pyr_method(self) -> str:
1123  """
1124  Method used for pyramid slopes compuation
1125 
1126  :type: str
1127  """
1128  pass
1129 class CentroiderPYR_UF(Centroider_UF):
1130  def set_pyr_method(self, method: int) -> int:
1131  """
1132  Set the pyramid method for slopes computation
1133 
1134  Args:
1135  method : (int) : new centroiding method (0: nosinus global
1136  1: sinus global
1137  2: nosinus local
1138  3: sinus local)
1139  favor use of shesha_constant.PyrCentroiderMethod
1140 
1141 
1142  """
1143  def set_pyr_thresh(self, thresh: float) -> int:
1144  """
1145  Set the pyramid threshold value
1146 
1147  Args:
1148  thresh : (float) : threshold value
1149 
1150  """
1151  @property
1152  def pyr_method(self) -> str:
1153  """
1154  Method used for pyramid slopes compuation
1155 
1156  :type: str
1157  """
1158  pass
1159 class CentroiderTCOG_FF(Centroider_FF):
1160  def set_threshold(self, thresh: float) -> int:
1161  """
1162  Set the threshold value of a TCOG centroider
1163 
1164  Args:
1165  thresh : (float) : threshold value to set
1166 
1167 
1168  """
1169  @property
1170  def threshold(self) -> float:
1171  """
1172  Threshold value
1173 
1174  :type: float
1175  """
1176  pass
1177 class CentroiderTCOG_UF(Centroider_UF):
1178  def set_threshold(self, thresh: float) -> int:
1179  """
1180  Set the threshold value of a TCOG centroider
1181 
1182  Args:
1183  thresh : (float) : threshold value to set
1184 
1185 
1186  """
1187  @property
1188  def threshold(self) -> float:
1189  """
1190  Threshold value
1191 
1192  :type: float
1193  """
1194  pass
1195 class CentroiderWCOG_FF(Centroider_FF):
1196  def init_weights(self) -> int:
1197  """
1198  Initializes WCOG computation
1199  """
1200  def load_weights(self, weights: numpy.ndarray[numpy.float32], ndim: int) -> int:
1201  """
1202  Load weights on WCOG
1203 
1204  Args:
1205  weight: (np.array[ndim=, dtype=np.float32]: weights
1207  ndim: (int): TODO: docstring
1208 
1209  """
1210  def set_threshold(self, thresh: float) -> int:
1211  """
1212  Set the threshold value of a TCOG centroider
1214  Args:
1215  thresh : (float) : threshold value to set
1216 
1217 
1218  """
1219  @property
1220  def d_weights(self) -> carmaWrap.obj_float:
1221  """
1222  Weights applied
1223 
1224  :type: carmaWrap.obj_float
1225  """
1226  @property
1227  def threshold(self) -> float:
1228  """
1229  Threshold value
1230 
1231  :type: float
1232  """
1233  pass
1234 class CentroiderWCOG_UF(Centroider_UF):
1235  def init_weights(self) -> int:
1236  """
1237  Initializes WCOG computation
1238  """
1239  def load_weights(self, weights: numpy.ndarray[numpy.float32], ndim: int) -> int:
1240  """
1241  Load weights on WCOG
1242 
1243  Args:
1244  weight: (np.array[ndim=, dtype=np.float32]: weights
1245 
1246  ndim: (int): TODO: docstring
1247 
1248  """
1249  def set_threshold(self, thresh: float) -> int:
1250  """
1251  Set the threshold value of a TCOG centroider
1252 
1253  Args:
1254  thresh : (float) : threshold value to set
1255 
1256 
1257  """
1258  @property
1259  def d_weights(self) -> carmaWrap.obj_float:
1260  """
1261  Weights applied
1262 
1263  :type: carmaWrap.obj_float
1264  """
1265  @property
1266  def threshold(self) -> float:
1267  """
1268  Threshold value
1269 
1270  :type: float
1271  """
1272  pass
1273 class CentroiderBPCOG_FF(Centroider_FF):
1274  def set_nmax(self, nmax: int) -> int:
1275  """
1276  Set the number of brightest pixels considered for COG computation
1278  Args:
1279  nmax : (float) : nmax value to set
1280 
1281  """
1282  @property
1283  def d_bpind(self) -> carmaWrap.obj_uint:
1284  """
1285  Brightest pixels indices
1286 
1287  :type: carmaWrap.obj_uint
1288  """
1289  @property
1290  def d_bpix(self) -> carmaWrap.obj_float:
1291  """
1292  Brightest pixels
1293 
1294  :type: carmaWrap.obj_float
1295  """
1296  @property
1297  def nmax(self) -> int:
1298  """
1299  Number of brightest pixels
1300 
1301  :type: int
1302  """
1303  pass
1304 class CentroiderBPCOG_UF(Centroider_UF):
1305  def set_nmax(self, nmax: int) -> int:
1306  """
1307  Set the number of brightest pixels considered for COG computation
1308 
1309  Args:
1310  nmax : (float) : nmax value to set
1311 
1312  """
1313  @property
1314  def d_bpind(self) -> carmaWrap.obj_uint:
1315  """
1316  Brightest pixels indices
1318  :type: carmaWrap.obj_uint
1319  """
1320  @property
1321  def d_bpix(self) -> carmaWrap.obj_float:
1322  """
1323  Brightest pixels
1325  :type: carmaWrap.obj_float
1326  """
1327  @property
1328  def nmax(self) -> int:
1329  """
1330  Number of brightest pixels
1331 
1332  :type: int
1333  """
1334  pass
1335 class Controller_FF():
1336  def add_perturb(self) -> int:
1337  """
1338  Add the perturbation voltage to the command
1339  """
1340  def add_perturb_voltage(self, name: str, perturb: numpy.ndarray[numpy.float32], N: int) -> int:
1341  """
1342  Add a new perturbation voltage buffer
1343 
1344  Args:
1345  name: (str): name of the new buffer
1346 
1347  perturb: (np.array[ndim=2,dtype=np.float32]): perturbation voltage to set
1349  N: (int): Number of perturb voltage vectors in the buffer
1350 
1351  """
1352  def clip_commands(self) -> int:
1353  """
1354  Clip the commands between volt_min and volt_max (values set in the controller)
1355  """
1356  def command_delay(self) -> int:
1357  """
1358  Delay the command
1359  """
1360  def comp_voltage(self) -> int:
1361  """
1362  Computes the final voltage to send to the DM
1363  """
1364  def disable_perturb_voltage(self, name: str) -> int:
1365  """
1366  Disable a perturbation voltage buffer
1367 
1368  Args:
1369  name: (str): name of the buffer to enable
1370 
1371  """
1372  def enable_perturb_voltage(self, name: str) -> int:
1373  """
1374  Enable a perturbation voltage buffer
1375 
1376  Args:
1377  name: (str): name of the buffer to enable
1378 
1379  """
1380  def remove_perturb_voltage(self, name: str) -> int:
1381  """
1382  Remove a perturbation voltage buffer
1383 
1384  Args:
1385  name: (str): name of the buffer to remove
1386 
1387  """
1388  def reset_coms(self) -> int:
1389  """
1390  Reset the commands circular buffer
1391  """
1392  def reset_perturb_voltage(self) -> int:
1393  """
1394  Remove all perturbation voltage buffers
1395 
1396  """
1397  def set_com(self, com: numpy.ndarray[numpy.float32], nElem: int) -> int:
1398  """
1399  Set the command vector of the controller
1400 
1401  Args:
1402  com: (np.array[ndim=3, dtype=np.float32]) : command vector
1403 
1404  nElem: (int): Number of elements in com
1405 
1406  """
1407  def set_comRange(self, volt_min: float, volt_max: float) -> None:
1408  """
1409  Set the volt_min and volt_max value for command clipping
1410 
1411  Args:
1412  volt_min: (float): volt_min value for clipping
1413 
1414  volt_max: (float): volt_max value for clipping
1416  """
1417  def set_delay(self, delay: float) -> int:
1418  """
1419  Set the delay
1420 
1421  Args:
1422  delay: (float): loop delay in frames
1423 
1424  """
1425  def set_gain(self, gain: float) -> int:
1426  """
1427  Set the gain
1428 
1429  Args:
1430  gain: (float): loop gain
1431 
1432  """
1433  def set_open_loop(self, status: int, rst: bool = True) -> int:
1434  """
1435  Open (1) or close (0) the loop
1436 
1437  Args:
1438  status: (int): open loop status
1439 
1440  rst: (bool): reset integrator if True
1442  """
1443  def set_perturb_voltage(self, name: str, perturb: numpy.ndarray[numpy.float32], N: int) -> int:
1444  """
1445  Set an existing perturbation voltage buffer
1446 
1447  Args:
1448  name: (str): name of the buffer
1449 
1450  perturb: (np.array[ndim=2,dtype=np.float32]): perturbation voltage to set
1451 
1452  N: (int): Number of perturb voltage vectors in the buffer
1453 
1454  """
1455  def set_val_max(self, val_max: float) -> int:
1456  """
1457  Set the val_max value for command conversion
1458 
1459  Args:
1460  val_max: (float): val_max value for conversion
1461 
1462  """
1463  def set_volt_max(self, volt_max: float) -> int:
1464  """
1465  Set the volt_max value for command clipping
1466 
1467  Args:
1468  volt_max: (float): volt_max value for clipping
1470  """
1471  @property
1472  def centro_idx(self) -> typing.List[int]:
1473  """
1474  Indices of the handled centroiders
1475 
1476  :type: typing.List[int]
1477  """
1478  @property
1479  def comRange(self) -> typing.Tuple[float, float]:
1480  """
1481  :type: typing.Tuple[float, float]
1482  """
1483  @property
1484  def context(self) -> carmaWrap.context:
1485  """
1486  GPU context
1488  :type: carmaWrap.context
1489  """
1490  @property
1491  def d_centroids(self) -> carmaWrap.obj_float:
1492  """
1493  Slopes vector
1494 
1495  :type: carmaWrap.obj_float
1496  """
1497  @property
1498  def d_circularComs0(self) -> carmaWrap.obj_float:
1499  """
1500  Oldest command vector in the circular buffer
1501 
1502  :type: carmaWrap.obj_float
1503  """
1504  @property
1505  def d_circularComs1(self) -> carmaWrap.obj_float:
1506  """
1507  Second oldest Command vector in the circular buffer
1508 
1509  :type: carmaWrap.obj_float
1510  """
1511  @property
1512  def d_com(self) -> carmaWrap.obj_float:
1513  """
1514  Current command vector
1516  :type: carmaWrap.obj_float
1517  """
1518  @property
1519  def d_com1(self) -> carmaWrap.obj_float:
1520  """
1521  Command vector at iteration k-1
1522 
1523  :type: carmaWrap.obj_float
1524  """
1525  @property
1526  def d_com_clipped(self) -> carmaWrap.obj_float:
1527  """
1528  Delayed commands
1529 
1530  :type: carmaWrap.obj_float
1531  """
1532  @property
1533  def d_dmseen(self) -> typing.List[Dm]:
1534  """
1535  Vector of SutraDm commanded
1536 
1537  :type: typing.List[Dm]
1538  """
1539  @property
1540  def d_perturb_map(self) -> typing.Dict[str, typing.Tuple[carmaWrap.obj_float, int, bool]]:
1541  """
1542  Perturbation voltage buffers
1543 
1544  :type: typing.Dict[str, typing.Tuple[carmaWrap.obj_float, int, bool]]
1545  """
1546  @property
1547  def d_voltage(self) -> carmaWrap.obj_float:
1548  """
1549  Total voltage to apply on the DMs
1550 
1551  :type: carmaWrap.obj_float
1552  """
1553  @property
1554  def delay(self) -> float:
1555  """
1556  Loop delay
1557 
1558  :type: float
1559  """
1560  @property
1561  def device(self) -> int:
1562  """
1563  GPU device index
1565  :type: int
1566  """
1567  @property
1568  def gain(self) -> float:
1569  """
1570  Controller gain
1571 
1572  :type: float
1573  """
1574  @property
1575  def nactu(self) -> int:
1576  """
1577  Number of actuators to control
1578 
1579  :type: int
1580  """
1581  @property
1582  def nslope(self) -> int:
1583  """
1584  Number of slopes
1585 
1586  :type: int
1587  """
1588  @property
1589  def open_loop(self) -> int:
1590  """
1591  Open loop flag
1592 
1593  :type: int
1594  """
1595  @property
1596  def type(self) -> str:
1597  """
1598  Controller type
1600  :type: str
1601  """
1602  @property
1603  def val_max(self) -> float:
1604  """
1605  Maximum value for d_voltage (ADU). Only used if output is expected in uint16
1606 
1607  :type: float
1608  """
1609  pass
1610 class Controller_FU():
1611  def add_perturb(self) -> int:
1612  """
1613  Add the perturbation voltage to the command
1614  """
1615  def add_perturb_voltage(self, name: str, perturb: numpy.ndarray[numpy.float32], N: int) -> int:
1616  """
1617  Add a new perturbation voltage buffer
1618 
1619  Args:
1620  name: (str): name of the new buffer
1621 
1622  perturb: (np.array[ndim=2,dtype=np.float32]): perturbation voltage to set
1623 
1624  N: (int): Number of perturb voltage vectors in the buffer
1626  """
1627  def clip_commands(self) -> int:
1628  """
1629  Clip the commands between volt_min and volt_max (values set in the controller)
1630  """
1631  def command_delay(self) -> int:
1632  """
1633  Delay the command
1634  """
1635  def comp_voltage(self) -> int:
1636  """
1637  Computes the final voltage to send to the DM
1638  """
1639  def disable_perturb_voltage(self, name: str) -> int:
1640  """
1641  Disable a perturbation voltage buffer
1642 
1643  Args:
1644  name: (str): name of the buffer to enable
1645 
1646  """
1647  def enable_perturb_voltage(self, name: str) -> int:
1648  """
1649  Enable a perturbation voltage buffer
1650 
1651  Args:
1652  name: (str): name of the buffer to enable
1653 
1654  """
1655  def remove_perturb_voltage(self, name: str) -> int:
1656  """
1657  Remove a perturbation voltage buffer
1658 
1659  Args:
1660  name: (str): name of the buffer to remove
1661 
1662  """
1663  def reset_coms(self) -> int:
1664  """
1665  Reset the commands circular buffer
1666  """
1667  def reset_perturb_voltage(self) -> int:
1668  """
1669  Remove all perturbation voltage buffers
1671  """
1672  def set_com(self, com: numpy.ndarray[numpy.float32], nElem: int) -> int:
1673  """
1674  Set the command vector of the controller
1675 
1676  Args:
1677  com: (np.array[ndim=3, dtype=np.float32]) : command vector
1678 
1679  nElem: (int): Number of elements in com
1680 
1681  """
1682  def set_comRange(self, volt_min: float, volt_max: float) -> None:
1683  """
1684  Set the volt_min and volt_max value for command clipping
1685 
1686  Args:
1687  volt_min: (float): volt_min value for clipping
1688 
1689  volt_max: (float): volt_max value for clipping
1690 
1691  """
1692  def set_delay(self, delay: float) -> int:
1693  """
1694  Set the delay
1696  Args:
1697  delay: (float): loop delay in frames
1698 
1699  """
1700  def set_gain(self, gain: float) -> int:
1701  """
1702  Set the gain
1703 
1704  Args:
1705  gain: (float): loop gain
1706 
1707  """
1708  def set_open_loop(self, status: int, rst: bool = True) -> int:
1709  """
1710  Open (1) or close (0) the loop
1711 
1712  Args:
1713  status: (int): open loop status
1714 
1715  rst: (bool): reset integrator if True
1716 
1717  """
1718  def set_perturb_voltage(self, name: str, perturb: numpy.ndarray[numpy.float32], N: int) -> int:
1719  """
1720  Set an existing perturbation voltage buffer
1721 
1722  Args:
1723  name: (str): name of the buffer
1724 
1725  perturb: (np.array[ndim=2,dtype=np.float32]): perturbation voltage to set
1726 
1727  N: (int): Number of perturb voltage vectors in the buffer
1728 
1729  """
1730  def set_val_max(self, val_max: float) -> int:
1731  """
1732  Set the val_max value for command conversion
1733 
1734  Args:
1735  val_max: (float): val_max value for conversion
1736 
1737  """
1738  def set_volt_max(self, volt_max: float) -> int:
1739  """
1740  Set the volt_max value for command clipping
1741 
1742  Args:
1743  volt_max: (float): volt_max value for clipping
1744 
1745  """
1746  @property
1747  def centro_idx(self) -> typing.List[int]:
1748  """
1749  Indices of the handled centroiders
1750 
1751  :type: typing.List[int]
1752  """
1753  @property
1754  def comRange(self) -> typing.Tuple[float, float]:
1755  """
1756  :type: typing.Tuple[float, float]
1757  """
1758  @property
1759  def context(self) -> carmaWrap.context:
1760  """
1761  GPU context
1762 
1763  :type: carmaWrap.context
1764  """
1765  @property
1766  def d_centroids(self) -> carmaWrap.obj_float:
1767  """
1768  Slopes vector
1769 
1770  :type: carmaWrap.obj_float
1771  """
1772  @property
1773  def d_circularComs0(self) -> carmaWrap.obj_float:
1774  """
1775  Oldest command vector in the circular buffer
1777  :type: carmaWrap.obj_float
1778  """
1779  @property
1780  def d_circularComs1(self) -> carmaWrap.obj_float:
1781  """
1782  Second oldest Command vector in the circular buffer
1783 
1784  :type: carmaWrap.obj_float
1785  """
1786  @property
1787  def d_com(self) -> carmaWrap.obj_float:
1788  """
1789  Current command vector
1790 
1791  :type: carmaWrap.obj_float
1792  """
1793  @property
1794  def d_com1(self) -> carmaWrap.obj_float:
1795  """
1796  Command vector at iteration k-1
1797 
1798  :type: carmaWrap.obj_float
1799  """
1800  @property
1801  def d_com_clipped(self) -> carmaWrap.obj_float:
1802  """
1803  Delayed commands
1804 
1805  :type: carmaWrap.obj_float
1806  """
1807  @property
1808  def d_dmseen(self) -> typing.List[Dm]:
1809  """
1810  Vector of SutraDm commanded
1811 
1812  :type: typing.List[Dm]
1813  """
1814  @property
1815  def d_perturb_map(self) -> typing.Dict[str, typing.Tuple[carmaWrap.obj_float, int, bool]]:
1816  """
1817  Perturbation voltage buffers
1818 
1819  :type: typing.Dict[str, typing.Tuple[carmaWrap.obj_float, int, bool]]
1820  """
1821  @property
1822  def d_voltage(self) -> carmaWrap.obj_uint16:
1823  """
1824  Total voltage to apply on the DMs
1825 
1826  :type: carmaWrap.obj_uint16
1827  """
1828  @property
1829  def delay(self) -> float:
1830  """
1831  Loop delay
1832 
1833  :type: float
1834  """
1835  @property
1836  def device(self) -> int:
1837  """
1838  GPU device index
1840  :type: int
1841  """
1842  @property
1843  def gain(self) -> float:
1844  """
1845  Controller gain
1846 
1847  :type: float
1848  """
1849  @property
1850  def nactu(self) -> int:
1851  """
1852  Number of actuators to control
1853 
1854  :type: int
1855  """
1856  @property
1857  def nslope(self) -> int:
1858  """
1859  Number of slopes
1860 
1861  :type: int
1862  """
1863  @property
1864  def open_loop(self) -> int:
1865  """
1866  Open loop flag
1868  :type: int
1869  """
1870  @property
1871  def type(self) -> str:
1872  """
1873  Controller type
1874 
1875  :type: str
1876  """
1877  @property
1878  def val_max(self) -> int:
1879  """
1880  Maximum value for d_voltage (ADU). Only used if output is expected in uint16
1881 
1882  :type: int
1883  """
1884  pass
1885 class ControllerGENERICLINEAR_FF(Controller_FF):
1886  def set_iir_a(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
1887  """
1888  Set a single iir 'a' vector within list (combined with iir outputs)
1889 
1890  Args:
1891  M: (np.array[ndim=1,dtype=np.float32]): Vector to be set
1892  i: (int): index of list to slice vector
1893  """
1894  def set_iir_b(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
1895  """
1896  Set a single iir 'b' vector within list (combined with iir inputs)
1897 
1898  Args:
1899  M: (np.array[ndim=1,dtype=np.float32]): Vector to be set
1900  i: (int): index of list to slice vector
1901  """
1902  def set_matA(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
1903  """
1904  Set a single A matrix within the list of A matrices (state recursions)
1905 
1906  Args:
1907  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be sliced
1908  i: (int): index of list to slice matrix
1909  """
1910  def set_matD(self, M: numpy.ndarray[numpy.float32]) -> int:
1911  """
1912  Set D matrix (interaction matrix)
1913 
1914  Args:
1915  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
1916  """
1917  def set_matF(self, M: numpy.ndarray[numpy.float32]) -> int:
1918  """
1919  Set F matrix (mode to actuator voltage projection)
1920 
1921  Args:
1922  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
1923  """
1924  def set_matK(self, M: numpy.ndarray[numpy.float32]) -> int:
1925  """
1926  Set K matrix (state to mode projection)
1927 
1928  Args:
1929  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
1930  """
1931  def set_matL(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
1932  """
1933  Set a single L matrix within the list of L matrices (innovations)
1934 
1935  Args:
1936  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be sliced
1937  i: (int): index of list to slice matrix
1938  """
1939  def set_polc(self, polc: bool) -> int:
1940  """
1941  Set the POLC flag
1942 
1943  Args:
1944  polc: (bool): POLC flag
1945  """
1946  @property
1947  def d_centroids(self) -> carmaWrap.obj_float:
1948  """
1949  centroid/slope vector
1950  (see compass.io details on the generic linear controller)
1951 
1952  :type: carmaWrap.obj_float
1953  """
1954  @property
1955  def d_circular_coms(self) -> typing.List[carmaWrap.obj_float]:
1956  """
1957  circular command buffer
1958  (see compass.io details on the generic linear controller)
1959 
1960  :type: typing.List[carmaWrap.obj_float]
1961  """
1962  @property
1963  def d_circular_s(self) -> typing.List[carmaWrap.obj_float]:
1964  """
1965  circular slope buffer
1966  (see compass.io details on the generic linear controller)
1967 
1968  :type: typing.List[carmaWrap.obj_float]
1969  """
1970  @property
1971  def d_circular_u_in(self) -> typing.List[carmaWrap.obj_float]:
1972  """
1973  circular buffer of iir inputs
1974  (see compass.io details on the generic linear controller)
1975 
1976  :type: typing.List[carmaWrap.obj_float]
1977  """
1978  @property
1979  def d_circular_u_out(self) -> typing.List[carmaWrap.obj_float]:
1980  """
1981  circular buffer of iir outputs
1982  (see compass.io details on the generic linear controller)
1983 
1984  :type: typing.List[carmaWrap.obj_float]
1985  """
1986  @property
1987  def d_circular_x(self) -> typing.List[carmaWrap.obj_float]:
1988  """
1989  circular state buffer
1990  (see compass.io details on the generic linear controller)
1991 
1992  :type: typing.List[carmaWrap.obj_float]
1993  """
1994  @property
1995  def d_com(self) -> carmaWrap.obj_float:
1996  """
1997  command vector
1998  (see compass.io details on the generic linear controller)
1999 
2000  :type: carmaWrap.obj_float
2001  """
2002  @property
2003  def d_iir_a(self) -> typing.List[carmaWrap.obj_float]:
2004  """
2005  List of iir coefficient vectors for outputs
2006  (see compass.io details on the generic linear controller)
2007 
2008  :type: typing.List[carmaWrap.obj_float]
2009  """
2010  @property
2011  def d_iir_b(self) -> typing.List[carmaWrap.obj_float]:
2012  """
2013  List of iir coefficient vectors for inputs
2014  (see compass.io details on the generic linear controller)
2015 
2016  :type: typing.List[carmaWrap.obj_float]
2017  """
2018  @property
2019  def d_imat(self) -> carmaWrap.obj_float:
2020  """
2021  D matrix, typically set to the interaction matrix
2022  (see compass.io details on the generic linear controller)
2023 
2024  :type: carmaWrap.obj_float
2025  """
2026  @property
2027  def d_matA(self) -> typing.List[carmaWrap.obj_float]:
2028  """
2029  List of A matrices used for state recursion
2030  (see compass.io details on the generic linear controller)
2031 
2032  :type: typing.List[carmaWrap.obj_float]
2033  """
2034  @property
2035  def d_matD(self) -> carmaWrap.obj_float:
2036  """
2037  D matrix, typically set to the interaction matrix
2038  (see compass.io details on the generic linear controller)
2039 
2040  :type: carmaWrap.obj_float
2041  """
2042  @property
2043  def d_matF(self) -> carmaWrap.obj_float:
2044  """
2045  F matrix, used to project from modes to actuator voltages
2046  (see compass.io details on the generic linear controller)
2047 
2048  :type: carmaWrap.obj_float
2049  """
2050  @property
2051  def d_matK(self) -> carmaWrap.obj_float:
2052  """
2053  K matrix, used for projection from state to modes
2054  (see compass.io details on the generic linear controller)
2056  :type: carmaWrap.obj_float
2057  """
2058  @property
2059  def d_matL(self) -> typing.List[carmaWrap.obj_float]:
2060  """
2061  List of L matrices used for innovation from measurements
2062  (see compass.io details on the generic linear controller)
2063 
2064  :type: typing.List[carmaWrap.obj_float]
2065  """
2066  @property
2067  def d_s_now(self) -> carmaWrap.obj_float:
2068  """
2069  temporary slope vector used for control calcs
2070  (see compass.io details on the generic linear controller)
2071 
2072  :type: carmaWrap.obj_float
2073  """
2074  @property
2075  def d_u_now(self) -> carmaWrap.obj_float:
2076  """
2077  temporary command vector used for control calcs
2078  (see compass.io details on the generic linear controller)
2079 
2080  :type: carmaWrap.obj_float
2081  """
2082  @property
2083  def d_x_now(self) -> carmaWrap.obj_float:
2084  """
2085  temporary state vector used for control calcs
2086  (see compass.io details on the generic linear controller)
2087 
2088  :type: carmaWrap.obj_float
2089  """
2090  @property
2091  def modal(self) -> bool:
2092  """
2093  modal flag
2094  (see compass.io details on the generic linear controller)
2095 
2096  :type: bool
2097  """
2098  @property
2099  def n_iir_in(self) -> int:
2100  """
2101  number of iir inputs to use
2102  (see compass.io details on the generic linear controller)
2103 
2104  :type: int
2105  """
2106  @property
2107  def n_iir_out(self) -> int:
2108  """
2109  number of iir outputs to use
2110  (see compass.io details on the generic linear controller)
2111 
2112  :type: int
2113  """
2114  @property
2115  def n_modes(self) -> int:
2116  """
2117  number of modes in mode vector
2118  (see compass.io details on the generic linear controller)
2119 
2120  :type: int
2121  """
2122  @property
2123  def n_slope_buffers(self) -> int:
2124  """
2125  number of slope vectors to store in buffer
2126  (see compass.io details on the generic linear controller)
2128  :type: int
2129  """
2130  @property
2131  def n_state_buffers(self) -> int:
2132  """
2133  number of state vectors to store in buffer
2134  (see compass.io details on the generic linear controller)
2135 
2136  :type: int
2137  """
2138  @property
2139  def n_states(self) -> int:
2140  """
2141  number of states in state vector
2142  (see compass.io details on the generic linear controller)
2143 
2144  :type: int
2145  """
2146  @property
2147  def polc(self) -> bool:
2148  """
2149  polc flag
2150  (see compass.io details on the generic linear controller)
2151 
2152  :type: bool
2153  """
2154  pass
2155 class ControllerGENERICLINEAR_FU(Controller_FU):
2156  def set_iir_a(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
2157  """
2158  Set a single iir 'a' vector within list (combined with iir outputs)
2159 
2160  Args:
2161  M: (np.array[ndim=1,dtype=np.float32]): Vector to be set
2162  i: (int): index of list to slice vector
2163  """
2164  def set_iir_b(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
2165  """
2166  Set a single iir 'b' vector within list (combined with iir inputs)
2167 
2168  Args:
2169  M: (np.array[ndim=1,dtype=np.float32]): Vector to be set
2170  i: (int): index of list to slice vector
2171  """
2172  def set_matA(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
2173  """
2174  Set a single A matrix within the list of A matrices (state recursions)
2175 
2176  Args:
2177  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be sliced
2178  i: (int): index of list to slice matrix
2179  """
2180  def set_matD(self, M: numpy.ndarray[numpy.float32]) -> int:
2181  """
2182  Set D matrix (interaction matrix)
2183 
2184  Args:
2185  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
2186  """
2187  def set_matF(self, M: numpy.ndarray[numpy.float32]) -> int:
2188  """
2189  Set F matrix (mode to actuator voltage projection)
2190 
2191  Args:
2192  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
2193  """
2194  def set_matK(self, M: numpy.ndarray[numpy.float32]) -> int:
2195  """
2196  Set K matrix (state to mode projection)
2197 
2198  Args:
2199  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
2200  """
2201  def set_matL(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
2202  """
2203  Set a single L matrix within the list of L matrices (innovations)
2204 
2205  Args:
2206  M: (np.array[ndim=2,dtype=np.float32]): Matrix to be sliced
2207  i: (int): index of list to slice matrix
2208  """
2209  def set_polc(self, polc: bool) -> int:
2210  """
2211  Set the POLC flag
2212 
2213  Args:
2214  polc: (bool): POLC flag
2215  """
2216  @property
2217  def d_centroids(self) -> carmaWrap.obj_float:
2218  """
2219  centroid/slope vector
2220  (see compass.io details on the generic linear controller)
2221 
2222  :type: carmaWrap.obj_float
2223  """
2224  @property
2225  def d_circular_coms(self) -> typing.List[carmaWrap.obj_float]:
2226  """
2227  circular command buffer
2228  (see compass.io details on the generic linear controller)
2229 
2230  :type: typing.List[carmaWrap.obj_float]
2231  """
2232  @property
2233  def d_circular_s(self) -> typing.List[carmaWrap.obj_float]:
2234  """
2235  circular slope buffer
2236  (see compass.io details on the generic linear controller)
2237 
2238  :type: typing.List[carmaWrap.obj_float]
2239  """
2240  @property
2241  def d_circular_u_in(self) -> typing.List[carmaWrap.obj_float]:
2242  """
2243  circular buffer of iir inputs
2244  (see compass.io details on the generic linear controller)
2245 
2246  :type: typing.List[carmaWrap.obj_float]
2247  """
2248  @property
2249  def d_circular_u_out(self) -> typing.List[carmaWrap.obj_float]:
2250  """
2251  circular buffer of iir outputs
2252  (see compass.io details on the generic linear controller)
2253 
2254  :type: typing.List[carmaWrap.obj_float]
2255  """
2256  @property
2257  def d_circular_x(self) -> typing.List[carmaWrap.obj_float]:
2258  """
2259  circular state buffer
2260  (see compass.io details on the generic linear controller)
2261 
2262  :type: typing.List[carmaWrap.obj_float]
2263  """
2264  @property
2265  def d_com(self) -> carmaWrap.obj_float:
2266  """
2267  command vector
2268  (see compass.io details on the generic linear controller)
2269 
2270  :type: carmaWrap.obj_float
2271  """
2272  @property
2273  def d_iir_a(self) -> typing.List[carmaWrap.obj_float]:
2274  """
2275  List of iir coefficient vectors for outputs
2276  (see compass.io details on the generic linear controller)
2277 
2278  :type: typing.List[carmaWrap.obj_float]
2279  """
2280  @property
2281  def d_iir_b(self) -> typing.List[carmaWrap.obj_float]:
2282  """
2283  List of iir coefficient vectors for inputs
2284  (see compass.io details on the generic linear controller)
2285 
2286  :type: typing.List[carmaWrap.obj_float]
2287  """
2288  @property
2289  def d_imat(self) -> carmaWrap.obj_float:
2290  """
2291  D matrix, typically set to the interaction matrix
2292  (see compass.io details on the generic linear controller)
2293 
2294  :type: carmaWrap.obj_float
2295  """
2296  @property
2297  def d_matA(self) -> typing.List[carmaWrap.obj_float]:
2298  """
2299  List of A matrices used for state recursion
2300  (see compass.io details on the generic linear controller)
2301 
2302  :type: typing.List[carmaWrap.obj_float]
2303  """
2304  @property
2305  def d_matD(self) -> carmaWrap.obj_float:
2306  """
2307  D matrix, typically set to the interaction matrix
2308  (see compass.io details on the generic linear controller)
2309 
2310  :type: carmaWrap.obj_float
2311  """
2312  @property
2313  def d_matF(self) -> carmaWrap.obj_float:
2314  """
2315  F matrix, used to project from modes to actuator voltages
2316  (see compass.io details on the generic linear controller)
2317 
2318  :type: carmaWrap.obj_float
2319  """
2320  @property
2321  def d_matK(self) -> carmaWrap.obj_float:
2322  """
2323  K matrix, used for projection from state to modes
2324  (see compass.io details on the generic linear controller)
2325 
2326  :type: carmaWrap.obj_float
2327  """
2328  @property
2329  def d_matL(self) -> typing.List[carmaWrap.obj_float]:
2330  """
2331  List of L matrices used for innovation from measurements
2332  (see compass.io details on the generic linear controller)
2333 
2334  :type: typing.List[carmaWrap.obj_float]
2335  """
2336  @property
2337  def d_s_now(self) -> carmaWrap.obj_float:
2338  """
2339  temporary slope vector used for control calcs
2340  (see compass.io details on the generic linear controller)
2341 
2342  :type: carmaWrap.obj_float
2343  """
2344  @property
2345  def d_u_now(self) -> carmaWrap.obj_float:
2346  """
2347  temporary command vector used for control calcs
2348  (see compass.io details on the generic linear controller)
2349 
2350  :type: carmaWrap.obj_float
2351  """
2352  @property
2353  def d_x_now(self) -> carmaWrap.obj_float:
2354  """
2355  temporary state vector used for control calcs
2356  (see compass.io details on the generic linear controller)
2357 
2358  :type: carmaWrap.obj_float
2359  """
2360  @property
2361  def modal(self) -> bool:
2362  """
2363  modal flag
2364  (see compass.io details on the generic linear controller)
2365 
2366  :type: bool
2367  """
2368  @property
2369  def n_iir_in(self) -> int:
2370  """
2371  number of iir inputs to use
2372  (see compass.io details on the generic linear controller)
2373 
2374  :type: int
2375  """
2376  @property
2377  def n_iir_out(self) -> int:
2378  """
2379  number of iir outputs to use
2380  (see compass.io details on the generic linear controller)
2381 
2382  :type: int
2383  """
2384  @property
2385  def n_modes(self) -> int:
2386  """
2387  number of modes in mode vector
2388  (see compass.io details on the generic linear controller)
2389 
2390  :type: int
2391  """
2392  @property
2393  def n_slope_buffers(self) -> int:
2394  """
2395  number of slope vectors to store in buffer
2396  (see compass.io details on the generic linear controller)
2397 
2398  :type: int
2399  """
2400  @property
2401  def n_state_buffers(self) -> int:
2402  """
2403  number of state vectors to store in buffer
2404  (see compass.io details on the generic linear controller)
2405 
2406  :type: int
2407  """
2408  @property
2409  def n_states(self) -> int:
2410  """
2411  number of states in state vector
2412  (see compass.io details on the generic linear controller)
2413 
2414  :type: int
2415  """
2416  @property
2417  def polc(self) -> bool:
2418  """
2419  polc flag
2420  (see compass.io details on the generic linear controller)
2421 
2422  :type: bool
2423  """
2424  pass
2425 class ControllerGENERIC_FF(Controller_FF):
2426  def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
2427  """
2428  Set the command matrix
2429 
2430  Args:
2431  cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
2432  """
2433  def set_commandlaw(self, commandlaw: str) -> int:
2434  """
2435  Set the command law to use
2437  Args:
2438  commandlaw: (str): command law "integrator", "modal_integrator" or "2matrices"
2439  """
2440  def set_decayFactor(self, decayFactor: numpy.ndarray[numpy.float32]) -> int:
2441  """
2442  Set the decay factor vector
2443 
2444  Args:
2445  decayFactor: (np.array[ndim=1,dtype=np.float32]): decay factor
2446  """
2447  def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
2448  """
2449  Set the interaction matrix
2450 
2451  Args:
2452  imat: (np.array[ndim=2,dtype=np.float32]): interaction matrix to set
2453  """
2454  def set_matE(self, E: numpy.ndarray[numpy.float32]) -> int:
2455  """
2456  Set the E matrix
2457 
2458  Args:
2459  E: (np.array[ndim=2,dtype=np.float32]): E matrix to set
2460  """
2461  def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2462  """
2463  Set the controller modal gains
2464 
2465  Args:
2466  mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
2467  """
2468  def set_polc(self, polc: bool) -> int:
2469  """
2470  Set the polc flag
2471 
2472  Args:
2473  polc: (bool): polc flag
2474  """
2475  @property
2476  def command_law(self) -> str:
2477  """
2478  Command law currently used
2479 
2480  :type: str
2481  """
2482  @property
2483  def d_cmat(self) -> carmaWrap.obj_float:
2484  """
2485  Control matrix
2486 
2487  :type: carmaWrap.obj_float
2488  """
2489  @property
2490  def d_compbuff(self) -> carmaWrap.obj_float:
2491  """
2492  Computation buffer buffer
2493 
2494  :type: carmaWrap.obj_float
2495  """
2496  @property
2497  def d_decayFactor(self) -> carmaWrap.obj_float:
2498  """
2499  decayFactor vector (see compass.io details on generic controller)
2500 
2501  :type: carmaWrap.obj_float
2502  """
2503  @property
2504  def d_err_ngpu(self) -> typing.List[carmaWrap.obj_float]:
2505  """
2506  :type: typing.List[carmaWrap.obj_float]
2507  """
2508  @property
2509  def d_gain(self) -> carmaWrap.obj_float:
2510  """
2511  vector of modal gains
2512 
2513  :type: carmaWrap.obj_float
2514  """
2515  @property
2516  def d_imat(self) -> carmaWrap.obj_float:
2517  """
2518  Control matrix
2519 
2520  :type: carmaWrap.obj_float
2521  """
2522  @property
2523  def d_matE(self) -> carmaWrap.obj_float:
2524  """
2525  E matrix (see compass.io details on generic controller)
2526 
2527  :type: carmaWrap.obj_float
2528  """
2529  @property
2530  def polc(self) -> bool:
2531  """
2532  POLC flag
2534  :type: bool
2535  """
2536  pass
2537 class ControllerGENERIC_FU(Controller_FU):
2538  def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
2539  """
2540  Set the command matrix
2541 
2542  Args:
2543  cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
2544  """
2545  def set_commandlaw(self, commandlaw: str) -> int:
2546  """
2547  Set the command law to use
2549  Args:
2550  commandlaw: (str): command law "integrator", "modal_integrator" or "2matrices"
2551  """
2552  def set_decayFactor(self, decayFactor: numpy.ndarray[numpy.float32]) -> int:
2553  """
2554  Set the decay factor vector
2555 
2556  Args:
2557  decayFactor: (np.array[ndim=1,dtype=np.float32]): decay factor
2558  """
2559  def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
2560  """
2561  Set the interaction matrix
2562 
2563  Args:
2564  imat: (np.array[ndim=2,dtype=np.float32]): interaction matrix to set
2565  """
2566  def set_matE(self, E: numpy.ndarray[numpy.float32]) -> int:
2567  """
2568  Set the E matrix
2569 
2570  Args:
2571  E: (np.array[ndim=2,dtype=np.float32]): E matrix to set
2572  """
2573  def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2574  """
2575  Set the controller modal gains
2576 
2577  Args:
2578  mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
2579  """
2580  def set_polc(self, polc: bool) -> int:
2581  """
2582  Set the polc flag
2583 
2584  Args:
2585  polc: (bool): polc flag
2586  """
2587  @property
2588  def command_law(self) -> str:
2589  """
2590  Command law currently used
2591 
2592  :type: str
2593  """
2594  @property
2595  def d_cmat(self) -> carmaWrap.obj_float:
2596  """
2597  Control matrix
2599  :type: carmaWrap.obj_float
2600  """
2601  @property
2602  def d_compbuff(self) -> carmaWrap.obj_float:
2603  """
2604  Computation buffer buffer
2605 
2606  :type: carmaWrap.obj_float
2607  """
2608  @property
2609  def d_decayFactor(self) -> carmaWrap.obj_float:
2610  """
2611  decayFactor vector (see compass.io details on generic controller)
2612 
2613  :type: carmaWrap.obj_float
2614  """
2615  @property
2616  def d_err_ngpu(self) -> typing.List[carmaWrap.obj_float]:
2617  """
2618  :type: typing.List[carmaWrap.obj_float]
2619  """
2620  @property
2621  def d_gain(self) -> carmaWrap.obj_float:
2622  """
2623  vector of modal gains
2624 
2625  :type: carmaWrap.obj_float
2626  """
2627  @property
2628  def d_imat(self) -> carmaWrap.obj_float:
2629  """
2630  Control matrix
2631 
2632  :type: carmaWrap.obj_float
2633  """
2634  @property
2635  def d_matE(self) -> carmaWrap.obj_float:
2636  """
2637  E matrix (see compass.io details on generic controller)
2639  :type: carmaWrap.obj_float
2640  """
2641  @property
2642  def polc(self) -> bool:
2643  """
2644  POLC flag
2645 
2646  :type: bool
2647  """
2648  pass
2649 class ControllerGEO_FF(Controller_FF):
2650  def comp_dphi(self, source: Source, wfs_direction: bool) -> int:
2651  """
2652  Get the pupil phase and remove piston before projection
2653 
2654  Args:
2655  source: (SutraSource): Phase source
2656 
2657  wfs_direction: (bool): Must be True if the source is a WFS GS
2658  """
2659  def init_proj_sparse(self, dms: Dms, indx_dm: numpy.ndarray[numpy.int32], unitpervolt: numpy.ndarray[numpy.float32], indx_pup: numpy.ndarray[numpy.int32], indx_mpup: numpy.ndarray[numpy.int32], roket: bool) -> int:
2660  """
2661  Initializes projection matrices
2662 
2663  Args:
2664  dms: (SutraDms): SutraDms object
2665 
2666  indx_dm: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the pupil in the DM support
2667  unitpervolt: (np.array[ndim=1,dtype=np.float32]): Unit per volt of each DM
2669  indx_pup: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the small pupil
2670 
2671  indx_mpup: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the medium pupil
2672 
2673  roket: (bool): ROKET flag
2674  """
2675  def load_Btt(self, Btt_pzt: numpy.ndarray[numpy.float32], Btt_tt: numpy.ndarray[numpy.float32]) -> int:
2676  """
2677  Load the Btt modal basis in the geo controller for ROKET
2679  Args:
2680  Btt_pzt: (np.array[ndim=2,dtype=np.float32]) : PZT DM component
2681 
2682  Btt_tt: (np.array[ndim=2,dtype=np.float32]) : TT mirror component
2683 
2684  """
2685  def load_mgain(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2686  """
2687  Set the controller modal gains
2689  Args:
2690  mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
2691  """
2692  @property
2693  def Nphi(self) -> int:
2694  """
2695  Number of points in the pupil
2696 
2697  :type: int
2698  """
2699  @property
2700  def Ntt(self) -> int:
2701  """
2702  Number of tip-tilt mirror
2703 
2704  :type: int
2705  """
2706  @property
2707  def d_IFsparse(self) -> carmaWrap.sparse_obj_double:
2708  """
2709  Influence functions in the pupil (sparse representation
2710 
2711  :type: carmaWrap.sparse_obj_double
2712  """
2713  @property
2714  def d_TT(self) -> carmaWrap.obj_float:
2715  """
2716  Tip-tilt influence functions
2717 
2718  :type: carmaWrap.obj_float
2719  """
2720  @property
2721  def d_compdouble(self) -> carmaWrap.obj_double:
2722  """
2723  Buffer for computation (double precision)
2724 
2725  :type: carmaWrap.obj_double
2726  """
2727  @property
2728  def d_compfloat(self) -> carmaWrap.obj_float:
2729  """
2730  Buffer for computation (simple precision)
2731 
2732  :type: carmaWrap.obj_float
2733  """
2734  @property
2735  def d_gain(self) -> carmaWrap.obj_float:
2736  """
2737  vector of modal gains
2739  :type: carmaWrap.obj_float
2740  """
2741  @property
2742  def d_geocov(self) -> carmaWrap.obj_float:
2743  """
2744  Geometric covariance matrix
2745 
2746  :type: carmaWrap.obj_float
2747  """
2748  @property
2749  def d_geocovTT(self) -> carmaWrap.obj_float:
2750  """
2751  Geometric covariance matrix for TT mirror
2752 
2753  :type: carmaWrap.obj_float
2754  """
2755  @property
2756  def d_indx_mpup(self) -> carmaWrap.obj_int:
2757  """
2758  Indices of the valid pixels in mpupil
2759 
2760  :type: carmaWrap.obj_int
2761  """
2762  @property
2763  def d_indx_pup(self) -> carmaWrap.obj_int:
2764  """
2765  Indices of the valid pixels in spupil
2766 
2767  :type: carmaWrap.obj_int
2768  """
2769  @property
2770  def d_phi(self) -> carmaWrap.obj_double:
2771  """
2772  Phase in the pupil without piston (double)
2773 
2774  :type: carmaWrap.obj_double
2775  """
2776  @property
2777  def d_phif(self) -> carmaWrap.obj_float:
2778  """
2779  Phase in the pupil without piston (float)
2780 
2781  :type: carmaWrap.obj_float
2782  """
2783  pass
2784 class ControllerGEO_FU(Controller_FU):
2785  def comp_dphi(self, source: Source, wfs_direction: bool) -> int:
2786  """
2787  Get the pupil phase and remove piston before projection
2789  Args:
2790  source: (SutraSource): Phase source
2791 
2792  wfs_direction: (bool): Must be True if the source is a WFS GS
2793  """
2794  def init_proj_sparse(self, dms: Dms, indx_dm: numpy.ndarray[numpy.int32], unitpervolt: numpy.ndarray[numpy.float32], indx_pup: numpy.ndarray[numpy.int32], indx_mpup: numpy.ndarray[numpy.int32], roket: bool) -> int:
2795  """
2796  Initializes projection matrices
2797 
2798  Args:
2799  dms: (SutraDms): SutraDms object
2800 
2801  indx_dm: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the pupil in the DM support
2802  unitpervolt: (np.array[ndim=1,dtype=np.float32]): Unit per volt of each DM
2803 
2804  indx_pup: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the small pupil
2805 
2806  indx_mpup: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the medium pupil
2807 
2808  roket: (bool): ROKET flag
2809  """
2810  def load_Btt(self, Btt_pzt: numpy.ndarray[numpy.float32], Btt_tt: numpy.ndarray[numpy.float32]) -> int:
2811  """
2812  Load the Btt modal basis in the geo controller for ROKET
2813 
2814  Args:
2815  Btt_pzt: (np.array[ndim=2,dtype=np.float32]) : PZT DM component
2817  Btt_tt: (np.array[ndim=2,dtype=np.float32]) : TT mirror component
2818 
2819  """
2820  def load_mgain(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2821  """
2822  Set the controller modal gains
2824  Args:
2825  mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
2826  """
2827  @property
2828  def Nphi(self) -> int:
2829  """
2830  Number of points in the pupil
2831 
2832  :type: int
2833  """
2834  @property
2835  def Ntt(self) -> int:
2836  """
2837  Number of tip-tilt mirror
2838 
2839  :type: int
2840  """
2841  @property
2842  def d_IFsparse(self) -> carmaWrap.sparse_obj_double:
2843  """
2844  Influence functions in the pupil (sparse representation
2845 
2846  :type: carmaWrap.sparse_obj_double
2847  """
2848  @property
2849  def d_TT(self) -> carmaWrap.obj_float:
2850  """
2851  Tip-tilt influence functions
2852 
2853  :type: carmaWrap.obj_float
2854  """
2855  @property
2856  def d_compdouble(self) -> carmaWrap.obj_double:
2857  """
2858  Buffer for computation (double precision)
2859 
2860  :type: carmaWrap.obj_double
2861  """
2862  @property
2863  def d_compfloat(self) -> carmaWrap.obj_float:
2864  """
2865  Buffer for computation (simple precision)
2866 
2867  :type: carmaWrap.obj_float
2868  """
2869  @property
2870  def d_gain(self) -> carmaWrap.obj_float:
2871  """
2872  vector of modal gains
2873 
2874  :type: carmaWrap.obj_float
2875  """
2876  @property
2877  def d_geocov(self) -> carmaWrap.obj_float:
2878  """
2879  Geometric covariance matrix
2880 
2881  :type: carmaWrap.obj_float
2882  """
2883  @property
2884  def d_geocovTT(self) -> carmaWrap.obj_float:
2885  """
2886  Geometric covariance matrix for TT mirror
2887 
2888  :type: carmaWrap.obj_float
2889  """
2890  @property
2891  def d_indx_mpup(self) -> carmaWrap.obj_int:
2892  """
2893  Indices of the valid pixels in mpupil
2894 
2895  :type: carmaWrap.obj_int
2896  """
2897  @property
2898  def d_indx_pup(self) -> carmaWrap.obj_int:
2899  """
2900  Indices of the valid pixels in spupil
2902  :type: carmaWrap.obj_int
2903  """
2904  @property
2905  def d_phi(self) -> carmaWrap.obj_double:
2906  """
2907  Phase in the pupil without piston (double)
2908 
2909  :type: carmaWrap.obj_double
2910  """
2911  @property
2912  def d_phif(self) -> carmaWrap.obj_float:
2913  """
2914  Phase in the pupil without piston (float)
2915 
2916  :type: carmaWrap.obj_float
2917  """
2918  pass
2920  def build_cmat(self, nfilt: int) -> int:
2921  """
2922  Computes the command matrix after imat SVD
2923 
2924  Args:
2925  nfilt: (int): number of modes to filter
2926  """
2927  def init_modalOpti(self, nmodes: int, nrec: int, M2V: numpy.ndarray[numpy.float32], gmin: float, gmax: float, ngain: int, Fs: float) -> int:
2928  """
2929  Initialize modal optimization control
2930 
2931  Args:
2932  nmodes: (int): number of modes to control
2933 
2934  nrec: (int): number of open loop slopes to consider
2935 
2936  M2V: (np.array[ndim=2,dtype=np.float32]): Modes to Volt matrix
2937 
2938  gmin: (float): Minimal gain
2940  gmax: (float): Maximal gain
2941 
2942  ngain: (int): Number of gain values to test between gmin and gmax
2943 
2944  Fs: (float): Sampling frequency [Hz]
2945  """
2946  def loadopen_loopSlp(self, slopes: numpy.ndarray[numpy.float32]) -> int:
2947  """
2948  Load recorded open loop slopes for modal optimization initialization
2949 
2950  Args:
2951  slopes: (np.array[ndim=2,dtype=np.float32]): Open loop slopes
2952  """
2953  def modalControlOptimization(self) -> int:
2954  """
2955  TODO: docstring
2956  """
2957  def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
2958  """
2959  Set the command matrix
2961  Args:
2962  cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
2963  """
2964  def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
2965  """
2966  Set the interaction matrix
2968  Args:
2969  imat: (np.array[ndim=2,dtype=np.float32]): interaction matrix to set
2970  """
2971  def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2972  """
2973  Set the controller modal gains
2975  Args:
2976  mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
2977  """
2978  def svdec_imat(self) -> int:
2979  """
2980  Performs interaction matrix SVD
2981  """
2982  @property
2983  def Fs(self) -> float:
2984  """
2985  Sampling frequency for modal optimization
2986 
2987  :type: float
2988  """
2989  @property
2990  def cpt_rec(self) -> int:
2991  """
2992  Counter for modal gains refresh
2993 
2994  :type: int
2995  """
2996  @property
2997  def d_Hcor(self) -> carmaWrap.obj_float:
2998  """
2999  Transfer function for modal optimization
3000 
3001  :type: carmaWrap.obj_float
3002  """
3003  @property
3004  def d_M2V(self) -> carmaWrap.obj_float:
3005  """
3006  Modes to volt matrix for modal optimization
3007 
3008  :type: carmaWrap.obj_float
3009  """
3010  @property
3011  def d_S2M(self) -> carmaWrap.obj_float:
3012  """
3013  Slopes to modes matrix for modal optimization
3014 
3015  :type: carmaWrap.obj_float
3016  """
3017  @property
3018  def d_U(self) -> carmaWrap.obj_float:
3019  """
3020  Eigen modes of the imat
3021 
3022  :type: carmaWrap.obj_float
3023  """
3024  @property
3025  def d_cenbuff(self) -> carmaWrap.obj_float:
3026  """
3027  Centroids circular buffer
3028 
3029  :type: carmaWrap.obj_float
3030  """
3031  @property
3032  def d_cmat(self) -> carmaWrap.obj_float:
3033  """
3034  Control matrix
3035 
3036  :type: carmaWrap.obj_float
3037  """
3038  @property
3039  def d_compbuff(self) -> carmaWrap.obj_float:
3040  """
3041  Buffer for POLC computation
3042 
3043  :type: carmaWrap.obj_float
3044  """
3045  @property
3046  def d_compbuff2(self) -> carmaWrap.obj_float:
3047  """
3048  Buffer for POLC computation
3050  :type: carmaWrap.obj_float
3051  """
3052  @property
3053  def d_eigenvals(self) -> carmaWrap.obj_float:
3054  """
3055  Eigen values of the imat
3056 
3057  :type: carmaWrap.obj_float
3058  """
3059  @property
3060  def d_err(self) -> carmaWrap.obj_float:
3061  """
3062  Current increment on the command
3063 
3064  :type: carmaWrap.obj_float
3065  """
3066  @property
3067  def d_gain(self) -> carmaWrap.obj_float:
3068  """
3069  vector of modal gains
3070 
3071  :type: carmaWrap.obj_float
3072  """
3073  @property
3074  def d_imat(self) -> carmaWrap.obj_float:
3075  """
3076  Interaction matrix
3077 
3078  :type: carmaWrap.obj_float
3079  """
3080  @property
3081  def d_slpol(self) -> carmaWrap.obj_float:
3082  """
3083  Open loop slopes for modal optimization
3084 
3085  :type: carmaWrap.obj_float
3086  """
3087  @property
3088  def gmax(self) -> float:
3089  """
3090  Maximal gain for modal optimization
3091 
3092  :type: float
3093  """
3094  @property
3095  def gmin(self) -> float:
3096  """
3097  Minimal gain for modal optimization
3098 
3099  :type: float
3100  """
3101  @property
3102  def is_modopti(self) -> int:
3103  """
3104  Falg for modal optimization
3105 
3106  :type: int
3107  """
3108  @property
3109  def ngain(self) -> int:
3110  """
3111  Number of gain values to test between gmin and gmax for modal optimization
3112 
3113  :type: int
3114  """
3115  @property
3116  def nmodes(self) -> int:
3117  """
3118  Number of modes for modal optimization
3119 
3120  :type: int
3121  """
3122  @property
3123  def nrec(self) -> int:
3124  """
3125  Number of open loop slopes to take for modal optimization
3126 
3127  :type: int
3128  """
3129  pass
3130 class ControllerLS_FU(Controller_FU):
3131  def build_cmat(self, nfilt: int) -> int:
3132  """
3133  Computes the command matrix after imat SVD
3134 
3135  Args:
3136  nfilt: (int): number of modes to filter
3137  """
3138  def init_modalOpti(self, nmodes: int, nrec: int, M2V: numpy.ndarray[numpy.float32], gmin: float, gmax: float, ngain: int, Fs: float) -> int:
3139  """
3140  Initialize modal optimization control
3141 
3142  Args:
3143  nmodes: (int): number of modes to control
3144 
3145  nrec: (int): number of open loop slopes to consider
3146 
3147  M2V: (np.array[ndim=2,dtype=np.float32]): Modes to Volt matrix
3148 
3149  gmin: (float): Minimal gain
3150 
3151  gmax: (float): Maximal gain
3152 
3153  ngain: (int): Number of gain values to test between gmin and gmax
3154 
3155  Fs: (float): Sampling frequency [Hz]
3156  """
3157  def loadopen_loopSlp(self, slopes: numpy.ndarray[numpy.float32]) -> int:
3158  """
3159  Load recorded open loop slopes for modal optimization initialization
3160 
3161  Args:
3162  slopes: (np.array[ndim=2,dtype=np.float32]): Open loop slopes
3163  """
3164  def modalControlOptimization(self) -> int:
3165  """
3166  TODO: docstring
3167  """
3168  def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
3169  """
3170  Set the command matrix
3171 
3172  Args:
3173  cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3174  """
3175  def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
3176  """
3177  Set the interaction matrix
3178 
3179  Args:
3180  imat: (np.array[ndim=2,dtype=np.float32]): interaction matrix to set
3181  """
3182  def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
3183  """
3184  Set the controller modal gains
3185 
3186  Args:
3187  mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
3188  """
3189  def svdec_imat(self) -> int:
3190  """
3191  Performs interaction matrix SVD
3192  """
3193  @property
3194  def Fs(self) -> float:
3195  """
3196  Sampling frequency for modal optimization
3197 
3198  :type: float
3199  """
3200  @property
3201  def cpt_rec(self) -> int:
3202  """
3203  Counter for modal gains refresh
3204 
3205  :type: int
3206  """
3207  @property
3208  def d_Hcor(self) -> carmaWrap.obj_float:
3209  """
3210  Transfer function for modal optimization
3211 
3212  :type: carmaWrap.obj_float
3213  """
3214  @property
3215  def d_M2V(self) -> carmaWrap.obj_float:
3216  """
3217  Modes to volt matrix for modal optimization
3218 
3219  :type: carmaWrap.obj_float
3220  """
3221  @property
3222  def d_S2M(self) -> carmaWrap.obj_float:
3223  """
3224  Slopes to modes matrix for modal optimization
3225 
3226  :type: carmaWrap.obj_float
3227  """
3228  @property
3229  def d_U(self) -> carmaWrap.obj_float:
3230  """
3231  Eigen modes of the imat
3233  :type: carmaWrap.obj_float
3234  """
3235  @property
3236  def d_cenbuff(self) -> carmaWrap.obj_float:
3237  """
3238  Centroids circular buffer
3239 
3240  :type: carmaWrap.obj_float
3241  """
3242  @property
3243  def d_cmat(self) -> carmaWrap.obj_float:
3244  """
3245  Control matrix
3246 
3247  :type: carmaWrap.obj_float
3248  """
3249  @property
3250  def d_compbuff(self) -> carmaWrap.obj_float:
3251  """
3252  Buffer for POLC computation
3253 
3254  :type: carmaWrap.obj_float
3255  """
3256  @property
3257  def d_compbuff2(self) -> carmaWrap.obj_float:
3258  """
3259  Buffer for POLC computation
3260 
3261  :type: carmaWrap.obj_float
3262  """
3263  @property
3264  def d_eigenvals(self) -> carmaWrap.obj_float:
3265  """
3266  Eigen values of the imat
3267 
3268  :type: carmaWrap.obj_float
3269  """
3270  @property
3271  def d_err(self) -> carmaWrap.obj_float:
3272  """
3273  Current increment on the command
3274 
3275  :type: carmaWrap.obj_float
3276  """
3277  @property
3278  def d_gain(self) -> carmaWrap.obj_float:
3279  """
3280  vector of modal gains
3282  :type: carmaWrap.obj_float
3283  """
3284  @property
3285  def d_imat(self) -> carmaWrap.obj_float:
3286  """
3287  Interaction matrix
3288 
3289  :type: carmaWrap.obj_float
3290  """
3291  @property
3292  def d_slpol(self) -> carmaWrap.obj_float:
3293  """
3294  Open loop slopes for modal optimization
3295 
3296  :type: carmaWrap.obj_float
3297  """
3298  @property
3299  def gmax(self) -> float:
3300  """
3301  Maximal gain for modal optimization
3302 
3303  :type: float
3304  """
3305  @property
3306  def gmin(self) -> float:
3307  """
3308  Minimal gain for modal optimization
3309 
3310  :type: float
3311  """
3312  @property
3313  def is_modopti(self) -> int:
3314  """
3315  Falg for modal optimization
3316 
3317  :type: int
3318  """
3319  @property
3320  def ngain(self) -> int:
3321  """
3322  Number of gain values to test between gmin and gmax for modal optimization
3323 
3324  :type: int
3325  """
3326  @property
3327  def nmodes(self) -> int:
3328  """
3329  Number of modes for modal optimization
3330 
3331  :type: int
3332  """
3333  @property
3334  def nrec(self) -> int:
3335  """
3336  Number of open loop slopes to take for modal optimization
3337 
3338  :type: int
3339  """
3340  pass
3341 class ControllerMV_FF(Controller_FF):
3342  def build_cmat(self, cond: float) -> int:
3343  """
3344  Computes the command matrix
3345 
3346  Args:
3347  cond: (float): Conditioning number for inversion
3348  """
3349  def compute_Cmm(self, atmos: Atmos, sensors: Sensors, LO: numpy.ndarray[numpy.float64], Cn2: numpy.ndarray[numpy.float64], alphaX: numpy.ndarray[numpy.float64], alphaY: numpy.ndarray[numpy.float64], diamTel: float, cobs: float) -> int:
3350  """
3351  Compute the Cmm matrix
3352 
3353  Args:
3354  atmos : (SutraAtmos): SutraAtmos object
3355 
3356  sensors: (SutraSensors): SutraSensors object
3357 
3358  LO: (np.array[ndim=1,dtype=np.float64]): outer scale of each layer
3359 
3360  Cn2: (np.array[ndim=1,dtype=np.float64]): Cn2 profile
3361 
3362  alphaX: (np.array[ndim=1,dtype=np.float64]): X position of each WFS
3363 
3364  alphaY: (np.array[ndim=1,dtype=np.float64]): Y position of each WFS
3365 
3366  diamTel: (double): Telescope diameter
3367 
3368  cobs: (double): Central obstruction ratio
3369  """
3370  def compute_Cphim(self, atmos: Atmos, sensors: Sensors, dms: Dms, LO: numpy.ndarray[numpy.float64], Cn2: numpy.ndarray[numpy.float64], alphaX: numpy.ndarray[numpy.float64], alphaY: numpy.ndarray[numpy.float64], X: numpy.ndarray[numpy.float64], Y: numpy.ndarray[numpy.float64], xactu: numpy.ndarray[numpy.float64], yactu: numpy.ndarray[numpy.float64], diamTel: float, k2: numpy.ndarray[numpy.float64], NlayerDm: numpy.ndarray[numpy.int64], indLayerDm: numpy.ndarray[numpy.int64], FoV: float, pitch: numpy.ndarray[numpy.float64], alt_dm: numpy.ndarray[numpy.float64]) -> int:
3371  """
3372  Compute the Cphim matrix
3373 
3374  Args:
3375  atmos : (SutraAtmos): SutraAtmos object
3376 
3377  sensors: (SutraSensors): SutraSensors object
3378 
3379  dms: (SutraDms): SutraDms object
3381  LO: (np.array[ndim=1,dtype=np.float64]): outer scale of each layer
3382 
3383  Cn2: (np.array[ndim=1,dtype=np.float64]): Cn2 profile
3385  alphaX: (np.array[ndim=1,dtype=np.float64]): X position of each WFS
3386 
3387  alphaY: (np.array[ndim=1,dtype=np.float64]): Y position of each WFS
3388 
3389  X: (np.array[ndim=1,dtype=np.float64]): X position of each subaperture
3390 
3391  Y: (np.array[ndim=1,dtype=np.float64]): Y position of each subaperture
3392 
3393  xactu: (np.array[ndim=1,dtype=np.float64]): X position of each actuators
3394 
3395  yactu: (np.array[ndim=1,dtype=np.float64]): Y position of each actuators
3396 
3397  diamTel: (double): Telescope diameter
3398 
3399  k2: (np.array[ndim=1,dtype=np.float64]): scales
3400 
3401  NlayerDm: (np.array[ndim=1,dtype=np.int64]): Number of layers handled by each DM
3402 
3403  indLayerDm: (np.array[ndim=1,dtype=np.int64]): Indices of layers handled by each DM
3404 
3405  FoV: (double): Field of view
3406 
3407  pitch: (np.array[ndim=1,dtype=np.int64]): Pitch of each DM
3408 
3409  alt_dm: (np.array[ndim=1,dtype=np.int64]): Altitude of each DM
3410  """
3411  def filter_cmat(self, cond: float) -> int:
3412  """
3413  Filter command matrix from TT
3414 
3415  Args:
3416  cond: (float): TODO: docstring
3417  """
3418  def filter_cphim(self, F: numpy.ndarray[numpy.float32], Nact: numpy.ndarray[numpy.float32]) -> int:
3419  """
3420  Filter Cphim from piston and apply coupling
3422  Args:
3423  F: (np.array[ndim=2,dtype=np.float32]): Piston filter matrix
3424 
3425  Nact: (np.array[ndim=2,dtype=np.float32]): Coupling matrix
3426  """
3427  def load_noisemat(self, noisemat: numpy.ndarray[numpy.float32]) -> int:
3428  """
3429  Load the noise covariance matrix
3430 
3431  Args:
3432  noisemat: (float): noise covariance marix
3433  """
3434  def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
3435  """
3436  Set the command matrix
3437 
3438  Args:
3439  cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3440  """
3441  def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
3442  """
3443  Set the interaction matrix
3444 
3445  Args:
3446  imat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3447  """
3448  def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
3449  """
3450  Set the controller modal gains
3451 
3452  Args:
3453  mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
3454  """
3455  @property
3456  def d_Cmm(self) -> carmaWrap.obj_float:
3457  """
3458  Slope covariance matrix
3459 
3460  :type: carmaWrap.obj_float
3461  """
3462  @property
3463  def d_Cphim(self) -> carmaWrap.obj_float:
3464  """
3465  Actuators-Slopes covariance marix
3466 
3467  :type: carmaWrap.obj_float
3468  """
3469  @property
3470  def d_KLbasis(self) -> carmaWrap.obj_float:
3471  """
3472  KL basis
3473 
3474  :type: carmaWrap.obj_float
3475  """
3476  @property
3477  def d_cenbuff(self) -> carmaWrap.obj_float:
3478  """
3479  Centroids circular buffer
3481  :type: carmaWrap.obj_float
3482  """
3483  @property
3484  def d_cmat(self) -> carmaWrap.obj_float:
3485  """
3486  Control matrix
3487 
3488  :type: carmaWrap.obj_float
3489  """
3490  @property
3491  def d_com1(self) -> carmaWrap.obj_float:
3492  """
3493  Commands at iteration k-1 (for POLC)
3494 
3495  :type: carmaWrap.obj_float
3496  """
3497  @property
3498  def d_covmat(self) -> carmaWrap.obj_float:
3499  """
3500  TODO: docstring
3501 
3502  :type: carmaWrap.obj_float
3503  """
3504  @property
3505  def d_err(self) -> carmaWrap.obj_float:
3506  """
3507  Increment error
3508 
3509  :type: carmaWrap.obj_float
3510  """
3511  @property
3512  def d_gain(self) -> carmaWrap.obj_float:
3513  """
3514  vector of modal gains
3515 
3516  :type: carmaWrap.obj_float
3517  """
3518  @property
3519  def d_imat(self) -> carmaWrap.obj_float:
3520  """
3521  Interaction matrix
3522 
3523  :type: carmaWrap.obj_float
3524  """
3525  @property
3526  def d_noisemat(self) -> carmaWrap.obj_float:
3527  """
3528  Noise on WFS measurements matrix
3529 
3530  :type: carmaWrap.obj_float
3531  """
3532  @property
3533  def d_olmeas(self) -> carmaWrap.obj_float:
3534  """
3535  Reconstructed open loop measurement
3536 
3537  :type: carmaWrap.obj_float
3538  """
3539  @property
3540  def h_Cmmeigenvals(self) -> carmaWrap.host_obj_float:
3541  """
3542  Cmm eigenvalues
3544  :type: carmaWrap.host_obj_float
3545  """
3546  @property
3547  def h_eigenvals(self) -> carmaWrap.host_obj_float:
3548  """
3549  Eigen values
3550 
3551  :type: carmaWrap.host_obj_float
3552  """
3553  pass
3554 class ControllerMV_FU(Controller_FU):
3555  def build_cmat(self, cond: float) -> int:
3556  """
3557  Computes the command matrix
3558 
3559  Args:
3560  cond: (float): Conditioning number for inversion
3561  """
3562  def compute_Cmm(self, atmos: Atmos, sensors: Sensors, LO: numpy.ndarray[numpy.float64], Cn2: numpy.ndarray[numpy.float64], alphaX: numpy.ndarray[numpy.float64], alphaY: numpy.ndarray[numpy.float64], diamTel: float, cobs: float) -> int:
3563  """
3564  Compute the Cmm matrix
3565 
3566  Args:
3567  atmos : (SutraAtmos): SutraAtmos object
3568 
3569  sensors: (SutraSensors): SutraSensors object
3571  LO: (np.array[ndim=1,dtype=np.float64]): outer scale of each layer
3572 
3573  Cn2: (np.array[ndim=1,dtype=np.float64]): Cn2 profile
3574 
3575  alphaX: (np.array[ndim=1,dtype=np.float64]): X position of each WFS
3576 
3577  alphaY: (np.array[ndim=1,dtype=np.float64]): Y position of each WFS
3578 
3579  diamTel: (double): Telescope diameter
3580 
3581  cobs: (double): Central obstruction ratio
3582  """
3583  def compute_Cphim(self, atmos: Atmos, sensors: Sensors, dms: Dms, LO: numpy.ndarray[numpy.float64], Cn2: numpy.ndarray[numpy.float64], alphaX: numpy.ndarray[numpy.float64], alphaY: numpy.ndarray[numpy.float64], X: numpy.ndarray[numpy.float64], Y: numpy.ndarray[numpy.float64], xactu: numpy.ndarray[numpy.float64], yactu: numpy.ndarray[numpy.float64], diamTel: float, k2: numpy.ndarray[numpy.float64], NlayerDm: numpy.ndarray[numpy.int64], indLayerDm: numpy.ndarray[numpy.int64], FoV: float, pitch: numpy.ndarray[numpy.float64], alt_dm: numpy.ndarray[numpy.float64]) -> int:
3584  """
3585  Compute the Cphim matrix
3586 
3587  Args:
3588  atmos : (SutraAtmos): SutraAtmos object
3589 
3590  sensors: (SutraSensors): SutraSensors object
3591 
3592  dms: (SutraDms): SutraDms object
3593 
3594  LO: (np.array[ndim=1,dtype=np.float64]): outer scale of each layer
3595 
3596  Cn2: (np.array[ndim=1,dtype=np.float64]): Cn2 profile
3598  alphaX: (np.array[ndim=1,dtype=np.float64]): X position of each WFS
3599 
3600  alphaY: (np.array[ndim=1,dtype=np.float64]): Y position of each WFS
3601 
3602  X: (np.array[ndim=1,dtype=np.float64]): X position of each subaperture
3603 
3604  Y: (np.array[ndim=1,dtype=np.float64]): Y position of each subaperture
3605 
3606  xactu: (np.array[ndim=1,dtype=np.float64]): X position of each actuators
3607 
3608  yactu: (np.array[ndim=1,dtype=np.float64]): Y position of each actuators
3609 
3610  diamTel: (double): Telescope diameter
3611 
3612  k2: (np.array[ndim=1,dtype=np.float64]): scales
3613 
3614  NlayerDm: (np.array[ndim=1,dtype=np.int64]): Number of layers handled by each DM
3616  indLayerDm: (np.array[ndim=1,dtype=np.int64]): Indices of layers handled by each DM
3617 
3618  FoV: (double): Field of view
3619 
3620  pitch: (np.array[ndim=1,dtype=np.int64]): Pitch of each DM
3621 
3622  alt_dm: (np.array[ndim=1,dtype=np.int64]): Altitude of each DM
3623  """
3624  def filter_cmat(self, cond: float) -> int:
3625  """
3626  Filter command matrix from TT
3627 
3628  Args:
3629  cond: (float): TODO: docstring
3630  """
3631  def filter_cphim(self, F: numpy.ndarray[numpy.float32], Nact: numpy.ndarray[numpy.float32]) -> int:
3632  """
3633  Filter Cphim from piston and apply coupling
3634 
3635  Args:
3636  F: (np.array[ndim=2,dtype=np.float32]): Piston filter matrix
3638  Nact: (np.array[ndim=2,dtype=np.float32]): Coupling matrix
3639  """
3640  def load_noisemat(self, noisemat: numpy.ndarray[numpy.float32]) -> int:
3641  """
3642  Load the noise covariance matrix
3643 
3644  Args:
3645  noisemat: (float): noise covariance marix
3646  """
3647  def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
3648  """
3649  Set the command matrix
3650 
3651  Args:
3652  cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3653  """
3654  def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
3655  """
3656  Set the interaction matrix
3657 
3658  Args:
3659  imat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3660  """
3661  def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
3662  """
3663  Set the controller modal gains
3664 
3665  Args:
3666  mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
3667  """
3668  @property
3669  def d_Cmm(self) -> carmaWrap.obj_float:
3670  """
3671  Slope covariance matrix
3672 
3673  :type: carmaWrap.obj_float
3674  """
3675  @property
3676  def d_Cphim(self) -> carmaWrap.obj_float:
3677  """
3678  Actuators-Slopes covariance marix
3679 
3680  :type: carmaWrap.obj_float
3681  """
3682  @property
3683  def d_KLbasis(self) -> carmaWrap.obj_float:
3684  """
3685  KL basis
3686 
3687  :type: carmaWrap.obj_float
3688  """
3689  @property
3690  def d_cenbuff(self) -> carmaWrap.obj_float:
3691  """
3692  Centroids circular buffer
3693 
3694  :type: carmaWrap.obj_float
3695  """
3696  @property
3697  def d_cmat(self) -> carmaWrap.obj_float:
3698  """
3699  Control matrix
3700 
3701  :type: carmaWrap.obj_float
3702  """
3703  @property
3704  def d_com1(self) -> carmaWrap.obj_float:
3705  """
3706  Commands at iteration k-1 (for POLC)
3707 
3708  :type: carmaWrap.obj_float
3709  """
3710  @property
3711  def d_covmat(self) -> carmaWrap.obj_float:
3712  """
3713  TODO: docstring
3714 
3715  :type: carmaWrap.obj_float
3716  """
3717  @property
3718  def d_err(self) -> carmaWrap.obj_float:
3719  """
3720  Increment error
3721 
3722  :type: carmaWrap.obj_float
3723  """
3724  @property
3725  def d_gain(self) -> carmaWrap.obj_float:
3726  """
3727  vector of modal gains
3728 
3729  :type: carmaWrap.obj_float
3730  """
3731  @property
3732  def d_imat(self) -> carmaWrap.obj_float:
3733  """
3734  Interaction matrix
3735 
3736  :type: carmaWrap.obj_float
3737  """
3738  @property
3739  def d_noisemat(self) -> carmaWrap.obj_float:
3740  """
3741  Noise on WFS measurements matrix
3743  :type: carmaWrap.obj_float
3744  """
3745  @property
3746  def d_olmeas(self) -> carmaWrap.obj_float:
3747  """
3748  Reconstructed open loop measurement
3749 
3750  :type: carmaWrap.obj_float
3751  """
3752  @property
3753  def h_Cmmeigenvals(self) -> carmaWrap.host_obj_float:
3754  """
3755  Cmm eigenvalues
3756 
3757  :type: carmaWrap.host_obj_float
3758  """
3759  @property
3760  def h_eigenvals(self) -> carmaWrap.host_obj_float:
3761  """
3762  Eigen values
3763 
3764  :type: carmaWrap.host_obj_float
3765  """
3766  pass
3767 class ControllerCURED_FF(Controller_FF):
3768  def init_cured(self, nxsub: int, isvalid: numpy.ndarray[numpy.int32], ndivs: int, tt: int) -> int:
3769  """
3770  Initialize CURED
3771 
3772  Args:
3773  nxsub: (int): TODO: docstring
3774 
3775  isvalid:
3776 
3777  ndivs: (int):
3779  tt: (int):
3780  """
3781  @property
3782  def d_cenbuff(self) -> carmaWrap.obj_float:
3783  """
3784  Centroids circular buffer
3785 
3786  :type: carmaWrap.obj_float
3787  """
3788  @property
3789  def d_err(self) -> carmaWrap.obj_float:
3790  """
3791  Increment error
3792 
3793  :type: carmaWrap.obj_float
3794  """
3795  @property
3796  def d_imat(self) -> carmaWrap.obj_float:
3797  """
3798  Interaction matrix
3799 
3800  :type: carmaWrap.obj_float
3801  """
3802  @property
3803  def h_centroids(self) -> carmaWrap.host_obj_float:
3804  """
3805  Centroids
3806 
3807  :type: carmaWrap.host_obj_float
3808  """
3809  @property
3810  def h_err(self) -> carmaWrap.host_obj_float:
3811  """
3812  Increment error
3813 
3814  :type: carmaWrap.host_obj_float
3815  """
3816  @property
3817  def ndivs(self) -> int:
3818  """
3819  Number of subdivision levels
3820 
3821  :type: int
3822  """
3823  @property
3824  def tt_flag(self) -> bool:
3825  """
3826  Flag to separate TT
3827 
3828  :type: bool
3829  """
3830  pass
3831 class ControllerCURED_FU(Controller_FU):
3832  def init_cured(self, nxsub: int, isvalid: numpy.ndarray[numpy.int32], ndivs: int, tt: int) -> int:
3833  """
3834  Initialize CURED
3835 
3836  Args:
3837  nxsub: (int): TODO: docstring
3838 
3839  isvalid:
3840 
3841  ndivs: (int):
3842 
3843  tt: (int):
3844  """
3845  @property
3846  def d_cenbuff(self) -> carmaWrap.obj_float:
3847  """
3848  Centroids circular buffer
3849 
3850  :type: carmaWrap.obj_float
3851  """
3852  @property
3853  def d_err(self) -> carmaWrap.obj_float:
3854  """
3855  Increment error
3856 
3857  :type: carmaWrap.obj_float
3858  """
3859  @property
3860  def d_imat(self) -> carmaWrap.obj_float:
3861  """
3862  Interaction matrix
3863 
3864  :type: carmaWrap.obj_float
3865  """
3866  @property
3867  def h_centroids(self) -> carmaWrap.host_obj_float:
3868  """
3869  Centroids
3870 
3871  :type: carmaWrap.host_obj_float
3872  """
3873  @property
3874  def h_err(self) -> carmaWrap.host_obj_float:
3875  """
3876  Increment error
3878  :type: carmaWrap.host_obj_float
3879  """
3880  @property
3881  def ndivs(self) -> int:
3882  """
3883  Number of subdivision levels
3884 
3885  :type: int
3886  """
3887  @property
3888  def tt_flag(self) -> bool:
3889  """
3890  Flag to separate TT
3891 
3892  :type: bool
3893  """
3894  pass
3895 class Coronagraph():
3896  def compute_electric_field(self, arg0: int) -> int:
3897  """
3898  Computes the electric field from the specified wavelength
3899 
3900  Args:
3901  wavelengthIndex: (int): Index of the wavelength to use
3902  """
3903  def compute_image(self, accumulate: bool = True) -> int:
3904  """
3905  Computes the coronagraphic image from the source phase screen
3906 
3907  Args:
3908  accumulate: (bool, optionnal): If True (default), accumulate the short exposure image in the long exposure one
3909  """
3910  def compute_psf(self, accumulate: bool = True) -> int:
3911  """
3912  Computes the psf from the source phase screen
3913 
3914  Args:
3915  accumulate: (bool, optionnal): If True (default), accumulate the short exposure psf in the long exposure one
3916  """
3917  def reset(self) -> int:
3918  """
3919  Reset long exposure image and counter
3920  """
3921  def set_amplitude(self, arg0: numpy.ndarray[numpy.float32]) -> int:
3922  """
3923  Set the electric field amplitude
3924 
3925  Args:
3926  amplitude: (np.ndarray[ndim=3, dtype=np.float32]): electric field amplitude
3927  """
3928  @property
3929  def amplitude(self) -> typing.List[carmaWrap.obj_float]:
3930  """
3931  Electric field amplitude in the pupil
3932 
3933  :type: typing.List[carmaWrap.obj_float]
3934  """
3935  @property
3936  def cntImg(self) -> int:
3937  """
3938  Accumulation counter of coronagraphic images
3939 
3940  :type: int
3941  """
3942  @property
3943  def cntPsf(self) -> int:
3944  """
3945  Accumulation counter of psf
3946 
3947  :type: int
3948  """
3949  @property
3950  def d_complex_image(self) -> carmaWrap.obj_float_complex:
3951  """
3952  Complex coronagraphic image
3953 
3954  :type: carmaWrap.obj_float_complex
3955  """
3956  @property
3957  def d_electric_field(self) -> carmaWrap.obj_float_complex:
3958  """
3959  Electric field in the pupil
3960 
3961  :type: carmaWrap.obj_float_complex
3962  """
3963  @property
3964  def d_image_le(self) -> carmaWrap.obj_float:
3965  """
3966  Long exposure coronagraphic image
3967 
3968  :type: carmaWrap.obj_float
3969  """
3970  @property
3971  def d_image_se(self) -> carmaWrap.obj_float:
3972  """
3973  Short exposure coronagraphic image
3974 
3975  :type: carmaWrap.obj_float
3976  """
3977  @property
3978  def d_psf_le(self) -> carmaWrap.obj_float:
3979  """
3980  Long exposure coronagraphic psf
3981 
3982  :type: carmaWrap.obj_float
3983  """
3984  @property
3985  def d_psf_se(self) -> carmaWrap.obj_float:
3986  """
3987  Short exposure coronagraphic psf
3988 
3989  :type: carmaWrap.obj_float
3990  """
3991  @property
3992  def d_pupil(self) -> carmaWrap.obj_float:
3993  """
3994  Telescope pupil
3995 
3996  :type: carmaWrap.obj_float
3997  """
3998  @property
3999  def d_source(self) -> Source:
4000  """
4001  SutraSource used as OPD input
4002 
4003  :type: Source
4004  """
4005  @property
4006  def device(self) -> int:
4007  """
4008  GPU device index
4009 
4010  :type: int
4011  """
4012  @property
4013  def imageDimx(self) -> int:
4014  """
4015  Coronagraphic image dimension along X-axis
4016 
4017  :type: int
4018  """
4019  @property
4020  def imageDimy(self) -> int:
4021  """
4022  Coronagraphic image dimension along Y-axis
4023 
4024  :type: int
4025  """
4026  @property
4027  def pupDimx(self) -> int:
4028  """
4029  Pupil dimension along X-axis
4030 
4031  :type: int
4032  """
4033  @property
4034  def pupDimy(self) -> int:
4035  """
4036  Pupil dimension along Y-axis
4038  :type: int
4039  """
4040  @property
4041  def type(self) -> str:
4042  """
4043  Coronagraph type
4044 
4045  :type: str
4046  """
4047  @property
4048  def wavelength(self) -> typing.List[float]:
4049  """
4050  Vector of wavelength used to compute coronagraphic image
4051 
4052  :type: typing.List[float]
4053  """
4054  pass
4055 class Dm():
4056  def __str__(self) -> str: ...
4057  def comp_oneactu(self, nactu: int, ampli: float) -> int:
4058  """
4059  Push the specified actuator and computes the corresponding DM shape
4060 
4061  Args:
4062  nactu: (int): Actuator index
4063 
4064  ampli: (float): Volt to apply to this actuator
4065 
4066  """
4067  @typing.overload
4068  def comp_shape(self) -> int:
4069  """
4070  Compute the DM shape according to commands d_com
4071 
4072 
4074  Compute the DM shape according to given commands
4075 
4076  Args:
4077  com: (np.ndarray[ndim=1,dtype=np.float32_t]): commands to apply
4078 
4079 
4080 
4081 
4082  Compute the DM shape according to given commands
4083 
4084  Args:
4085  com: (np.ndarray[ndim=1,dtype=np.uint16_t]): commands to apply
4086 
4087 
4088  """
4089  @typing.overload
4090  def comp_shape(self, com: numpy.ndarray[numpy.float32]) -> int: ...
4091  @typing.overload
4092  def comp_shape(self, com: numpy.ndarray[numpy.uint16]) -> int: ...
4093  def compute_KLbasis(self, xpos: numpy.ndarray[numpy.float32], ypos: numpy.ndarray[numpy.float32], indx_pup: numpy.ndarray[numpy.int32], dim: int, norm: float, ampli: float) -> int:
4094  """
4095  Computes the KL to volt matrix by double diagonalisation (cf. Gendron thesis)
4096  - compute the phase covariance matrix on the actuators using Kolmogorov
4097  - compute the geometric covariance matrix
4098  - double diagonalisation to obtain KL basis
4099 
4100  Args:
4101  xpos: (np.ndarray[ndim=1,dtype=np.float32_t]) : x-position of actuators
4102 
4103  ypos: (np.ndarray[ndim=1,dtype=np.float32_t]) : y-position of actuators
4104 
4105  indx_pup: (np.ndarray[ndim=1,dtype=np.int32_t]) : indices of pupil points
4106 
4107  dim: (long) : number of points in the pupil
4108 
4109  norm: (float) : normalization factor
4110 
4111  ampli: (float) : amplitude
4112 
4113  """
4114  def kl_loadarrays(self, rabas: numpy.ndarray[numpy.float32], azbas: numpy.ndarray[numpy.float32], ords: numpy.ndarray[numpy.int32], cr: numpy.ndarray[numpy.float32], cp: numpy.ndarray[numpy.float32]) -> int:
4115  """
4116  Load all the arrays computed during the initialization for a kl DM in a SutraDm object
4117 
4118  Args:
4119  rabas: (np.ndarray[ndim=1,dtype=np.float32_t]): TODO docstring
4120 
4121  azbas: (np.ndarray[ndim=1,dtype=np.float32_t]):
4122 
4123  ords: (np.ndarray[ndim=1,dtype=np.int32_t]):
4124 
4125  cr: (np.ndarray[ndim=1,dtype=np.float32_t]):
4126 
4127  cp: (np.ndarray[ndim=1,dtype=np.float32_t]):
4128 
4129  """
4130  def pzt_loadarrays(self, influ: numpy.ndarray[numpy.float32], influpos: numpy.ndarray[numpy.int32], npoints: numpy.ndarray[numpy.int32], istart: numpy.ndarray[numpy.int32], xoff: numpy.ndarray[numpy.int32], yoff: numpy.ndarray[numpy.int32]) -> int:
4131  """
4132  Load all the arrays computed during the initialization for a pzt DM in a SutraDm object
4133 
4134  Args:
4135  influ: (np.ndarray[ndim=3,dtype=np.float32_t]) : influence functions cube
4136 
4137  influ2:
4139  influ3:
4140 
4141  influpos: (np.ndarray[ndim=1,dtype=np.int32_t]) : positions of the IF in the pupil
4142 
4143  influpos2:
4144 
4145  npoints: (np.ndarray[ndim=1,dtype=np.int32_t]) : for each pixel on the DM screen, the number of IF which impact on this pixel
4146 
4147  istart: (np.ndarray[ndim=1,dtype=np.int32_t]) :
4148 
4149  xoff: (np.ndarray[ndim=1,dtype=np.int32_t]) : x-offset for shape computation
4150 
4151  yoff: (np.ndarray[ndim=1,dtype=np.int32_t]) : y-offset or shape computation
4152 
4153  """
4154  def reset_shape(self) -> int:
4155  """
4156  Reset the DM shape to zeros (flat)
4157  """
4158  def set_com(self, com: numpy.ndarray[numpy.float32], shape_dm: bool = True) -> None:
4159  """
4160  Set the command vector of a SutraDm, and computes the DM shape
4161 
4162  Args:
4163  com: (np.array(ndim=1, dtype=np.float32)): Command vector
4164 
4165  shape_dm: (bool): (optionnal, default=True) Computes the DM shape
4166 
4167  """
4168  def set_registration(self, dx: float, dy: float, theta: float, G: float) -> int:
4169  """
4170  Set the registration parameters : dx, dy, theta and G
4171 
4172  Args:
4173  dx: (float): X axis misregistration [pixels]
4174 
4175  dy: (float): Y axis misregistration [pixels]
4176 
4177  theta: (float): Rotation angle misregistration [radians]
4178 
4179  G: (float): Magnification factor
4180 
4181  """
4182  def tt_loadarrays(self, influ: numpy.ndarray[numpy.float32]) -> int:
4183  """
4184  Load all the arrays computed during the initialization for a tt DM in a SutraDm object
4185 
4186  Args:
4187  influ: (np.ndarray[ndim=3,dtype=np.float32_t]) : influence functions cube
4188 
4189  """
4190  @property
4191  def G(self) -> float:
4192  """
4193  Magnification factor registration in pixels
4194 
4195  :type: float
4196  """
4197  @property
4198  def altitude(self) -> float:
4199  """
4200  DM conjugaison altitude
4201 
4202  :type: float
4203  """
4204  @property
4205  def d_KLbasis(self) -> carmaWrap.obj_float:
4206  """
4207  KL to volts matrix
4208 
4209  :type: carmaWrap.obj_float
4210  """
4211  @property
4212  def d_com(self) -> carmaWrap.obj_float:
4213  """
4214  Current commands of the DM
4215 
4216  :type: carmaWrap.obj_float
4217  """
4218  @property
4219  def d_influ(self) -> carmaWrap.obj_float:
4220  """
4221  Cube of influence functions
4222 
4223  :type: carmaWrap.obj_float
4224  """
4225  @property
4226  def d_influpos(self) -> carmaWrap.obj_int:
4227  """
4228  Influence functions positions in the pupil
4229 
4230  :type: carmaWrap.obj_int
4231  """
4232  @property
4233  def d_istart(self) -> carmaWrap.obj_int:
4234  """
4235  TODO: docstring
4236 
4237  :type: carmaWrap.obj_int
4238  """
4239  @property
4240  def d_kl(self) -> SutraKL:
4241  """
4242  SutraKL DM
4243 
4244  :type: SutraKL
4245  """
4246  @property
4247  def d_npoints(self) -> carmaWrap.obj_int:
4248  """
4249  Number of IF that impact each pixel of the pupil
4250 
4251  :type: carmaWrap.obj_int
4252  """
4253  @property
4254  def d_shape(self) -> carmaWrap.obj_float:
4255  """
4256  DM shape
4257 
4258  :type: carmaWrap.obj_float
4259  """
4260  @property
4261  def d_xoff(self) -> carmaWrap.obj_int:
4262  """
4263  TODO: docstring
4264 
4265  :type: carmaWrap.obj_int
4266  """
4267  @property
4268  def d_yoff(self) -> carmaWrap.obj_int:
4269  """
4270  TODO: docstring
4271 
4272  :type: carmaWrap.obj_int
4273  """
4274  @property
4275  def device(self) -> int:
4276  """
4277  Device index
4279  :type: int
4280  """
4281  @property
4282  def dim(self) -> int:
4283  """
4284  DM support size
4285 
4286  :type: int
4287  """
4288  @property
4289  def dx(self) -> float:
4290  """
4291  X registration in pixels
4292 
4293  :type: float
4294  """
4295  @property
4296  def dy(self) -> float:
4297  """
4298  Y registration in pixels
4299 
4300  :type: float
4301  """
4302  @property
4303  def influsize(self) -> int:
4304  """
4305  Influence function support size
4306 
4307  :type: int
4308  """
4309  @property
4310  def nactus(self) -> int:
4311  """
4312  Number of actuators
4313 
4314  :type: int
4315  """
4316  @property
4317  def push4imat(self) -> float:
4318  """
4319  Voltage to apply for imat computation
4320 
4321  :type: float
4322  """
4323  @property
4324  def thetaML(self) -> float:
4325  """
4326  thetaML registration in radians
4327 
4328  :type: float
4329  """
4330  @property
4331  def type(self) -> str:
4332  """
4333  DM type
4334 
4335  :type: str
4336  """
4337  pass
4338 class Dms():
4339  def __init__(self) -> None:
4340  """
4341  Create a void DMS object
4342  """
4343  def __str__(self) -> str: ...
4344  @typing.overload
4345  def add_dm(self, context: carmaWrap.context, type: str, alt: float, dim: int, nactus: int, influsize: int, ninflupos: int, n_npoints: int, push4imat: float, nord: int, dx: float, dy: float, thetaML: float, G: float, device: int) -> int:
4346  """
4347  Add a SutraDm in the SutraDms vector
4348 
4349  Args:
4350  context: (CarmaContext) : current carma context
4351 
4352  type: (str): DM type ("pzt", "kl", or "tt")
4353 
4354  alt: (float): Conjugaison altitude in meters
4355 
4356  dim: (long): Support dimension
4357 
4358  nactus: (long): Number of actuators
4360  influsize: (long): Influenction function support size
4361 
4362  ninflupos: (long): Size of _influpos array
4363 
4364  n_npoints: (long): Size of _ninflu array
4365 
4366  push4imat: (float): Voltage to apply for imat computation
4367 
4368  nord: (long): Number of radial order for kl dm (0 if not kl)
4369 
4370  dx: (float): X axis misregistration [pixels]
4371 
4372  dy: (float): Y axis misregistration [pixels]
4373 
4374  theta: (float): Rotation angle misregistration [radians]
4375 
4376  G: (float): Magnification factor
4377 
4378  device: (int): Device index
4379 
4380 
4381 
4382  Add a SutraDm in the SutraDms vector
4383 
4384  Args:
4385  context: (CarmaContext) : current carma context
4386 
4387  type: (str): DM type ("pzt", "kl", or "tt")
4388 
4389  alt: (float): Conjugaison altitude in meters
4390 
4391  dim: (long): Support dimension
4393  nactus: (long): Number of actuators
4394 
4395  influsize: (long): Influenction function support size
4396 
4397  ninflupos: (long): Size of _influpos array
4398 
4399  n_npoints: (long): Size of _ninflu array
4400 
4401  push4imat: (float): Voltage to apply for imat computation
4402 
4403  nord: (long): Number of radial order for kl dm (0 if not kl)
4404 
4405  device: (int): Device index
4406 
4407  """
4408  @typing.overload
4409  def add_dm(self, context: carmaWrap.context, type: str, alt: float, dim: int, nactus: int, influsize: int, ninflupos: int, n_npoints: int, push4imat: float, nord: int, device: int) -> int: ...
4410  def insert_dm(self, context: carmaWrap.context, type: str, alt: float, dim: int, nactus: int, influsize: int, ninflupos: int, n_npoints: int, push4imat: float, nord: int, dx: float, dy: float, theta: float, G: float, device: int, idx: int) -> int:
4411  """
4412  Add a SutraDm in the SutraDms vector at the specified index
4413 
4414  Args:
4415  context: (CarmaContext) : current carma context
4416 
4417  type: (str): DM type ("pzt", "kl", or "tt")
4418 
4419  alt: (float): Conjugaison altitude in meters
4420 
4421  dim: (long): Support dimension
4422 
4423  nactus: (long): Number of actuators
4424 
4425  influsize: (long): Influenction function support size
4426 
4427  ninflupos: (long): Size of _influpos array
4429  n_npoints: (long): Size of _ninflu array
4430 
4431  push4imat: (float): Voltage to apply for imat computation
4432 
4433  nord: (long): Number of radial order for kl dm (0 if not kl)
4434 
4435  dx: (float): X axis misregistration [pixels]
4436 
4437  dy: (float): Y axis misregistration [pixels]
4438 
4439  theta: (float): Rotation angle misregistration [radians]
4440 
4441  G: (float): Magnification factor
4442 
4443  device: (int): Device index
4444 
4445  idx: (int) : DM index in the vector dms
4447  """
4448  def remove_dm(self, idx: int) -> int:
4449  """
4450  Remove and delete the selected DM from SutraDms
4451 
4452  Args:
4453  idx: (int): index of DM
4454 
4455  """
4456  def set_full_com(self, com: numpy.ndarray[numpy.float32], shape_dm: bool = True) -> None:
4457  """
4458  Set the command vector of all DM in SutraDms, and computes the DMs shapes
4459 
4460  Args:
4461  com: (np.array(ndim=1, dtype=np.float32)): Concatened command vectors
4462 
4463  shape_dm: (bool): (optionnal, default=True) Computes the DM shape
4464 
4465  """
4466  @property
4467  def d_dms(self) -> typing.List[SutraDm]:
4468  """
4469  Vector of SutraDm
4471  :type: typing.List[SutraDm]
4472  """
4473  @property
4474  def nact_total(self) -> int:
4475  """
4476  Total number of actuators in SutraDms
4477 
4478  :type: int
4479  """
4480  @property
4481  def ndm(self) -> int:
4482  """
4483  Number of SutraDm in SutraDms
4484 
4485  :type: int
4486  """
4487  pass
4488 class Gamora():
4489  def __init__(self, context: carmaWrap.context, device: int, type: str, nactus: int, nmodes: int, niter: int, IFvalue: numpy.ndarray[numpy.float32], IFrowind: numpy.ndarray[numpy.int32], IFcolind: numpy.ndarray[numpy.int32], IFnz: int, TT: numpy.ndarray[numpy.float32], spupil: numpy.ndarray[numpy.float32], size: int, Npts: int, scale: float, Btt: numpy.ndarray[numpy.float32], covmodes: numpy.ndarray[numpy.float32]) -> None:
4490  """
4491  Initializes Gamora
4492 
4493  Args:
4494  context: (CarmaContext): context
4495 
4496  device: (int): context active device
4498  type : (str) : reconstruction method used ("roket" or "Vii")
4499 
4500  nactus : (int) : number of actuators
4501 
4502  nmodes (int) : number of modes
4503 
4504  niter : (int) : number of iterations performed with roket
4505 
4506  IFvalue : (np.ndarray[ndim=1,dtype=float32_t]) : Non zeros values of pzt influence function matrix
4507 
4508  IFrowind : (np.ndarray[ndim=1,dtype=int32_t]) : Row indices of nnz values (csr sparse format)
4509 
4510  IFcolind : (np.ndarray[ndim=1,dtype=int32_t]) : Column indices of nnz values (csr sparse format)
4511 
4512  IFnz: (int): number of non zero element in IF
4513 
4514  TT : (np.ndarray[ndim=1,dtype=float32_t])np.ndarray[ndim=1,dtype=float32_t]) : Tip-tilt influence functions
4516  spupil : (np.ndarray[ndim=2,dtype=float32_t]) : Small pupil
4517 
4518  size: (int): pupil size
4519 
4520  Npts: (int): number of points in the pupil
4521 
4522  scale : (float) : 2*pi/lambda_target with lambda_target expressed in microns
4523 
4524  Btt : (np.ndarray[ndim=2, dtype=np.float32_t]) : Volts to Btt modes matrix
4525 
4526  covmodes : (np.ndarray[ndim=2, dtype=np.float32_t]) : error covariance matrix expressed in a modal basis
4527 
4528  """
4529  def psf_rec_Vii(self) -> int:
4530  """
4531  Vii PSF reconstruction
4532  """
4533  def psf_rec_roket(self, err: numpy.ndarray[numpy.float32]) -> int:
4534  """
4535  Reconstruct the PSF from ROKET error buffer
4536 
4537  Args:
4538  err: (np.array[ndim=2,dtype=np.float32]): ROKET error buffer
4539  """
4540  @property
4541  def Npts(self) -> int:
4542  """
4543  number of points in the pupil
4544 
4545  :type: int
4546  """
4547  @property
4548  def d_Btt(self) -> carmaWrap.obj_float:
4549  """
4550  Btt modal basis
4551 
4552  :type: carmaWrap.obj_float
4553  """
4554  @property
4555  def d_Dphi(self) -> carmaWrap.obj_float_complex:
4556  """
4557  Structure function
4558 
4559  :type: carmaWrap.obj_float_complex
4560  """
4561  @property
4562  def d_IF(self) -> carmaWrap.sparse_obj_float:
4563  """
4564  sparse IF matrix
4565 
4566  :type: carmaWrap.sparse_obj_float
4567  """
4568  @property
4569  def d_TT(self) -> carmaWrap.obj_float:
4570  """
4571  tip-tilt IF matrix
4572 
4573  :type: carmaWrap.obj_float
4574  """
4575  @property
4576  def d_amplipup(self) -> carmaWrap.obj_float_complex:
4577  """
4578  Complex amplitude in the pupil
4579 
4580  :type: carmaWrap.obj_float_complex
4581  """
4582  @property
4583  def d_covmodes(self) -> carmaWrap.obj_float:
4584  """
4585  error covariance marix on the modes
4586 
4587  :type: carmaWrap.obj_float
4588  """
4589  @property
4590  def d_eigenvals(self) -> carmaWrap.obj_float:
4591  """
4592  Eigenvalues of Vii diago
4593 
4594  :type: carmaWrap.obj_float
4595  """
4596  @property
4597  def d_err(self) -> carmaWrap.obj_float:
4598  """
4599  Error buffer
4600 
4601  :type: carmaWrap.obj_float
4602  """
4603  @property
4604  def d_mask(self) -> carmaWrap.obj_float:
4605  """
4606  Mask
4607 
4608  :type: carmaWrap.obj_float
4609  """
4610  @property
4611  def d_newmodek(self) -> carmaWrap.obj_float_complex:
4612  """
4613  Mode k from Vii
4614 
4615  :type: carmaWrap.obj_float_complex
4616  """
4617  @property
4618  def d_otfVii(self) -> carmaWrap.obj_float:
4619  """
4620  OTF reconstructed from Vii
4622  :type: carmaWrap.obj_float
4623  """
4624  @property
4625  def d_otftel(self) -> carmaWrap.obj_float:
4626  """
4627  OTF of the telescope
4628 
4629  :type: carmaWrap.obj_float
4630  """
4631  @property
4632  def d_phase(self) -> carmaWrap.obj_float:
4633  """
4634  Residual phase
4635 
4636  :type: carmaWrap.obj_float
4637  """
4638  @property
4639  def d_psf(self) -> carmaWrap.obj_float:
4640  """
4641  Reconstructed PSF
4642 
4643  :type: carmaWrap.obj_float
4644  """
4645  @property
4646  def d_pupfft(self) -> carmaWrap.obj_float_complex:
4647  """
4648  FFT of the pupil
4649 
4650  :type: carmaWrap.obj_float_complex
4651  """
4652  @property
4653  def d_term1(self) -> carmaWrap.obj_float:
4654  """
4655  Buffer for Vii computation
4656 
4657  :type: carmaWrap.obj_float
4658  """
4659  @property
4660  def d_term2(self) -> carmaWrap.obj_float:
4661  """
4662  Buffer for Vii computation
4663 
4664  :type: carmaWrap.obj_float
4665  """
4666  @property
4667  def d_wherephase(self) -> carmaWrap.obj_int:
4668  """
4669  index of valid point
4670 
4671  :type: carmaWrap.obj_int
4672  """
4673  @property
4674  def device(self) -> int:
4675  """
4676  GPU device
4677 
4678  :type: int
4679  """
4680  @property
4681  def nactus(self) -> int:
4682  """
4683  Number of actuators
4685  :type: int
4686  """
4687  @property
4688  def niter(self) -> int:
4689  """
4690  number of iterations
4691 
4692  :type: int
4693  """
4694  @property
4695  def nmodes(self) -> int:
4696  """
4697  number of modes
4698 
4699  :type: int
4700  """
4701  @property
4702  def scale(self) -> float:
4703  """
4704  Scale factor
4705 
4706  :type: float
4707  """
4708  @property
4709  def size(self) -> int:
4710  """
4711  Pupil support size
4712 
4713  :type: int
4714  """
4715  pass
4716 class Groot():
4717  @typing.overload
4718  def __init__(self, context: carmaWrap.context, device: int, nssp: int, nlayers: int, gsangle: float, vdt: numpy.ndarray[numpy.float32], Htheta: numpy.ndarray[numpy.float32], L0: numpy.ndarray[numpy.float32], winddir: numpy.ndarray[numpy.float32], scale: numpy.ndarray[numpy.float32], pzt2tt: numpy.ndarray[numpy.float32], TTPfilter: numpy.ndarray[numpy.float32], Nact: numpy.ndarray[numpy.float32], xpos: numpy.ndarray[numpy.float32], ypos: numpy.ndarray[numpy.float32], fc: float) -> None:
4719  """
4720  Initializes Groot to compute aniso and bandwidth model
4721 
4722  Args:
4723  context: (CarmaContext): context
4725  device: (int): context active device
4726 
4727  nssp : (str) :
4728 
4729  nlayers:
4730 
4731  gsangle:
4732 
4733  vdt:
4734 
4735  Htheta:
4736 
4737  L0:
4738 
4739  winddir:
4740 
4741  scale:
4742 
4743  pzt2tt:
4744 
4745  TTPfilter:
4746 
4747  Nact:
4748 
4749  xpos:
4750 
4751  ypos:
4752 
4753  fc:
4754 
4755 
4756 
4757  Initializes Groot to compute aliasing model
4758 
4759  Args:
4760  context: (CarmaContext): context
4762  device: (int): context active device
4763 
4764  nssp : (str) :
4765 
4766  weights:
4767 
4768  scale:
4769 
4770  xpos:
4771 
4772  ypos:
4773 
4774  fc:
4775 
4776  d:
4777 
4778  npts:
4779 
4780  """
4781  @typing.overload
4782  def __init__(self, context: carmaWrap.context, device: int, nssp: int, weights: numpy.ndarray[numpy.float32], scale: float, xpos: numpy.ndarray[numpy.float32], ypos: numpy.ndarray[numpy.float32], fc: float, d: float, npts: int) -> None: ...
4783  def compute_Calias(self) -> int:
4784  """
4785  Computes the aliasing error covariance matrix
4786  """
4787  def compute_Cerr(self) -> int:
4788  """
4789  Computes the aniso and bandwidth error covariance matrix
4790  """
4791  @property
4792  def d(self) -> float:
4793  """
4794  DM pitch
4795 
4796  :type: float
4797  """
4798  @property
4799  def d_CaXX(self) -> carmaWrap.obj_float:
4800  """
4801  XX component of the aliasing model
4802 
4803  :type: carmaWrap.obj_float
4804  """
4805  @property
4806  def d_CaYY(self) -> carmaWrap.obj_float:
4807  """
4808  YY component of the aliasing model
4809 
4810  :type: carmaWrap.obj_float
4811  """
4812  @property
4813  def d_Cerr(self) -> carmaWrap.obj_float:
4814  """
4815  Model of aniso and bandwidth covariance error matrix
4816 
4817  :type: carmaWrap.obj_float
4818  """
4819  @property
4820  def d_Nact(self) -> carmaWrap.obj_float:
4821  """
4822  Coupling matrix
4823 
4824  :type: carmaWrap.obj_float
4825  """
4826  @property
4827  def d_TT(self) -> carmaWrap.obj_float:
4828  """
4829  tip-tilt IF matrix
4830 
4831  :type: carmaWrap.obj_float
4832  """
4833  @property
4834  def d_TTPfilter(self) -> carmaWrap.obj_float:
4835  """
4836  Tip-tilt and piston filter matrix (= Btt.dot(P))
4837 
4838  :type: carmaWrap.obj_float
4839  """
4840  @property
4841  def d_pzt2tt(self) -> carmaWrap.obj_float:
4842  """
4843  pzt to TT matrix
4844 
4845  :type: carmaWrap.obj_float
4846  """
4847  @property
4848  def d_tab_int_x(self) -> carmaWrap.obj_float:
4849  """
4850  Tabulated integral
4851 
4852  :type: carmaWrap.obj_float
4853  """
4854  @property
4855  def d_tab_int_y(self) -> carmaWrap.obj_float:
4856  """
4857  Tabulated integral
4859  :type: carmaWrap.obj_float
4860  """
4861  @property
4862  def d_xpos(self) -> carmaWrap.obj_float:
4863  """
4864  X-positions of DM actuators or ssp [m]
4866  :type: carmaWrap.obj_float
4867  """
4868  @property
4869  def d_ypos(self) -> carmaWrap.obj_float:
4870  """
4871  Y-positions of DM actuators or ssp [m]
4872 
4873  :type: carmaWrap.obj_float
4874  """
4875  @property
4876  def device(self) -> int:
4877  """
4878  GPU device
4879 
4880  :type: int
4881  """
4882  @property
4883  def fc(self) -> float:
4884  """
4885  DM cut-off frequency [m]
4886 
4887  :type: float
4888  """
4889  @property
4890  def gsangle(self) -> float:
4891  """
4892  Guide star angle [rad]
4893 
4894  :type: float
4895  """
4896  @property
4897  def nactus(self) -> int:
4898  """
4899  Number of actuators
4900 
4901  :type: int
4902  """
4903  @property
4904  def nlayers(self) -> int:
4905  """
4906  number of turbulent layers
4907 
4908  :type: int
4909  """
4910  @property
4911  def npts(self) -> int:
4912  """
4913  number of samples for aliasig computation
4914 
4915  :type: int
4916  """
4917  @property
4918  def nssp(self) -> int:
4919  """
4920  number of subap
4921 
4922  :type: int
4923  """
4924  @property
4925  def scale(self) -> float:
4926  """
4927  Scale factor
4929  :type: float
4930  """
4931  pass
4932 class LGS():
4933  def lgs_init(self, nprof: int, hg: float, h0: float, deltah: float, pixsize: float, doffaxis: numpy.ndarray[numpy.float32], prof1d: numpy.ndarray[numpy.float32], profcum: numpy.ndarray[numpy.float32], beam: numpy.ndarray[numpy.float32], ftbeam: numpy.ndarray[numpy.complex64], azimuth: numpy.ndarray[numpy.float32]) -> int:
4934  """
4935  Initialize LGS object
4936 
4937  Args:
4938  nprof: (int): TODO: docstring
4939 
4940  hg: (float):
4941 
4942  h0: (float):
4943 
4944  deltah: (float):
4945 
4946  pixsize: (float):
4947 
4948  doffaxis:(np.array[ndim= , dtype=np.float32]):
4949 
4950  prof1d:(np.array[ndim= , dtype=np.float32]):
4951 
4952  profcum:(np.array[ndim= , dtype=np.float32]):
4953 
4954  beam:(np.array[ndim= , dtype=np.float32]):
4956  ftbeam:(np.array[ndim= , dtype=np.complex64]):
4957 
4958  azimuth:(np.array[ndim= , dtype=np.float32]):
4959  """
4960  @property
4961  def d_azimuth(self) -> carmaWrap.obj_float:
4962  """
4963  TODO: docstring
4965  :type: carmaWrap.obj_float
4966  """
4967  @property
4968  def d_beam(self) -> carmaWrap.obj_float:
4969  """
4970  TODO: docstring
4971 
4972  :type: carmaWrap.obj_float
4973  """
4974  @property
4975  def d_doffaxis(self) -> carmaWrap.obj_float:
4976  """
4977  TODO: docstring
4978 
4979  :type: carmaWrap.obj_float
4980  """
4981  @property
4982  def d_ftbeam(self) -> carmaWrap.obj_float_complex:
4983  """
4984  TODO: docstring
4985 
4986  :type: carmaWrap.obj_float_complex
4987  """
4988  @property
4989  def d_ftlgskern(self) -> carmaWrap.obj_float_complex:
4990  """
4991  TODO: docstring
4992 
4993  :type: carmaWrap.obj_float_complex
4994  """
4995  @property
4996  def d_lgskern(self) -> carmaWrap.obj_float:
4997  """
4998  TODO: docstring
4999 
5000  :type: carmaWrap.obj_float
5001  """
5002  @property
5003  def d_prof1d(self) -> carmaWrap.obj_float:
5004  """
5005  TODO: docstring
5006 
5007  :type: carmaWrap.obj_float
5008  """
5009  @property
5010  def d_prof2d(self) -> carmaWrap.obj_float_complex:
5011  """
5012  TODO: docstring
5013 
5014  :type: carmaWrap.obj_float_complex
5015  """
5016  @property
5017  def d_profcum(self) -> carmaWrap.obj_float:
5018  """
5019  TODO: docstring
5020 
5021  :type: carmaWrap.obj_float
5022  """
5023  @property
5024  def deltah(self) -> float:
5025  """
5026  TODO: docstring
5028  :type: float
5029  """
5030  @property
5031  def device(self) -> int:
5032  """
5033  GPU device index
5034 
5035  :type: int
5036  """
5037  @property
5038  def h0(self) -> float:
5039  """
5040  TODO: docstring
5041 
5042  :type: float
5043  """
5044  @property
5045  def hg(self) -> float:
5046  """
5047  TODO: docstring
5048 
5049  :type: float
5050  """
5051  @property
5052  def nmaxhr(self) -> int:
5053  """
5054  Size of HR support
5055 
5056  :type: int
5057  """
5058  @property
5059  def npix(self) -> int:
5060  """
5061  TODO: docstring
5062 
5063  :type: int
5064  """
5065  @property
5066  def nprof(self) -> int:
5067  """
5068  TODO: docstring
5069 
5070  :type: int
5071  """
5072  @property
5073  def nvalid(self) -> int:
5074  """
5075  TODO: docstring
5076 
5077  :type: int
5078  """
5079  @property
5080  def pixsize(self) -> float:
5081  """
5082  Pixel size on sky[arcsec]
5083 
5084  :type: float
5085  """
5086  pass
5087 class Wfs():
5088  def comp_image(self, noise: bool = True) -> int:
5089  """
5090  Computes the WFS image from the WFS phase
5091 
5092  Args:
5093  noise: (bool): take noise into account or not
5094  """
5095  def fill_binimage(self, arg0: int) -> int:
5096  """
5097  Fill d_binimg from d_bincube
5098  """
5099  def set_binimg(self, binimg: numpy.ndarray[numpy.float32], nElem: int) -> int:
5100  """
5101  Set the binimg of the SH WFS
5102 
5103  Args:
5104  binimg: (np.array[ndim=3, dtype=np.float32]) : cube of subap. images
5105 
5106  nElem: (int): Number of elements in binimg
5107 
5108  """
5109  def set_dark(self, dark: numpy.ndarray[numpy.float32], nElem: int) -> int:
5110  """
5111  Set the dark of the SH WFS
5112 
5113  Args:
5114  dark: (np.array[ndim=2, dtype=np.float32]) : dark image
5115 
5116  nElem: (int): Number of elements in dark
5117 
5118  """
5119  def set_fakecam(self, fakecam: bool) -> int:
5120  """
5121  Enable or disable uint16 computation for the WFS
5122 
5123  Args:
5124  fakecam: (bool): fakecam flag
5125 
5126  """
5127  def set_flat(self, flat: numpy.ndarray[numpy.float32], nElem: int) -> int:
5128  """
5129  Set the flat of the SH WFS
5130 
5131  Args:
5132  flat: (np.array[ndim=2, dtype=np.float32]) : flat image
5133 
5134  nElem: (int): Number of elements in flat
5135 
5136  """
5137  def set_max_flux_per_pix(self, max_flux_per_pix: int) -> int:
5138  """
5139  Set the maximum number of photons allowed before pixel saturation
5140 
5141  Args:
5142  max_flux_per_pix: (int): maximum number of photons allowed before pixel saturation
5143 
5144  """
5145  def set_max_pix_value(self, max_pix_value: int) -> int:
5146  """
5147  Set the maximum number of ADU allowed in the uint16 image
5148 
5149  Args:
5150  max_pix_value: (int): maximum number of ADU allowed in the uint16 image
5151 
5152  """
5153  def set_noise(self, noise: float, seed: int) -> int:
5154  """
5155  Set the noise of the WFS
5156 
5157  Args:
5158  noise: (float): desired noise (< 0 = no noise
5159  0 = photon only
5160  > 0 = photon + ron in e-)
5161  seed: (int): seed for the RNG
5162 
5163  """
5164  def set_pupil(self, pupil: numpy.ndarray[numpy.float32]) -> None:
5165  """
5166  Set the pupil seen by the WFS
5167 
5168  Args:
5169  pupil: (np.array(ndim=2,dtype=np.float32)): pupil to set
5170  """
5171  @typing.overload
5172  def slopes_geom(self, type: int = 0) -> int:
5173  """
5174  Computes theoretical slopes in wfs.d_slopes
5175 
5176  Args:
5177  type: (int): method to use (0: reduce, 1: derive)
5178 
5179 
5180 
5181  Computes theoretical slopes in given array
5182 
5183  Args:
5184  slopes: (np.array(ndim=1, dtype=np.float32)):
5185 
5186  type: (int): method to use (0: reduce, 1: derive)
5187  """
5188  @typing.overload
5189  def slopes_geom(self, slopes: numpy.ndarray[numpy.float32], type: int = 0) -> int: ...
5190  @property
5191  def d_bincube(self) -> carmaWrap.obj_float:
5192  """
5193  WFS spots as a 3D array
5194 
5195  :type: carmaWrap.obj_float
5196  """
5197  @property
5198  def d_binimg(self) -> carmaWrap.obj_float:
5199  """
5200  WFS image
5202  :type: carmaWrap.obj_float
5203  """
5204  @property
5205  def d_binimg_notnoisy(self) -> carmaWrap.obj_float:
5206  """
5207  WFS image without noise (ROKET only)
5208 
5209  :type: carmaWrap.obj_float
5210  """
5211  @property
5212  def d_camimg(self) -> carmaWrap.obj_uint16:
5213  """
5214  uint16 WFS image
5215 
5216  :type: carmaWrap.obj_uint16
5217  """
5218  @property
5219  def d_camplifoc(self) -> carmaWrap.obj_float_complex:
5220  """
5221  Complex amplitude in the focal plane
5222 
5223  :type: carmaWrap.obj_float_complex
5224  """
5225  @property
5226  def d_camplipup(self) -> carmaWrap.obj_float_complex:
5227  """
5228  Complex amplitude in the pupil
5229 
5230  :type: carmaWrap.obj_float_complex
5231  """
5232  @property
5233  def d_dark(self) -> carmaWrap.obj_float:
5234  """
5235  Dark WFS frame
5236 
5237  :type: carmaWrap.obj_float
5238  """
5239  @property
5240  def d_flat(self) -> carmaWrap.obj_float:
5241  """
5242  Flat WFS frame
5243 
5244  :type: carmaWrap.obj_float
5245  """
5246  @property
5247  def d_fluxPerSub(self) -> carmaWrap.obj_float:
5248  """
5249  Normalized flux per ssp
5250 
5251  :type: carmaWrap.obj_float
5252  """
5253  @property
5254  def d_fttotim(self) -> carmaWrap.obj_float_complex:
5255  """
5256  Buffer for FFT computation
5257 
5258  :type: carmaWrap.obj_float_complex
5259  """
5260  @property
5261  def d_gs(self) -> Source:
5262  """
5263  WGS GS (SutraSource object)
5264 
5265  :type: Source
5266  """
5267  @property
5268  def d_hrmap(self) -> carmaWrap.obj_int:
5269  """
5270  TODO: docstring
5271 
5272  :type: carmaWrap.obj_int
5273  """
5274  @property
5275  def d_intensities(self) -> carmaWrap.obj_float:
5276  """
5277  Sum of intensities in each ssp
5278 
5279  :type: carmaWrap.obj_float
5280  """
5281  @property
5282  def d_offsets(self) -> carmaWrap.obj_float:
5283  """
5284  TODO: docstring
5285 
5286  :type: carmaWrap.obj_float
5287  """
5288  @property
5289  def d_phasemap(self) -> carmaWrap.obj_int:
5290  """
5291  TODO: docstring
5292 
5293  :type: carmaWrap.obj_int
5294  """
5295  @property
5296  def d_pupil(self) -> carmaWrap.obj_float:
5297  """
5298  Pupil
5300  :type: carmaWrap.obj_float
5301  """
5302  @property
5303  def d_sincar(self) -> carmaWrap.obj_float:
5304  """
5305  TODO: docstring
5306 
5307  :type: carmaWrap.obj_float
5308  """
5309  @property
5310  def d_slopes(self) -> carmaWrap.obj_float:
5311  """
5312  Slopes vector
5313 
5314  :type: carmaWrap.obj_float
5315  """
5316  @property
5317  def d_submask(self) -> carmaWrap.obj_float:
5318  """
5319  TODO: docstring
5320 
5321  :type: carmaWrap.obj_float
5322  """
5323  @property
5324  def d_ttprojmat(self) -> carmaWrap.obj_float:
5325  """
5326  TT projection matrix from subap phase to slopes (geom wfs type 2)
5327 
5328  :type: carmaWrap.obj_float
5329  """
5330  @property
5331  def d_ttprojvec(self) -> carmaWrap.obj_float:
5332  """
5333  Input vector for TT projection from subap phase to slopes (geom wfs type 2)
5334 
5335  :type: carmaWrap.obj_float
5336  """
5337  @property
5338  def d_validsubsx(self) -> carmaWrap.obj_int:
5339  """
5340  X-position of valid ssp
5341 
5342  :type: carmaWrap.obj_int
5343  """
5344  @property
5345  def d_validsubsy(self) -> carmaWrap.obj_int:
5346  """
5347  Y-position of valid ssp
5348 
5349  :type: carmaWrap.obj_int
5350  """
5351  @property
5352  def device(self) -> int:
5353  """
5354  GPU device index
5355 
5356  :type: int
5357  """
5358  @property
5359  def fakecam(self) -> bool:
5360  """
5361  Flag for uint16 image
5363  :type: bool
5364  """
5365  @property
5366  def is_low_order(self) -> bool:
5367  """
5368  Flag for low order WFS
5369 
5370  :type: bool
5371  """
5372  @property
5373  def kernconv(self) -> bool:
5374  """
5375  Convolution kernel for spot computation
5376 
5377  :type: bool
5378  """
5379  @property
5380  def lgs(self) -> bool:
5381  """
5382  Is the WFS a LGS one ?
5383 
5384  :type: bool
5385  """
5386  @property
5387  def max_flux_per_pix(self) -> int:
5388  """
5389  Maximum number of photons allowed before pixel saturation
5390 
5391  :type: int
5392  """
5393  @property
5394  def max_pix_value(self) -> int:
5395  """
5396  Maximum number of ADU allowed in the uint16 image
5397 
5398  :type: int
5399  """
5400  @property
5401  def nfft(self) -> int:
5402  """
5403  FFT support size
5404 
5405  :type: int
5406  """
5407  @property
5408  def nffthr(self) -> int:
5409  """
5410  TODO: docstring
5411 
5412  :type: int
5413  """
5414  @property
5415  def nmaxhr(self) -> int:
5416  """
5417  TODO: docstring
5418 
5419  :type: int
5420  """
5421  @property
5422  def noise(self) -> float:
5423  """
5424  WFS noise [e-]
5426  :type: float
5427  """
5428  @property
5429  def nphase(self) -> int:
5430  """
5431  Number of phase point per ssp
5432 
5433  :type: int
5434  """
5435  @property
5436  def nphot(self) -> float:
5437  """
5438  Number of photons/ssp/iter
5439 
5440  :type: float
5441  """
5442  @property
5443  def nphot4imat(self) -> float:
5444  """
5445  Number of photons/ssp/iter used for imat computation
5446 
5447  :type: float
5448  """
5449  @property
5450  def npix(self) -> int:
5451  """
5452  Pixels per ssp
5453 
5454  :type: int
5455  """
5456  @property
5457  def npup(self) -> int:
5458  """
5459  Pupil support size
5460 
5461  :type: int
5462  """
5463  @property
5464  def nrebin(self) -> int:
5465  """
5466  Rebin factor
5467 
5468  :type: int
5469  """
5470  @property
5471  def ntot(self) -> int:
5472  """
5473  HR support size
5474 
5475  :type: int
5476  """
5477  @property
5478  def nvalid(self) -> int:
5479  """
5480  Number of valid ssp
5481 
5482  :type: int
5483  """
5484  @property
5485  def nxsub(self) -> int:
5486  """
5487  Number of ssp in the diameter
5488 
5489  :type: int
5490  """
5491  @property
5492  def roket(self) -> bool:
5493  """
5494  Is the WFS a LGS one ?
5495 
5496  :type: bool
5497  """
5498  @property
5499  def subapd(self) -> float:
5500  """
5501  ssp diameter in pixels
5502 
5503  :type: float
5504  """
5505  @property
5506  def type(self) -> str:
5507  """
5508  WFS type
5509 
5510  :type: str
5511  """
5512  pass
5513 class PerfectCoronagraph(Coronagraph):
5514  def __init__(self, context: carmaWrap.context, d_source: Source, im_dimx: int, im_dimy: int, wavelength: numpy.ndarray[numpy.float32], nWavelength: int, device: int) -> None:
5515  """
5516  Instantiates a PerfectCoronagraph object
5517 
5518  Args:
5519  context: (CarmaContext): context
5520 
5521  d_source: (SutraSource): Coronagraph source input
5522 
5523  im_dimx: (int): Coronagraphic image dimension along x axis
5524 
5525  im_dimy: (int): Coronagraphic image dimension along y axis
5526 
5527  wavelength: (np.ndarray[ndim=1, dtype=np.float32]): vector of wavelengths
5528 
5529  nWavelength: (int): number of wavelength
5530 
5531  device: (int): GPU device index
5532  """
5533  def set_mft(self, A: numpy.ndarray[numpy.complex64], B: numpy.ndarray[numpy.complex64], norm: numpy.ndarray[numpy.float32], mft_type: str) -> int:
5534  """
5535  Set MFT matrices for coronagraphic image computation
5536 
5537  Args:
5538  A : (np.ndarray[dtype=np.complex32, ndims=3]): A MFT matrix for each wavelength
5539 
5540  B : (np.ndarray[dtype=np.complex32, ndims=3]): B MFT matrix for each wavelength
5541 
5542  norm : (np.ndarray[dtype=np.complex32, ndims=3]): MFT normalization for each wavelength
5543 
5544  mft_type : (str): MFT matrices to set, i.e. "img" or "psf"
5545  """
5546  @property
5547  def AA(self) -> typing.Dict[str, typing.List[carmaWrap.obj_float_complex]]:
5548  """
5549  A MFT matrix
5550 
5551  :type: typing.Dict[str, typing.List[carmaWrap.obj_float_complex]]
5552  """
5553  @property
5554  def BB(self) -> typing.Dict[str, typing.List[carmaWrap.obj_float_complex]]:
5555  """
5556  B MFT matrix
5558  :type: typing.Dict[str, typing.List[carmaWrap.obj_float_complex]]
5559  """
5560  @property
5561  def norm(self) -> typing.Dict[str, typing.List[float]]:
5562  """
5563  MFT normalization
5565  :type: typing.Dict[str, typing.List[float]]
5566  """
5567  pass
5568 class Rtc_FFF():
5569  def __init__(self) -> None:
5570  """
5571  Initialize a void rtc object
5572  """
5573  @typing.overload
5574  def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str, wfs: Wfs) -> int:
5575  """
5576  Add a SutraCentroider object in the RTC
5577 
5578  Args:
5579  context: (CarmaContext): carma context
5580 
5581  nvalid:(int): Number of WFS valid ssp
5583  offset: (float): offset for centroiding computation
5584 
5585  scale: (float): scale factor to get the right unit, ie. arcsec
5586 
5587  filt_TT: (bool): flag to control TT filtering
5588 
5589  device: (int): GPU device index
5590 
5591  typec: (str): Centroider type
5592 
5593  wfs: (SutraWfs): SutraWfs handled by the centroider
5594 
5595 
5596 
5597 
5598  Add a SutraCentroider object in the RTC
5599 
5600  Args:
5601  context: (CarmaContext): carma context
5602 
5603  nvalid:(int): Number of WFS valid ssp
5604 
5605  offset: (float): offset for centroiding computation
5606 
5607  scale: (float): scale factor to get the right unit, ie. arcsec
5608 
5609  filt_TT: (bool): flag to control TT filtering
5610 
5611  device: (int): GPU device index
5612 
5613  typec: (str): Centroider type
5614  """
5615  @typing.overload
5616  def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str) -> int: ...
5617  @typing.overload
5618  def add_controller(self, context: carmaWrap.context, typec: str, device: int, delay: float, nslope: int, nactu: int, nslope_buffers: int = 0, nstates: int = 0, nstate_buffers: int = 0, nmodes: int = 0, niir_in: int = 0, niir_out: int = 0, polc: bool = False, is_modal: bool = False, dms: Dms = None, idx_dms: numpy.ndarray[numpy.int32] = [], ndm: int = 0, idx_centro: numpy.ndarray[numpy.int32] = [], ncentro: int = 0, Nphi: int = 0, wfs_direction: bool = False) -> int:
5619  """
5620  Add a SutraController object in the RTC
5621 
5622  Args:
5623  context: (CarmaContext): carma context
5624 
5625  typec: (str): Controller type
5626 
5627  device: (int): GPU device index
5628 
5629  delay: (float): Loop delay [frames]
5630 
5631  nslope: (int): Number of slopes
5632 
5633  nactu:(int): Number of actuators to command
5634 
5635  Kwargs:
5637  nslope_buffers: (int) : Number of historic slopes vectors to use
5638 
5639  nstates : (int) : Number of states in state vector
5640 
5641  nstate_buffers: (int) : Number of historic state vectors to use
5642 
5643  nmodes : (int) : Number of modes in mode vector
5644 
5645  niir_in : (int) : Number of input mode vectors for iir filter
5646 
5647  niir_out : (int) : Number of output mode vectors for iir filter
5648 
5649  polc : (bool) : Activate the Pseudo Open Loop Control if available
5650 
5651  is_modal : (bool) : Activate projection from modes to actu if available
5652 
5653  dms : (SutraDms) : SutraDms object
5655  idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
5656 
5657  ndm : (int) : Number of DM to command
5658 
5659  idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
5660 
5661  ncentro : (int) : Number of centroiders handled
5662 
5663  Nphi : (int) : umber of pixels in the pupil
5664 
5665  wfs_direction : (bool) : Flag for ROKET
5666 
5667 
5668 
5669 
5670  Add a SutraController object in the RTC
5671 
5672  Args:
5673  context: (CarmaContext): carma context
5674 
5675  typec: (str): Controller type
5676 
5677  device: (int): GPU device index
5678 
5679  delay: (float): Loop delay [frames]
5680 
5681  nslope: (int): Number of slopes
5682 
5683  nactu:(int): Number of actuators to command
5684 
5685  Kwargs:
5686  nslope_buffers: (int) : Number of historic slopes vectors to use
5687 
5688  nstates : (int) : Number of states in state vector
5689 
5690  nstate_buffers: (int) : Number of historic state vectors to use
5691 
5692  nmodes : (int) : Number of modes in mode vector
5693 
5694  niir_in : (int) : Number of input mode vectors for iir filter
5695 
5696  niir_out : (int) : Number of output mode vectors for iir filter
5697 
5698  polc : (bool) : Activate the Pseudo Open Loop Control if available
5700  is_modal : (bool) : Activate projection from modes to actu if available
5701 
5702  dms : (SutraDms) : SutraDms object
5703 
5704  idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
5705 
5706  ndm : (int) : Number of DM to command
5707 
5708  idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
5709 
5710  ncentro : (int) : Number of centroiders handled
5711 
5712  Nphi : (int) : umber of pixels in the pupil
5713 
5714  wfs_direction : (bool) : Flag for ROKET
5715 
5716 
5717  """
5718  @typing.overload
5719  def add_controller(self, context: carmaWrap.context, typec: str, device: int, delay: float, nslope: int, nactu: int, nslope_buffers: int = 0, nstates: int = 0, nstate_buffers: int = 0, nmodes: int = 0, niir_in: int = 0, niir_out: int = 0, polc: bool = False, is_modal: bool = False) -> None: ...
5720  def apply_control(self, ncontrol: int, compVoltage: bool = True) -> int:
5721  """
5722  Apply the commands on the DM and shape it
5723 
5724  Args:
5725  ncontrol: (int): Index of the controller
5727  compVoltage: (bool): if True (default), computes delay and perturb voltages. Else, applies just the vector command
5728  """
5729  def build_cmat(self, ncontrol: int, nfilt: int, filt_tt: bool = False) -> None:
5730  """
5731  Computes cmat
5732 
5733  Args:
5734  ncontrol : (int): controller index
5736  nfilt: (int): number of modes to filter
5737 
5738  filt_tt: (bool): Flag for TT filter
5739  """
5740  def comp_voltage(self, ncontrol: int) -> int:
5741  """
5742  Compute the commands on the DM
5743 
5744  Args:
5745  ncontrol: (int): Index of the controller
5746  """
5747  def do_calibrate_img(self, ncontrol: int) -> int:
5748  """
5749  Computes the calibrated image
5750 
5751  Args:
5752  ncontrol: (int): Index of the controller
5753  """
5754  def do_centroids(self, ncontrol: int) -> int:
5755  """
5756  Computes the centroids
5757 
5758  Args:
5759  ncontrol: (int): Index of the controller
5760  """
5761  def do_centroids_geom(self, ncontrol: int, type: int = 0) -> int:
5762  """
5763  Computes the centroids geom
5764 
5765  Args:
5766  ncontrol: (int): Index of the controller
5767  type: (int): Centroiding method of geom wfs
5768  """
5769  def do_centroids_ref(self, ncontrol: int) -> int:
5770  """
5771  Computes the centroids ref
5772 
5773  Args:
5774  ncontrol: (int): Index of the controller
5775  """
5776  def do_clipping(self, ncontrol: int) -> int:
5777  """
5778  Clip the command to apply on the DMs on a SutraController object
5779 
5780  Args:
5781  ncontrol: (int) : controller index
5782  """
5783  def do_control(self, ncontrol: int) -> int:
5784  """
5785  Computes the commands
5786 
5787  Args:
5788  ncontrol: (int): Index of the controller
5789  """
5790  def do_imat(self, ncontrol: int, dms: Dms, kernconv: int) -> int:
5791  """
5792  Computes interaction matrix
5793 
5794  Args:
5795  ncontrol: (int): Index of the controller
5796 
5797  dms: (SutraDms): SutraDms object
5798 
5799  kernconv : (bool) : Flag for WFS spot convolution
5800  """
5801  def do_imat_basis(self, ncontrol: int, dms: Dms, nModes: int, m2v: numpy.ndarray[numpy.float32], pushAmpl: numpy.ndarray[numpy.float32], kernconv: int) -> int:
5802  """
5803  Computes a modal interaction matrix
5804 
5805  Args:
5806  ncontrol: (int): Index of the controller
5807 
5808  dms: (SutraDms): SutraDms object
5810  nModes: (int): number of modes in the basis
5811 
5812  m2v: (np.array[ndim=2,dtype=np.float32]): modeToActu matrix
5813 
5814  pushAmpl: (np.array[ndim=1,dtype=np.float32]): pushpull strength in mode units
5815 
5816  kernconv : (bool) : Flag for WFS spot convolution
5817 
5818  """
5819  def imat_svd(self, ncontrol: int) -> None:
5820  """
5821  Computes imat svd
5822 
5823  Args:
5824  ncontrol : (int): controller index
5825  """
5826  def remove_centroider(self, ncentro: int) -> int:
5827  """
5828  Remove the specified centroider from the RTC
5829 
5830  Args:
5831  ncentro : (int): index of the centroider to remove
5832  """
5833  def remove_controller(self, ncontrol: int) -> int:
5834  """
5835  Remove the specified controller from the RTC
5837  Args:
5838  ncontrol : (int): index of the controller to remove
5839  """
5840  def set_centroids_ref(self, centroidsRef: numpy.ndarray[numpy.float32]) -> int:
5841  """
5842  Set the reference centroids
5843 
5844  Args:
5845  centroids_ref : (np.array(ndim=1, dtype=np.float32)): ref centroids
5846  """
5847  def set_gain(self, ncontrol: int, gain: float) -> None:
5848  """
5849  Set the loop gain in the controller
5850 
5851  Args:
5852  ncontrol: (int): controller index
5853 
5854  gain: (float): gain to set
5855  """
5856  def set_modal_gains(self, ncontrol: int, mgain: numpy.ndarray[numpy.float32]) -> None:
5857  """
5858  Set the modal gain in the controller
5859 
5860  Args:
5861  ncontrol: (int): controller index
5862 
5863  mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
5864  """
5865  @property
5866  def d_centro(self) -> typing.List[Centroider_FF]:
5867  """
5868  Vector of centroiders
5869 
5870  :type: typing.List[Centroider_FF]
5871  """
5872  @property
5873  def d_control(self) -> typing.List[Controller_FF]:
5874  """
5875  Vector of controllers
5876 
5877  :type: typing.List[Controller_FF]
5878  """
5879  pass
5880 class Rtc_FFU():
5881  def __init__(self) -> None:
5882  """
5883  Initialize a void rtc object
5884  """
5885  @typing.overload
5886  def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str, wfs: Wfs) -> int:
5887  """
5888  Add a SutraCentroider object in the RTC
5889 
5890  Args:
5891  context: (CarmaContext): carma context
5892 
5893  nvalid:(int): Number of WFS valid ssp
5894 
5895  offset: (float): offset for centroiding computation
5896 
5897  scale: (float): scale factor to get the right unit, ie. arcsec
5898 
5899  filt_TT: (bool): flag to control TT filtering
5900 
5901  device: (int): GPU device index
5902 
5903  typec: (str): Centroider type
5904 
5905  wfs: (SutraWfs): SutraWfs handled by the centroider
5906 
5907 
5909 
5910  Add a SutraCentroider object in the RTC
5911 
5912  Args:
5913  context: (CarmaContext): carma context
5914 
5915  nvalid:(int): Number of WFS valid ssp
5916 
5917  offset: (float): offset for centroiding computation
5918 
5919  scale: (float): scale factor to get the right unit, ie. arcsec
5920 
5921  filt_TT: (bool): flag to control TT filtering
5922 
5923  device: (int): GPU device index
5924 
5925  typec: (str): Centroider type
5926  """
5927  @typing.overload
5928  def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str) -> int: ...
5929  @typing.overload
5930  def add_controller(self, context: carmaWrap.context, typec: str, device: int, delay: float, nslope: int, nactu: int, nslope_buffers: int = 0, nstates: int = 0, nstate_buffers: int = 0, nmodes: int = 0, niir_in: int = 0, niir_out: int = 0, polc: bool = False, is_modal: bool = False, dms: Dms = None, idx_dms: numpy.ndarray[numpy.int32] = [], ndm: int = 0, idx_centro: numpy.ndarray[numpy.int32] = [], ncentro: int = 0, Nphi: int = 0, wfs_direction: bool = False) -> int:
5931  """
5932  Add a SutraController object in the RTC
5933 
5934  Args:
5935  context: (CarmaContext): carma context
5936 
5937  typec: (str): Controller type
5938 
5939  device: (int): GPU device index
5940 
5941  delay: (float): Loop delay [frames]
5942 
5943  nslope: (int): Number of slopes
5944 
5945  nactu:(int): Number of actuators to command
5946 
5947  Kwargs:
5948 
5949  nslope_buffers: (int) : Number of historic slopes vectors to use
5950 
5951  nstates : (int) : Number of states in state vector
5952 
5953  nstate_buffers: (int) : Number of historic state vectors to use
5954 
5955  nmodes : (int) : Number of modes in mode vector
5956 
5957  niir_in : (int) : Number of input mode vectors for iir filter
5958 
5959  niir_out : (int) : Number of output mode vectors for iir filter
5960 
5961  polc : (bool) : Activate the Pseudo Open Loop Control if available
5962 
5963  is_modal : (bool) : Activate projection from modes to actu if available
5964 
5965  dms : (SutraDms) : SutraDms object
5966 
5967  idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
5968 
5969  ndm : (int) : Number of DM to command
5970 
5971  idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
5972 
5973  ncentro : (int) : Number of centroiders handled
5974 
5975  Nphi : (int) : umber of pixels in the pupil
5976 
5977  wfs_direction : (bool) : Flag for ROKET
5978 
5980 
5981 
5982  Add a SutraController object in the RTC
5983 
5984  Args:
5985  context: (CarmaContext): carma context
5986 
5987  typec: (str): Controller type
5988 
5989  device: (int): GPU device index
5990 
5991  delay: (float): Loop delay [frames]
5992 
5993  nslope: (int): Number of slopes
5994 
5995  nactu:(int): Number of actuators to command
5996 
5997  Kwargs:
5998  nslope_buffers: (int) : Number of historic slopes vectors to use
5999 
6000  nstates : (int) : Number of states in state vector
6001 
6002  nstate_buffers: (int) : Number of historic state vectors to use
6003 
6004  nmodes : (int) : Number of modes in mode vector
6005 
6006  niir_in : (int) : Number of input mode vectors for iir filter
6007 
6008  niir_out : (int) : Number of output mode vectors for iir filter
6009 
6010  polc : (bool) : Activate the Pseudo Open Loop Control if available
6011 
6012  is_modal : (bool) : Activate projection from modes to actu if available
6014  dms : (SutraDms) : SutraDms object
6015 
6016  idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6017 
6018  ndm : (int) : Number of DM to command
6019 
6020  idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6021 
6022  ncentro : (int) : Number of centroiders handled
6023 
6024  Nphi : (int) : umber of pixels in the pupil
6025 
6026  wfs_direction : (bool) : Flag for ROKET
6027 
6028 
6029  """
6030  @typing.overload
6031  def add_controller(self, context: carmaWrap.context, typec: str, device: int, delay: float, nslope: int, nactu: int, nslope_buffers: int = 0, nstates: int = 0, nstate_buffers: int = 0, nmodes: int = 0, niir_in: int = 0, niir_out: int = 0, polc: bool = False, is_modal: bool = False) -> None: ...
6032  def apply_control(self, ncontrol: int, compVoltage: bool = True) -> int:
6033  """
6034  Apply the commands on the DM and shape it
6035 
6036  Args:
6037  ncontrol: (int): Index of the controller
6038 
6039  compVoltage: (bool): if True (default), computes delay and perturb voltages. Else, applies just the vector command
6040  """
6041  def build_cmat(self, ncontrol: int, nfilt: int, filt_tt: bool = False) -> None:
6042  """
6043  Computes cmat
6044 
6045  Args:
6046  ncontrol : (int): controller index
6047 
6048  nfilt: (int): number of modes to filter
6049 
6050  filt_tt: (bool): Flag for TT filter
6051  """
6052  def comp_voltage(self, ncontrol: int) -> int:
6053  """
6054  Compute the commands on the DM
6055 
6056  Args:
6057  ncontrol: (int): Index of the controller
6058  """
6059  def do_calibrate_img(self, ncontrol: int) -> int:
6060  """
6061  Computes the calibrated image
6062 
6063  Args:
6064  ncontrol: (int): Index of the controller
6065  """
6066  def do_centroids(self, ncontrol: int) -> int:
6067  """
6068  Computes the centroids
6069 
6070  Args:
6071  ncontrol: (int): Index of the controller
6072  """
6073  def do_centroids_geom(self, ncontrol: int, type: int = 0) -> int:
6074  """
6075  Computes the centroids geom
6076 
6077  Args:
6078  ncontrol: (int): Index of the controller
6079  type: (int): Centroiding method of geom wfs
6080  """
6081  def do_centroids_ref(self, ncontrol: int) -> int:
6082  """
6083  Computes the centroids ref
6085  Args:
6086  ncontrol: (int): Index of the controller
6087  """
6088  def do_clipping(self, ncontrol: int) -> int:
6089  """
6090  Clip the command to apply on the DMs on a SutraController object
6091 
6092  Args:
6093  ncontrol: (int) : controller index
6094  """
6095  def do_control(self, ncontrol: int) -> int:
6096  """
6097  Computes the commands
6098 
6099  Args:
6100  ncontrol: (int): Index of the controller
6101  """
6102  def do_imat(self, ncontrol: int, dms: Dms, kernconv: int) -> int:
6103  """
6104  Computes interaction matrix
6105 
6106  Args:
6107  ncontrol: (int): Index of the controller
6108 
6109  dms: (SutraDms): SutraDms object
6110 
6111  kernconv : (bool) : Flag for WFS spot convolution
6112  """
6113  def do_imat_basis(self, ncontrol: int, dms: Dms, nModes: int, m2v: numpy.ndarray[numpy.float32], pushAmpl: numpy.ndarray[numpy.float32], kernconv: int) -> int:
6114  """
6115  Computes a modal interaction matrix
6116 
6117  Args:
6118  ncontrol: (int): Index of the controller
6119 
6120  dms: (SutraDms): SutraDms object
6121 
6122  nModes: (int): number of modes in the basis
6123 
6124  m2v: (np.array[ndim=2,dtype=np.float32]): modeToActu matrix
6125 
6126  pushAmpl: (np.array[ndim=1,dtype=np.float32]): pushpull strength in mode units
6127 
6128  kernconv : (bool) : Flag for WFS spot convolution
6130  """
6131  def imat_svd(self, ncontrol: int) -> None:
6132  """
6133  Computes imat svd
6134 
6135  Args:
6136  ncontrol : (int): controller index
6137  """
6138  def remove_centroider(self, ncentro: int) -> int:
6139  """
6140  Remove the specified centroider from the RTC
6141 
6142  Args:
6143  ncentro : (int): index of the centroider to remove
6144  """
6145  def remove_controller(self, ncontrol: int) -> int:
6146  """
6147  Remove the specified controller from the RTC
6148 
6149  Args:
6150  ncontrol : (int): index of the controller to remove
6151  """
6152  def set_centroids_ref(self, centroidsRef: numpy.ndarray[numpy.float32]) -> int:
6153  """
6154  Set the reference centroids
6155 
6156  Args:
6157  centroids_ref : (np.array(ndim=1, dtype=np.float32)): ref centroids
6158  """
6159  def set_gain(self, ncontrol: int, gain: float) -> None:
6160  """
6161  Set the loop gain in the controller
6162 
6163  Args:
6164  ncontrol: (int): controller index
6166  gain: (float): gain to set
6167  """
6168  def set_modal_gains(self, ncontrol: int, mgain: numpy.ndarray[numpy.float32]) -> None:
6169  """
6170  Set the modal gain in the controller
6171 
6172  Args:
6173  ncontrol: (int): controller index
6175  mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
6176  """
6177  @property
6178  def d_centro(self) -> typing.List[Centroider_FF]:
6179  """
6180  Vector of centroiders
6181 
6182  :type: typing.List[Centroider_FF]
6183  """
6184  @property
6185  def d_control(self) -> typing.List[Controller_FU]:
6186  """
6187  Vector of controllers
6188 
6189  :type: typing.List[Controller_FU]
6190  """
6191  pass
6192 class Rtc_UFF():
6193  def __init__(self) -> None:
6194  """
6195  Initialize a void rtc object
6196  """
6197  @typing.overload
6198  def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str, wfs: Wfs) -> int:
6199  """
6200  Add a SutraCentroider object in the RTC
6202  Args:
6203  context: (CarmaContext): carma context
6204 
6205  nvalid:(int): Number of WFS valid ssp
6206 
6207  offset: (float): offset for centroiding computation
6208 
6209  scale: (float): scale factor to get the right unit, ie. arcsec
6211  filt_TT: (bool): flag to control TT filtering
6212 
6213  device: (int): GPU device index
6214 
6215  typec: (str): Centroider type
6216 
6217  wfs: (SutraWfs): SutraWfs handled by the centroider
6218 
6220 
6221 
6222  Add a SutraCentroider object in the RTC
6223 
6224  Args:
6225  context: (CarmaContext): carma context
6226 
6227  nvalid:(int): Number of WFS valid ssp
6229  offset: (float): offset for centroiding computation
6230 
6231  scale: (float): scale factor to get the right unit, ie. arcsec
6232 
6233  filt_TT: (bool): flag to control TT filtering
6234 
6235  device: (int): GPU device index
6236 
6237  typec: (str): Centroider type
6238  """
6239  @typing.overload
6240  def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str) -> int: ...
6241  @typing.overload
6242  def add_controller(self, context: carmaWrap.context, typec: str, device: int, delay: float, nslope: int, nactu: int, nslope_buffers: int = 0, nstates: int = 0, nstate_buffers: int = 0, nmodes: int = 0, niir_in: int = 0, niir_out: int = 0, polc: bool = False, is_modal: bool = False, dms: Dms = None, idx_dms: numpy.ndarray[numpy.int32] = [], ndm: int = 0, idx_centro: numpy.ndarray[numpy.int32] = [], ncentro: int = 0, Nphi: int = 0, wfs_direction: bool = False) -> int:
6243  """
6244  Add a SutraController object in the RTC
6245 
6246  Args:
6247  context: (CarmaContext): carma context
6248 
6249  typec: (str): Controller type
6250 
6251  device: (int): GPU device index
6252 
6253  delay: (float): Loop delay [frames]
6254 
6255  nslope: (int): Number of slopes
6256 
6257  nactu:(int): Number of actuators to command
6258 
6259  Kwargs:
6260 
6261  nslope_buffers: (int) : Number of historic slopes vectors to use
6262 
6263  nstates : (int) : Number of states in state vector
6265  nstate_buffers: (int) : Number of historic state vectors to use
6266 
6267  nmodes : (int) : Number of modes in mode vector
6268 
6269  niir_in : (int) : Number of input mode vectors for iir filter
6270 
6271  niir_out : (int) : Number of output mode vectors for iir filter
6272 
6273  polc : (bool) : Activate the Pseudo Open Loop Control if available
6274 
6275  is_modal : (bool) : Activate projection from modes to actu if available
6276 
6277  dms : (SutraDms) : SutraDms object
6278 
6279  idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6280 
6281  ndm : (int) : Number of DM to command
6283  idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6284 
6285  ncentro : (int) : Number of centroiders handled
6286 
6287  Nphi : (int) : umber of pixels in the pupil
6288 
6289  wfs_direction : (bool) : Flag for ROKET
6290 
6292 
6293 
6294  Add a SutraController object in the RTC
6295 
6296  Args:
6297  context: (CarmaContext): carma context
6298 
6299  typec: (str): Controller type
6301  device: (int): GPU device index
6302 
6303  delay: (float): Loop delay [frames]
6304 
6305  nslope: (int): Number of slopes
6306 
6307  nactu:(int): Number of actuators to command
6308 
6309  Kwargs:
6310  nslope_buffers: (int) : Number of historic slopes vectors to use
6311 
6312  nstates : (int) : Number of states in state vector
6313 
6314  nstate_buffers: (int) : Number of historic state vectors to use
6315 
6316  nmodes : (int) : Number of modes in mode vector
6317 
6318  niir_in : (int) : Number of input mode vectors for iir filter
6319 
6320  niir_out : (int) : Number of output mode vectors for iir filter
6321 
6322  polc : (bool) : Activate the Pseudo Open Loop Control if available
6323 
6324  is_modal : (bool) : Activate projection from modes to actu if available
6325 
6326  dms : (SutraDms) : SutraDms object
6328  idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6329 
6330  ndm : (int) : Number of DM to command
6331 
6332  idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6333 
6334  ncentro : (int) : Number of centroiders handled
6335 
6336  Nphi : (int) : umber of pixels in the pupil
6337 
6338  wfs_direction : (bool) : Flag for ROKET
6339 
6340 
6341  """
6342  @typing.overload
6343  def add_controller(self, context: carmaWrap.context, typec: str, device: int, delay: float, nslope: int, nactu: int, nslope_buffers: int = 0, nstates: int = 0, nstate_buffers: int = 0, nmodes: int = 0, niir_in: int = 0, niir_out: int = 0, polc: bool = False, is_modal: bool = False) -> None: ...
6344  def apply_control(self, ncontrol: int, compVoltage: bool = True) -> int:
6345  """
6346  Apply the commands on the DM and shape it
6347 
6348  Args:
6349  ncontrol: (int): Index of the controller
6350 
6351  compVoltage: (bool): if True (default), computes delay and perturb voltages. Else, applies just the vector command
6352  """
6353  def build_cmat(self, ncontrol: int, nfilt: int, filt_tt: bool = False) -> None:
6354  """
6355  Computes cmat
6356 
6357  Args:
6358  ncontrol : (int): controller index
6359 
6360  nfilt: (int): number of modes to filter
6361 
6362  filt_tt: (bool): Flag for TT filter
6363  """
6364  def comp_voltage(self, ncontrol: int) -> int:
6365  """
6366  Compute the commands on the DM
6367 
6368  Args:
6369  ncontrol: (int): Index of the controller
6370  """
6371  def do_calibrate_img(self, ncontrol: int) -> int:
6372  """
6373  Computes the calibrated image
6374 
6375  Args:
6376  ncontrol: (int): Index of the controller
6377  """
6378  def do_centroids(self, ncontrol: int) -> int:
6379  """
6380  Computes the centroids
6382  Args:
6383  ncontrol: (int): Index of the controller
6384  """
6385  def do_centroids_geom(self, ncontrol: int, type: int = 0) -> int:
6386  """
6387  Computes the centroids geom
6388 
6389  Args:
6390  ncontrol: (int): Index of the controller
6391  type: (int): Centroiding method of geom wfs
6392  """
6393  def do_centroids_ref(self, ncontrol: int) -> int:
6394  """
6395  Computes the centroids ref
6396 
6397  Args:
6398  ncontrol: (int): Index of the controller
6399  """
6400  def do_clipping(self, ncontrol: int) -> int:
6401  """
6402  Clip the command to apply on the DMs on a SutraController object
6403 
6404  Args:
6405  ncontrol: (int) : controller index
6406  """
6407  def do_control(self, ncontrol: int) -> int:
6408  """
6409  Computes the commands
6410 
6411  Args:
6412  ncontrol: (int): Index of the controller
6413  """
6414  def do_imat(self, ncontrol: int, dms: Dms, kernconv: int) -> int:
6415  """
6416  Computes interaction matrix
6418  Args:
6419  ncontrol: (int): Index of the controller
6420 
6421  dms: (SutraDms): SutraDms object
6422 
6423  kernconv : (bool) : Flag for WFS spot convolution
6424  """
6425  def do_imat_basis(self, ncontrol: int, dms: Dms, nModes: int, m2v: numpy.ndarray[numpy.float32], pushAmpl: numpy.ndarray[numpy.float32], kernconv: int) -> int:
6426  """
6427  Computes a modal interaction matrix
6428 
6429  Args:
6430  ncontrol: (int): Index of the controller
6431 
6432  dms: (SutraDms): SutraDms object
6433 
6434  nModes: (int): number of modes in the basis
6436  m2v: (np.array[ndim=2,dtype=np.float32]): modeToActu matrix
6437 
6438  pushAmpl: (np.array[ndim=1,dtype=np.float32]): pushpull strength in mode units
6439 
6440  kernconv : (bool) : Flag for WFS spot convolution
6441 
6442  """
6443  def imat_svd(self, ncontrol: int) -> None:
6444  """
6445  Computes imat svd
6446 
6447  Args:
6448  ncontrol : (int): controller index
6449  """
6450  def remove_centroider(self, ncentro: int) -> int:
6451  """
6452  Remove the specified centroider from the RTC
6453 
6454  Args:
6455  ncentro : (int): index of the centroider to remove
6456  """
6457  def remove_controller(self, ncontrol: int) -> int:
6458  """
6459  Remove the specified controller from the RTC
6460 
6461  Args:
6462  ncontrol : (int): index of the controller to remove
6463  """
6464  def set_centroids_ref(self, centroidsRef: numpy.ndarray[numpy.float32]) -> int:
6465  """
6466  Set the reference centroids
6468  Args:
6469  centroids_ref : (np.array(ndim=1, dtype=np.float32)): ref centroids
6470  """
6471  def set_gain(self, ncontrol: int, gain: float) -> None:
6472  """
6473  Set the loop gain in the controller
6474 
6475  Args:
6476  ncontrol: (int): controller index
6477 
6478  gain: (float): gain to set
6479  """
6480  def set_modal_gains(self, ncontrol: int, mgain: numpy.ndarray[numpy.float32]) -> None:
6481  """
6482  Set the modal gain in the controller
6483 
6484  Args:
6485  ncontrol: (int): controller index
6486 
6487  mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
6488  """
6489  @property
6490  def d_centro(self) -> typing.List[Centroider_UF]:
6491  """
6492  Vector of centroiders
6493 
6494  :type: typing.List[Centroider_UF]
6495  """
6496  @property
6497  def d_control(self) -> typing.List[Controller_FF]:
6498  """
6499  Vector of controllers
6500 
6501  :type: typing.List[Controller_FF]
6502  """
6503  pass
6504 class Rtc_UFU():
6505  def __init__(self) -> None:
6506  """
6507  Initialize a void rtc object
6508  """
6509  @typing.overload
6510  def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str, wfs: Wfs) -> int:
6511  """
6512  Add a SutraCentroider object in the RTC
6514  Args:
6515  context: (CarmaContext): carma context
6516 
6517  nvalid:(int): Number of WFS valid ssp
6518 
6519  offset: (float): offset for centroiding computation
6520 
6521  scale: (float): scale factor to get the right unit, ie. arcsec
6522 
6523  filt_TT: (bool): flag to control TT filtering
6524 
6525  device: (int): GPU device index
6526 
6527  typec: (str): Centroider type
6528 
6529  wfs: (SutraWfs): SutraWfs handled by the centroider
6530 
6531 
6532 
6533 
6534  Add a SutraCentroider object in the RTC
6535 
6536  Args:
6537  context: (CarmaContext): carma context
6538 
6539  nvalid:(int): Number of WFS valid ssp
6540 
6541  offset: (float): offset for centroiding computation
6542 
6543  scale: (float): scale factor to get the right unit, ie. arcsec
6544 
6545  filt_TT: (bool): flag to control TT filtering
6546 
6547  device: (int): GPU device index
6548 
6549  typec: (str): Centroider type
6550  """
6551  @typing.overload
6552  def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str) -> int: ...
6553  @typing.overload
6554  def add_controller(self, context: carmaWrap.context, typec: str, device: int, delay: float, nslope: int, nactu: int, nslope_buffers: int = 0, nstates: int = 0, nstate_buffers: int = 0, nmodes: int = 0, niir_in: int = 0, niir_out: int = 0, polc: bool = False, is_modal: bool = False, dms: Dms = None, idx_dms: numpy.ndarray[numpy.int32] = [], ndm: int = 0, idx_centro: numpy.ndarray[numpy.int32] = [], ncentro: int = 0, Nphi: int = 0, wfs_direction: bool = False) -> int:
6555  """
6556  Add a SutraController object in the RTC
6558  Args:
6559  context: (CarmaContext): carma context
6560 
6561  typec: (str): Controller type
6562 
6563  device: (int): GPU device index
6564 
6565  delay: (float): Loop delay [frames]
6566 
6567  nslope: (int): Number of slopes
6568 
6569  nactu:(int): Number of actuators to command
6570 
6571  Kwargs:
6572 
6573  nslope_buffers: (int) : Number of historic slopes vectors to use
6574 
6575  nstates : (int) : Number of states in state vector
6576 
6577  nstate_buffers: (int) : Number of historic state vectors to use
6578 
6579  nmodes : (int) : Number of modes in mode vector
6580 
6581  niir_in : (int) : Number of input mode vectors for iir filter
6582 
6583  niir_out : (int) : Number of output mode vectors for iir filter
6584 
6585  polc : (bool) : Activate the Pseudo Open Loop Control if available
6586 
6587  is_modal : (bool) : Activate projection from modes to actu if available
6588 
6589  dms : (SutraDms) : SutraDms object
6590 
6591  idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6592 
6593  ndm : (int) : Number of DM to command
6594 
6595  idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6596 
6597  ncentro : (int) : Number of centroiders handled
6598 
6599  Nphi : (int) : umber of pixels in the pupil
6600 
6601  wfs_direction : (bool) : Flag for ROKET
6602 
6603 
6604 
6605 
6606  Add a SutraController object in the RTC
6607 
6608  Args:
6609  context: (CarmaContext): carma context
6610 
6611  typec: (str): Controller type
6612 
6613  device: (int): GPU device index
6614 
6615  delay: (float): Loop delay [frames]
6616 
6617  nslope: (int): Number of slopes
6618 
6619  nactu:(int): Number of actuators to command
6620 
6621  Kwargs:
6622  nslope_buffers: (int) : Number of historic slopes vectors to use
6623 
6624  nstates : (int) : Number of states in state vector
6625 
6626  nstate_buffers: (int) : Number of historic state vectors to use
6627 
6628  nmodes : (int) : Number of modes in mode vector
6629 
6630  niir_in : (int) : Number of input mode vectors for iir filter
6631 
6632  niir_out : (int) : Number of output mode vectors for iir filter
6633 
6634  polc : (bool) : Activate the Pseudo Open Loop Control if available
6635 
6636  is_modal : (bool) : Activate projection from modes to actu if available
6637 
6638  dms : (SutraDms) : SutraDms object
6639 
6640  idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6641 
6642  ndm : (int) : Number of DM to command
6643 
6644  idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6645 
6646  ncentro : (int) : Number of centroiders handled
6647 
6648  Nphi : (int) : umber of pixels in the pupil
6649 
6650  wfs_direction : (bool) : Flag for ROKET
6651 
6652 
6653  """
6654  @typing.overload
6655  def add_controller(self, context: carmaWrap.context, typec: str, device: int, delay: float, nslope: int, nactu: int, nslope_buffers: int = 0, nstates: int = 0, nstate_buffers: int = 0, nmodes: int = 0, niir_in: int = 0, niir_out: int = 0, polc: bool = False, is_modal: bool = False) -> None: ...
6656  def apply_control(self, ncontrol: int, compVoltage: bool = True) -> int:
6657  """
6658  Apply the commands on the DM and shape it
6659 
6660  Args:
6661  ncontrol: (int): Index of the controller
6662 
6663  compVoltage: (bool): if True (default), computes delay and perturb voltages. Else, applies just the vector command
6664  """
6665  def build_cmat(self, ncontrol: int, nfilt: int, filt_tt: bool = False) -> None:
6666  """
6667  Computes cmat
6668 
6669  Args:
6670  ncontrol : (int): controller index
6671 
6672  nfilt: (int): number of modes to filter
6673 
6674  filt_tt: (bool): Flag for TT filter
6675  """
6676  def comp_voltage(self, ncontrol: int) -> int:
6677  """
6678  Compute the commands on the DM
6679 
6680  Args:
6681  ncontrol: (int): Index of the controller
6682  """
6683  def do_calibrate_img(self, ncontrol: int) -> int:
6684  """
6685  Computes the calibrated image
6686 
6687  Args:
6688  ncontrol: (int): Index of the controller
6689  """
6690  def do_centroids(self, ncontrol: int) -> int:
6691  """
6692  Computes the centroids
6693 
6694  Args:
6695  ncontrol: (int): Index of the controller
6696  """
6697  def do_centroids_geom(self, ncontrol: int, type: int = 0) -> int:
6698  """
6699  Computes the centroids geom
6700 
6701  Args:
6702  ncontrol: (int): Index of the controller
6703  type: (int): Centroiding method of geom wfs
6704  """
6705  def do_centroids_ref(self, ncontrol: int) -> int:
6706  """
6707  Computes the centroids ref
6708 
6709  Args:
6710  ncontrol: (int): Index of the controller
6711  """
6712  def do_clipping(self, ncontrol: int) -> int:
6713  """
6714  Clip the command to apply on the DMs on a SutraController object
6715 
6716  Args:
6717  ncontrol: (int) : controller index
6718  """
6719  def do_control(self, ncontrol: int) -> int:
6720  """
6721  Computes the commands
6722 
6723  Args:
6724  ncontrol: (int): Index of the controller
6725  """
6726  def do_imat(self, ncontrol: int, dms: Dms, kernconv: int) -> int:
6727  """
6728  Computes interaction matrix
6729 
6730  Args:
6731  ncontrol: (int): Index of the controller
6732 
6733  dms: (SutraDms): SutraDms object
6734 
6735  kernconv : (bool) : Flag for WFS spot convolution
6736  """
6737  def do_imat_basis(self, ncontrol: int, dms: Dms, nModes: int, m2v: numpy.ndarray[numpy.float32], pushAmpl: numpy.ndarray[numpy.float32], kernconv: int) -> int:
6738  """
6739  Computes a modal interaction matrix
6740 
6741  Args:
6742  ncontrol: (int): Index of the controller
6743 
6744  dms: (SutraDms): SutraDms object
6745 
6746  nModes: (int): number of modes in the basis
6747 
6748  m2v: (np.array[ndim=2,dtype=np.float32]): modeToActu matrix
6749 
6750  pushAmpl: (np.array[ndim=1,dtype=np.float32]): pushpull strength in mode units
6751 
6752  kernconv : (bool) : Flag for WFS spot convolution
6753 
6754  """
6755  def imat_svd(self, ncontrol: int) -> None:
6756  """
6757  Computes imat svd
6758 
6759  Args:
6760  ncontrol : (int): controller index
6761  """
6762  def remove_centroider(self, ncentro: int) -> int:
6763  """
6764  Remove the specified centroider from the RTC
6765 
6766  Args:
6767  ncentro : (int): index of the centroider to remove
6768  """
6769  def remove_controller(self, ncontrol: int) -> int:
6770  """
6771  Remove the specified controller from the RTC
6772 
6773  Args:
6774  ncontrol : (int): index of the controller to remove
6775  """
6776  def set_centroids_ref(self, centroidsRef: numpy.ndarray[numpy.float32]) -> int:
6777  """
6778  Set the reference centroids
6779 
6780  Args:
6781  centroids_ref : (np.array(ndim=1, dtype=np.float32)): ref centroids
6782  """
6783  def set_gain(self, ncontrol: int, gain: float) -> None:
6784  """
6785  Set the loop gain in the controller
6786 
6787  Args:
6788  ncontrol: (int): controller index
6789 
6790  gain: (float): gain to set
6791  """
6792  def set_modal_gains(self, ncontrol: int, mgain: numpy.ndarray[numpy.float32]) -> None:
6793  """
6794  Set the modal gain in the controller
6795 
6796  Args:
6797  ncontrol: (int): controller index
6798 
6799  mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
6800  """
6801  @property
6802  def d_centro(self) -> typing.List[Centroider_UF]:
6803  """
6804  Vector of centroiders
6806  :type: typing.List[Centroider_UF]
6807  """
6808  @property
6809  def d_control(self) -> typing.List[Controller_FU]:
6810  """
6811  Vector of controllers
6813  :type: typing.List[Controller_FU]
6814  """
6815  pass
6816 class SHWFS(Wfs):
6817  def comp_nphot(self, ittime: float, optthroughput: float, diam: float, nxsub: int, zerop: float = 0, gsmag: float = 0, lgsreturnperwatt: float = 0, laserpower: float = 0) -> int:
6818  """
6819  Compute the currect number of photons for a given system
6820 
6821  Args:
6822  ittime: (float): 1/loop frequency [s].
6823 
6824  optthroughput: (float): wfs global throughput.
6826  diam: (float): telescope diameter.
6827 
6828  nxsub: (float): linear number of subaps.
6830  zerop: (float): (optional for LGS) detector zero point expressed in ph/m**2/s in the bandwidth of the WFS.
6831 
6832  gsmag: (float): (optional for LGS) magnitude of guide star.
6833 
6834  lgsreturnperwatt: (float): (optional for NGS) return per watt factor (high season : 10 ph/cm2/s/W).
6835 
6836  laserpower: (float): (optional for NGS) laser power in W.
6837  """
6838  def load_arrays(self, phasemap: numpy.ndarray[numpy.int32], hrmap: numpy.ndarray[numpy.int32], binmap: numpy.ndarray[numpy.int32], offsets: numpy.ndarray[numpy.float32], fluxPerSub: numpy.ndarray[numpy.float32], validsubsx: numpy.ndarray[numpy.int32], validsubsy: numpy.ndarray[numpy.int32], istart: numpy.ndarray[numpy.int32], jstart: numpy.ndarray[numpy.int32], ttprojmat: numpy.ndarray[numpy.float32], kernel: numpy.ndarray[numpy.complex64]) -> int:
6839  """
6840  Load SH WFS arrays
6841 
6842  Args:
6843  phasemap: TODO: docstring
6844 
6845  hrmap:
6846 
6847  binmap:
6848 
6849  offsets:
6850 
6851  fluxPerSub: (np.array[ndim=2,dtype=np.float32]): Normalized flux per ssp
6852 
6853  validsubsx: (np.array[ndim=1, dtype=np.int64]): X position of each valid ssp
6854 
6855  validsubsy: (np.array[ndim=1, dtype=np.int64]): Y position of each valid ssp
6856 
6857  istart:
6858 
6859  jstart:
6860 
6861  ttprojmat: (np.array[ndim=2, dtype=np.float32]): slope projection matrix
6862  for geom wfs.
6863 
6864  kernel:
6865  """
6866  def set_bincube(self, bincube: numpy.ndarray[numpy.float32], nElem: int) -> int:
6867  """
6868  Set the bincube of the SH WFS
6869 
6870  Args:
6871  bincube: (np.array[ndim=3, dtype=np.float32]) : cube of subap. images
6872 
6873  nElem: (int): Number of elements in bincube
6874 
6875  """
6876  @property
6877  def d_binmap(self) -> carmaWrap.obj_int:
6878  """
6879  TODO: docstring
6880 
6881  :type: carmaWrap.obj_int
6882  """
6883  @property
6884  def d_fsamplifoc(self) -> carmaWrap.obj_float_complex:
6885  """
6886  Focal plane with field stop
6887 
6888  :type: carmaWrap.obj_float_complex
6889  """
6890  @property
6891  def d_fsamplipup(self) -> carmaWrap.obj_float_complex:
6892  """
6893  Complex amplitude in the pupil in the field stop array size
6894 
6895  :type: carmaWrap.obj_float_complex
6896  """
6897  @property
6898  def d_validpuppixx(self) -> carmaWrap.obj_int:
6899  """
6900  X position of the bottom left corner of each ssp
6901 
6902  :type: carmaWrap.obj_int
6903  """
6904  @property
6905  def d_validpuppixy(self) -> carmaWrap.obj_int:
6906  """
6907  Y position of the bottom left corner of each ssp
6908 
6909  :type: carmaWrap.obj_int
6910  """
6911  pass
6912 class Sensors():
6913  def __init__(self, context: carmaWrap.context, d_tel: Telescope, type: typing.List[str], nwfs: int, nxsub: numpy.ndarray[numpy.int64], nvalid: numpy.ndarray[numpy.int64], npupils: numpy.ndarray[numpy.int64], npix: numpy.ndarray[numpy.int64], nphase: numpy.ndarray[numpy.int64], nrebin: numpy.ndarray[numpy.int64], nfft: numpy.ndarray[numpy.int64], ntot: numpy.ndarray[numpy.int64], npup: numpy.ndarray[numpy.int64], pdiam: numpy.ndarray[numpy.float32], nphot: numpy.ndarray[numpy.float32], nphot4imat: numpy.ndarray[numpy.float32], lgs: numpy.ndarray[numpy.int32], fakecam: numpy.ndarray[bool], max_flux_per_pix: numpy.ndarray[numpy.int32], max_pix_value: numpy.ndarray[numpy.int32], device: int, roket: bool) -> None:
6914  """
6915  Create and initialise a sensors object
6916 
6917  Args:
6918  context: (CarmaContext) : current carma context
6919 
6920  d_tel: (SutraTelescope) : SutraTelescope object
6921 
6922  type: (list of string): WFS types
6923 
6924  nwfs: (int) : number of WFS
6925 
6926  nxsub: (np.ndarray[ndim=1, dtype=np.int64]) : number of ssp in the diameter for each WFS
6927 
6928  nvalid: (np.ndarray[ndim=1, dtype=np.int64]) : number of valid ssp for each WFS
6929 
6930  npupils: (np.ndarray[ndim=1, dtype=np.int64]) : number of pupil images for each WFS
6931 
6932  npix: (np.ndarray[ndim=1,dtype=np.int64]) : number of pix per ssp for each WFS
6933 
6934  nphase: (np.ndarray[ndim=1,dtype=np.int64]) : number of phase points per ssp for each WFS
6935 
6936  nrebin: (np.ndarray[ndim=1,dtype=np.int64]) : rebin factor for each WFS
6937 
6938  nfft: (np.ndarray[ndim=1,dtype=np.int64]) : FFT support size for each WFS
6939 
6940  ntot: (np.ndarray[ndim=1,dtype=np.int64]) : HR support size for each WFS
6941 
6942  npup: (np.ndarray[ndim=1,dtype=np.int64]) : Pupil support size for each WFS
6943 
6944  pdiam: (np.ndarray[ndim=1,dtype=np.float32]) : ssp diameter in pixels for each WFS
6945 
6946  nphot: (np.ndarray[ndim=1,dtype=np.float32]) : photons per subap per iter for each WFS
6947 
6948  nphot4imat: (np.ndarray[ndim=1,dtype=np.float32]) : photons per subap per iter for each WFS (for imat computation only)
6949 
6950  lgs: (np.ndarray[ndim=1,dtype=np.int64]) : LGS flag for each WFS
6951 
6952  fakecam: (bool): if True, image is computed in uint16
6953 
6954  max_flux_per_pix: (np.ndarray[ndim=1, dtype=np.int32]): maximum number of photons a pixel can handle before saturation
6955 
6956  max_pix_value: (np.ndarray[ndim=1, dtype=np.int32]): maximum number of ADU possible in the uint16 image
6957 
6958  device: (int): GPU device index
6959 
6960  roket : (bool): flag for enabling ROKET
6961 
6962  """
6963  def initgs(self, xpos: numpy.ndarray[numpy.float32], ypos: numpy.ndarray[numpy.float32], lambda_um: numpy.ndarray[numpy.float32], mag: numpy.ndarray[numpy.float32], zerop: float, sizes: numpy.ndarray[numpy.int64], noise: numpy.ndarray[numpy.float32], seeds: numpy.ndarray[numpy.int64], G: numpy.ndarray[numpy.float32], thetaML: numpy.ndarray[numpy.float32], dx: numpy.ndarray[numpy.float32], dy: numpy.ndarray[numpy.float32]) -> int:
6964  """
6965  Initializes the guide stars of all WFS
6966 
6967  Args:
6968  xpos: (np.array(ndim=1,dtype=np.float32)): X position of the GSs [arcsec]
6969 
6970  ypos: (np.array(ndim=1,dtype=np.float32)): Y position of the GSs [arcsec]
6971 
6972  lambda_um: (np.array(ndim=1,dtype=np.float32)): Wavelength of the GSs [µm]
6973 
6974  mag: (np.array(ndim=1,dtype=np.float32)): Magnitude of the GSs
6975 
6976  zerop: (float): Flux at magnitude 0
6977 
6978  sizes: (np.array(ndim=1,dtype=np.int64)): Support size of the GSs
6979 
6980  noise: (np.array(ndim=1,dtype=np.float32)): Noise of the WFS [e-]
6981 
6982  seeds: (np.array(ndim=1,dtype=np.int64)): seeds for noise generation
6983 
6984  G: (np.array(ndim=1,dtype=np.float32)): Magnification factors for WFS misalignment
6986  thetaML: (np.array(ndim=1,dtype=np.float32)): Pupil rotation angle for WFS misalignment
6987 
6988  dx: (np.array(ndim=1,dtype=np.float32)): X axis misalignment for WFS
6989 
6990  dy: (np.array(ndim=1,dtype=np.float32)): Y axis misalignment for WFS
6991 
6992  """
6993  def set_field_stop(self, nwfs: int, field_stop: numpy.ndarray[numpy.float32], N: int) -> int:
6994  """
6995  Set new field stop for the specified SH WFS
6997  Args:
6998  nwfs: (int): WFS index
6999 
7000  field_stop: (np.array(ndim=2,dtype=np.float32)): Field stop to use
7001 
7002  N : (int): Size of the field stop array along one axis
7003  """
7004  @property
7005  def d_camplifoc(self) -> carmaWrap.obj_float_complex:
7006  """
7007  Complex amplitude in the focal plane
7008 
7009  :type: carmaWrap.obj_float_complex
7010  """
7011  @property
7012  def d_camplipup(self) -> carmaWrap.obj_float_complex:
7013  """
7014  Complex amplitude in the pupil
7015 
7016  :type: carmaWrap.obj_float_complex
7017  """
7018  @property
7019  def d_ftlgskern(self) -> carmaWrap.obj_float_complex:
7020  """
7021  Convolution kernel for LGS spot
7022 
7023  :type: carmaWrap.obj_float_complex
7024  """
7025  @property
7026  def d_fttotim(self) -> carmaWrap.obj_float_complex:
7027  """
7028  Buffer for FFT computation
7029 
7030  :type: carmaWrap.obj_float_complex
7031  """
7032  @property
7033  def d_lgskern(self) -> carmaWrap.obj_float:
7034  """
7035  LGS spot
7036 
7037  :type: carmaWrap.obj_float
7038  """
7039  @property
7040  def d_wfs(self) -> typing.List[SutraWfs]:
7041  """
7042  Vector of WFS
7043 
7044  :type: typing.List[SutraWfs]
7045  """
7046  @property
7047  def device(self) -> int:
7048  """
7049  GPU device index
7050 
7051  :type: int
7052  """
7053  @property
7054  def nsensors(self) -> int:
7055  """
7056  Number of WFS
7058  :type: int
7059  """
7060  @property
7061  def roket(self) -> bool:
7062  """
7063  ROKET flag
7064 
7065  :type: bool
7066  """
7067  pass
7068 class Source():
7069  def __str__(self) -> str: ...
7070  def add_layer(self, context: str, type: int, xoff: float, yoff: float) -> int:
7071  """
7072  Add a phase screen "dm" or "atmos" as layers to consider for raytracing
7073 
7074  Args:
7075  context: (CarmaContext) : carma or carmaWrap context
7076 
7077  type: (str) : "atmos" or "dm"
7078 
7079  xoff: (float) : x-offset for raytracing
7080 
7081  yoff: (float) : y-offset for raytracing
7083  """
7084  def comp_image(self, puponly: int = 0, comp_le: bool = True) -> int:
7085  """
7086  Compute short and long exposure images
7087 
7088  Args:
7089  puponly: (int) : Airy computation
7090 
7091  comp_le: (bool) : Flag for computing LE image
7092 
7093  """
7094  def comp_strehl(self, do_fit: bool = True) -> int:
7095  """
7096  Compute Strehl ratio
7097  """
7098  def init_strehlmeter(self) -> int:
7099  """
7100  Initialize Strehl ratio computation
7101  """
7102  @typing.overload
7103  def raytrace(self, rst: bool = False) -> int:
7104  """
7105  Raytrace through ncpa layers
7106 
7107  Args:
7108  rst: (bool): reset screen phase before raytracing
7109 
7110 
7111 
7112  Raytrace through telescope aberrations
7113 
7114  Args:
7115  tel: (SutraTelescope): SutraTelescope object
7116 
7117  rst: (bool): reset screen phase before raytracing
7118 
7119 
7120 
7121  Raytrace through turbulent layers. Calling this function will automatically reset the screen phase before raytracing.
7122 
7123  Args:
7124  atmos: (SutraAtmos): SutraAtmos object
7125 
7126  do_async: (bool): asynchronous mode
7127 
7129 
7130  Raytrace through DMs
7131 
7132  Args:
7133  dms: (SutraDms): SutraDms object
7134 
7135  rst: (bool): reset phase screen before raytracing
7136 
7137  do_phase_var: (bool): compute the residual phase variance
7138 
7139  do_async: (bool): asynchronous mode
7140 
7142 
7143  Raytrace through all layers (turbu, dms, telescope, ncpa)
7144 
7145  Args:
7146  tel: (sutra_tel): SutraTelescope object
7147 
7148  atm: (SutraAtmos): SutraAtmos object
7149 
7150  dms: (SutraDms): SutraDms object
7151 
7152  do_phase_var: (bool): compute the residual phase variance
7153 
7154  do_async: (bool): asynchronous mode
7155  """
7156  @typing.overload
7157  def raytrace(self, tel: Telescope, rst: bool = False) -> int: ...
7158  @typing.overload
7159  def raytrace(self, atmos: Atmos, do_async: bool = False) -> int: ...
7160  @typing.overload
7161  def raytrace(self, dms: Dms, rst: bool = False, do_phase_var: bool = True, do_async: bool = False) -> int: ...
7162  @typing.overload
7163  def raytrace(self, dms: Telescope, atm: Atmos, tel: Dms, do_phase_var: bool = True, do_async: bool = False) -> int: ...
7164  def remove_layer(self, type: str, idx: int) -> int:
7165  """
7166  Remove a phase screen for raytracing
7167 
7168  Args:
7169  type: (str) : "atmos" or "dm"
7170 
7171  idx: (int) : index of the DM or turbulent layer to remove
7172 
7173  """
7174  def reset_phase(self) -> int:
7175  """
7176  Reset the phase screen
7177  """
7178  def reset_strehlmeter(self) -> int:
7179  """
7180  Reset Strehl ratio
7181  """
7182  def set_ncpa(self, data: numpy.ndarray[numpy.float32]) -> None:
7183  """
7184  Set the NCPA phase
7185 
7186  Args:
7187  data: (np.array(ndim=2,dtype=np.float32)): NCPA phase to set
7188 
7189  """
7190  def set_phase(self, data: numpy.ndarray[numpy.float32]) -> None:
7191  """
7192  Set the target screen phase
7193 
7194  Args:
7195  data: (np.array(ndim=2,dtype=np.float32)): target phase to set
7196  """
7197  @property
7198  def G(self) -> float:
7199  """
7200  Magnifying factor for WFS misalignment
7201 
7202  :type: float
7203  """
7204  @property
7205  def block_size(self) -> int:
7206  """
7207  Optimum block size of device
7208 
7209  :type: int
7210  """
7211  @property
7212  def d_amplipup(self) -> carmaWrap.obj_float_complex:
7213  """
7214  Complex amplitude in the pupil plane
7215 
7216  :type: carmaWrap.obj_float_complex
7217  """
7218  @property
7219  def d_image_le(self) -> carmaWrap.obj_float:
7220  """
7221  Long exposure image of the source
7222 
7223  :type: carmaWrap.obj_float
7224  """
7225  @property
7226  def d_image_se(self) -> carmaWrap.obj_float:
7227  """
7228  Short exposure image of the source
7229 
7230  :type: carmaWrap.obj_float
7231  """
7232  @property
7233  def d_lgs(self) -> SutraLGS:
7234  """
7235  LGS structure of WFS
7236 
7237  :type: SutraLGS
7238  """
7239  @property
7240  def d_ncpa_phase(self) -> carmaWrap.obj_float:
7241  """
7242  NCPA phase
7243 
7244  :type: carmaWrap.obj_float
7245  """
7246  @property
7247  def d_phase(self) -> carmaWrap.obj_float:
7248  """
7249  Phase screen of the source
7250 
7251  :type: carmaWrap.obj_float
7252  """
7253  @property
7254  def d_phasepts(self) -> carmaWrap.obj_float:
7255  """
7256  Phase on the valid pixels of the pupil plane
7257 
7258  :type: carmaWrap.obj_float
7259  """
7260  @property
7261  def d_pupil(self) -> carmaWrap.obj_float:
7262  """
7263  Pupil mask
7264 
7265  :type: carmaWrap.obj_float
7266  """
7267  @property
7268  def d_wherephase(self) -> carmaWrap.obj_int:
7269  """
7270  Indices of the valid pixels of the pupil
7271 
7272  :type: carmaWrap.obj_int
7273  """
7274  @property
7275  def device(self) -> int:
7276  """
7277  GPU device index
7278 
7279  :type: int
7280  """
7281  @property
7282  def dx(self) -> float:
7283  """
7284  X axis WFS misalignment [pixels]
7285 
7286  :type: float
7287  """
7288  @property
7289  def dy(self) -> float:
7290  """
7291  Y axis WFS misalignment [pixels]
7293  :type: float
7294  """
7295  @property
7296  def lambda_um(self) -> float:
7297  """
7298  Wavelength of the source in µm
7299 
7300  :type: float
7301  """
7302  @property
7303  def lgs(self) -> bool:
7304  """
7305  Boolean for LGS
7306 
7307  :type: bool
7308  """
7309  @property
7310  def mag(self) -> float:
7311  """
7312  Magnitude of the source
7313 
7314  :type: float
7315  """
7316  @property
7317  def npts(self) -> int:
7318  """
7319  Number of points in the pupil
7320 
7321  :type: int
7322  """
7323  @property
7324  def phase_telemetry(self) -> carmaWrap.host_obj_float:
7325  """
7326  TODO: docstring
7327 
7328  :type: carmaWrap.host_obj_float
7329  """
7330  @property
7331  def phase_var(self) -> float:
7332  """
7333  Short exposure variance in the pupil [µm²]
7334 
7335  :type: float
7336  """
7337  @property
7338  def phase_var_avg(self) -> float:
7339  """
7340  Long exposure variance in the pupil [µm²]
7342  :type: float
7343  """
7344  @property
7345  def phase_var_count(self) -> int:
7346  """
7347  Counter fo long exposure variance computation
7349  :type: int
7350  """
7351  @property
7352  def posx(self) -> float:
7353  """
7354  X position of the source
7356  :type: float
7357  """
7358  @property
7359  def posy(self) -> float:
7360  """
7361  Y position of the source
7363  :type: float
7364  """
7365  @property
7366  def ref_strehl(self) -> float:
7367  """
7368  reference for Strehl computation (Airy)
7369 
7370  :type: float
7371  """
7372  @property
7373  def scale(self) -> float:
7374  """
7375  Phase scale factor (2*pi/lambda)
7376 
7377  :type: float
7378  """
7379  @property
7380  def strehl_counter(self) -> int:
7381  """
7382  Counter for LE Strehl computation
7383 
7384  :type: int
7385  """
7386  @property
7387  def strehl_le(self) -> float:
7388  """
7389  Long exposure Strehl ratio
7390 
7391  :type: float
7392  """
7393  @property
7394  def strehl_se(self) -> float:
7395  """
7396  Short exposure Strehl ratio
7397 
7398  :type: float
7399  """
7400  @property
7401  def thetaML(self) -> float:
7402  """
7403  Pupil rotation angle for WFS misalignment
7404 
7405  :type: float
7406  """
7407  @property
7408  def type(self) -> str:
7409  """
7410  Type of source (Target or WFS GS)
7411 
7412  :type: str
7413  """
7414  @property
7415  def xoff(self) -> typing.Dict[typing.Tuple[str, int], float]:
7416  """
7417  X offset for raytracing
7418 
7419  :type: typing.Dict[typing.Tuple[str, int], float]
7420  """
7421  @property
7422  def yoff(self) -> typing.Dict[typing.Tuple[str, int], float]:
7423  """
7424  Y offset for raytracing
7425 
7426  :type: typing.Dict[typing.Tuple[str, int], float]
7427  """
7428  @property
7429  def zp(self) -> float:
7430  """
7431  Flux at magnitude 0
7432 
7433  :type: float
7434  """
7435  pass
7436 class StellarCoronagraph(Coronagraph):
7437  def __init__(self, context: carmaWrap.context, d_source: Source, im_dimx: int, im_dimy: int, fpm_dimx: int, fpm_dimy: int, wavelength: numpy.ndarray[numpy.float32], nWavelength: int, babinet: int, device: int) -> None:
7438  """
7439  Instantiates a StellarCoronagraph object
7440 
7441  Args:
7442  context: (CarmaContext): context
7443 
7444  d_source: (SutraSource): Coronagraph source input
7445 
7446  im_dimx: (int): Coronagraphic image dimension along x axis
7447 
7448  im_dimy: (int): Coronagraphic image dimension along y axis
7449 
7450  fpm_dimx: (int): Focal plane dimension along x axis
7451 
7452  fpm_dimy: (int): Focal plane dimension along y axis
7454  wavelength: (np.ndarray[ndim=1, dtype=np.float32]): vector of wavelengths
7455 
7456  nWavelength: (int): number of wavelength
7458  babinet: (bool): Flag to enable Babinet trick
7459 
7460  device: (int): GPU device index
7461  """
7462  def compute_image_normalization(self) -> int:
7463  """
7464  Compute image for normalization
7465 
7466  """
7467  def set_apodizer(self, mask: numpy.ndarray[numpy.float32]) -> int:
7468  """
7469  Set apodizer for coronagraphic image computation
7470 
7471  Args:
7472  mask: (np.ndarray[ndim=2, dtype=np.float32]): apodizer
7473  """
7474  def set_focal_plane_mask(self, mask: numpy.ndarray[numpy.float32]) -> int:
7475  """
7476  Set focal plane mask for coronagraphic image computation
7477 
7478  Args:
7479  mask: (np.ndarray[ndim=3, dtype=np.float32]): Focal plane mask for each wavelength
7480  """
7481  def set_lyot_stop(self, mask: numpy.ndarray[numpy.float32]) -> int:
7482  """
7483  Set lyot_stop for coronagraphic image computation
7484 
7485  Args:
7486  mask: (np.ndarray[ndim=2, dtype=np.float32]): lyot_stop
7487  """
7488  def set_mft(self, A: numpy.ndarray[numpy.complex64], B: numpy.ndarray[numpy.complex64], norm: numpy.ndarray[numpy.float32], mft_type: str) -> int:
7489  """
7490  Set MFT matrices for coronagraphic image computation
7491 
7492  Args:
7493  A : (np.ndarray[dtype=np.complex32, ndims=3]): A MFT matrix for each wavelength
7494 
7495  B : (np.ndarray[dtype=np.complex32, ndims=3]): B MFT matrix for each wavelength
7496 
7497  norm : (np.ndarray[dtype=np.complex32, ndims=3]): MFT normalization for each wavelength
7498 
7499  mft_type : (str): MFT matrices to set, i.e. "img" or "psf"
7500  """
7501  @property
7502  def AA(self) -> typing.Dict[str, typing.Tuple[typing.List[carmaWrap.obj_float_complex], typing.List[int]]]:
7503  """
7504  A MFT matrices
7506  :type: typing.Dict[str, typing.Tuple[typing.List[carmaWrap.obj_float_complex], typing.List[int]]]
7507  """
7508  @property
7509  def BB(self) -> typing.Dict[str, typing.Tuple[typing.List[carmaWrap.obj_float_complex], typing.List[int]]]:
7510  """
7511  B MFT matrices
7512 
7513  :type: typing.Dict[str, typing.Tuple[typing.List[carmaWrap.obj_float_complex], typing.List[int]]]
7514  """
7515  @property
7516  def babinet(self) -> bool:
7517  """
7518  Babinet trick flag
7519 
7520  :type: bool
7521  """
7522  @property
7523  def d_apodizer(self) -> carmaWrap.obj_float:
7524  """
7525  Apodizer
7526 
7527  :type: carmaWrap.obj_float
7528  """
7529  @property
7530  def d_lyot_stop(self) -> carmaWrap.obj_float:
7531  """
7532  Lyot stop
7533 
7534  :type: carmaWrap.obj_float
7535  """
7536  @property
7537  def focal_plane_mask(self) -> typing.List[carmaWrap.obj_float]:
7538  """
7539  Focal plane mask
7540 
7541  :type: typing.List[carmaWrap.obj_float]
7542  """
7543  @property
7544  def fpmDimx(self) -> int:
7545  """
7546  Focal plane dimension
7547 
7548  :type: int
7549  """
7550  @property
7551  def fpmDimy(self) -> int:
7552  """
7553  Focal plane dimension
7554 
7555  :type: int
7556  """
7557  @property
7558  def norm(self) -> typing.Dict[str, typing.List[float]]:
7559  """
7560  MFT normalization
7561 
7562  :type: typing.Dict[str, typing.List[float]]
7563  """
7564  pass
7565 class Target():
7566  def __init__(self, context: carmaWrap.context, d_tel: Telescope, ntargets: int, xpos: numpy.ndarray[numpy.float32], ypos: numpy.ndarray[numpy.float32], lambda_um: numpy.ndarray[numpy.float32], mag: numpy.ndarray[numpy.float32], zerop: float, sizes: numpy.ndarray[numpy.int64], Npts: int, device: int) -> None:
7567  """
7568  Create and initialise an target object
7569 
7570  Args:
7571  context: (CarmaContext) : current carma context
7572 
7573  d_tel: (SutraTelescope) : SutraTelescope object
7574 
7575  ntargets: (int): number of targets
7576 
7577  xpos: (np.ndarray[ndim=1,dtype=np.float32_t]) : X positions of each target in arcsec
7578 
7579  ypos: (np.ndarray[ndim=1,dtype=np.float32_t]) : Y positions of each target in arcsec
7580 
7581  lambda_um: (np.ndarray[ndim=1,dtype=np.float32_t]) : Wavelength of each target in µm
7582 
7583  mag: (np.ndarray[ndim=1,dtype=np.float32_t]) : magnitude of each target
7584 
7585  zerop: (float) : Flux at magnitude 0 in photons/m²/s
7586 
7587  sizes: (np.ndarray[ndim=1,dtype=np.int64_t]) : Support size of each target
7588 
7589  Npts : (int): number of points in the pupil
7590 
7591  device: (int): GPU device index
7592 
7593  """
7594  def __str__(self) -> str: ...
7595  @property
7596  def d_targets(self) -> typing.List[Source]:
7597  """
7598  Vector of targets
7599 
7600  :type: typing.List[Source]
7601  """
7602  @property
7603  def ntargets(self) -> int:
7604  """
7605  Number of targets
7607  :type: int
7608  """
7609  pass
7610 class Telescope():
7611  def __init__(self, context: carmaWrap.context, n_pup: int, npos: int, pupil: numpy.ndarray[numpy.float32], n_pup_m: int, pupil_m: numpy.ndarray[numpy.float32]) -> None:
7612  """
7613  Create and initialise a Telescope object
7614 
7615  Args:
7616  context: (CarmaContext) : current carma context
7618  n_pup: (long) : spupil size
7619 
7620  npos : (long): number of points in the pupil
7621 
7622  pupil: (np.ndarray[ndim=2, dtype=np.float32_t]) : spupil
7623 
7624  n_pup_m: (long) : mpupil size
7625 
7626  pupil_m: (np.ndarray[ndim=2, dtype=np.float32_t]) : mpupil
7627 
7628  """
7629  def reset_input_phase(self) -> int:
7630  """
7631  Reset circular buffer d_input_phase
7632  """
7633  def set_input_phase(self, phase_ab: numpy.ndarray[numpy.float32]) -> int:
7634  """
7635  Set a 3D cube of phase screens to be played. Each phase screen is shown to sources as an additional layer to be raytraced. Each phase screen must have the same dimensions as m_pupil
7636 
7637  Args:
7638  input_hase: (np.ndarray[ndim=3,dtype=np.float32_t]) : Cube of input phase screens
7639 
7640  """
7641  def set_phase_ab_M1(self, phase_ab: numpy.ndarray[numpy.float32]) -> int:
7642  """
7643  Set the M1 phase aberration in the small pupil
7644 
7645  Args:
7646  phase_ab: (np.ndarray[ndim=2,dtype=np.float32_t]) : M1 phase aberration in the small pupil
7647 
7648  """
7649  def set_phase_ab_M1_m(self, phase_ab: numpy.ndarray[numpy.float32]) -> int:
7650  """
7651  Set the M1 phase aberration in the medium pupil
7652 
7653  Args:
7654  phase_ab: (np.ndarray[ndim=2,dtype=np.float32_t]) : M1 phase aberration in the medium pupil
7655 
7656  """
7657  def set_pupil(self, pup: numpy.ndarray[numpy.float32]) -> None:
7658  """
7659  Set the small pupil
7660 
7661  Args:
7662  pup: (np.ndarray[ndim=2,dtype=np.float32_t]) : small pupil
7663 
7664  """
7665  def set_pupil_m(self, pup: numpy.ndarray[numpy.float32]) -> None:
7666  """
7667  Set the medium pupil
7668 
7669  Args:
7670  pup: (np.ndarray[ndim=2,dtype=np.float32_t]) : medium pupil
7672  """
7673  def update_input_phase(self) -> int:
7674  """
7675  Update input_phase_counter to take the next phase screen in the circular buffer d_input_phase
7676  """
7677  @property
7678  def d_input_phase(self) -> carmaWrap.obj_float:
7679  """
7680  Cube of user-defined input phase screens
7681 
7682  :type: carmaWrap.obj_float
7683  """
7684  @property
7685  def d_phase_ab_M1(self) -> carmaWrap.obj_float:
7686  """
7687  M1 aberrations on the small pupil
7688 
7689  :type: carmaWrap.obj_float
7690  """
7691  @property
7692  def d_phase_ab_M1_m(self) -> carmaWrap.obj_float:
7693  """
7694  M1 aberrations on the medium pupil
7695 
7696  :type: carmaWrap.obj_float
7697  """
7698  @property
7699  def d_pupil(self) -> carmaWrap.obj_float:
7700  """
7701  Small pupil of the Telescope
7702 
7703  :type: carmaWrap.obj_float
7704  """
7705  @property
7706  def d_pupil_m(self) -> carmaWrap.obj_float:
7707  """
7708  Medium pupil of the Telescope
7709 
7710  :type: carmaWrap.obj_float
7711  """
7712  @property
7713  def device(self) -> int:
7714  """
7715  Device number
7716 
7717  :type: int
7718  """
7719  @property
7720  def input_phase_counter(self) -> int:
7721  """
7722  Index of the current phase screen in the cube d_input_phase
7723 
7724  :type: int
7725  """
7726  @property
7727  def num_eleme_pup(self) -> int:
7728  """
7729  number of points in the pupil
7730 
7731  :type: int
7732  """
7733  @property
7734  def pup_size(self) -> int:
7735  """
7736  Small Pupil size
7737 
7738  :type: int
7739  """
7740  @property
7741  def pup_size_m(self) -> int:
7742  """
7743  Medium Pupil size
7745  :type: int
7746  """
7747  pass
7748 class Tscreen():
7749  def set_deltax(self, deltax: float) -> int:
7750  """
7751  Set the screen movement along the X-axis at each iteration in pixels
7752 
7753  Args:
7754  deltax: (float) : Number of columns to add at each iteration
7755 
7756  """
7757  def set_deltay(self, deltay: float) -> int:
7758  """
7759  Set the screen movement along the Y-axis at each iteration in pixels
7761  Args:
7762  deltay: (float) : Number of lines to add at each iteration
7763 
7764  """
7765  def set_istencilx(self, stencil: numpy.ndarray[numpy.uint32]) -> int:
7766  """
7767  Set the stencil along the X-Axis
7768 
7769  Args:
7770  stencil: (np.array) : Stencil along the X-axis
7771 
7772  """
7773  def set_istencily(self, stencil: numpy.ndarray[numpy.uint32]) -> int:
7774  """
7775  Set the stencil along the Y-Axis
7776 
7777  Args:
7778  stencil: (np.array) : Stencil along the Y-axis
7779 
7780  """
7781  @property
7782  def accumx(self) -> float:
7783  """
7784  accumulate columns to extrude
7785 
7786  :type: float
7787  """
7788  @property
7789  def accumy(self) -> float:
7790  """
7791  accumulate rows to extrude
7792 
7793  :type: float
7794  """
7795  @property
7796  def altitude(self) -> float:
7797  """
7798  altitude of the phase screen
7799 
7800  :type: float
7801  """
7802  @property
7803  def amplitude(self) -> float:
7804  """
7805  amplitude for extrusion (r0**(-5/6)
7806 
7807  :type: float
7808  """
7809  @property
7810  def d_istencilx(self) -> carmaWrap.obj_uint:
7811  """
7812  stencil for row extrusion
7813 
7814  :type: carmaWrap.obj_uint
7815  """
7816  @property
7817  def d_istencily(self) -> carmaWrap.obj_uint:
7818  """
7819  stencil for column extrusion
7820 
7821  :type: carmaWrap.obj_uint
7822  """
7823  @property
7824  def d_mat_a(self) -> carmaWrap.obj_float:
7825  """
7826  A matrix for extrusion
7827 
7828  :type: carmaWrap.obj_float
7829  """
7830  @property
7831  def d_mat_b(self) -> carmaWrap.obj_float:
7832  """
7833  B matrix for extrusion
7834 
7835  :type: carmaWrap.obj_float
7836  """
7837  @property
7838  def d_noise(self) -> carmaWrap.obj_float:
7839  """
7840  random numbers for extrusion
7841 
7842  :type: carmaWrap.obj_float
7843  """
7844  @property
7845  def d_screen(self) -> carmaWrap.obj_float:
7846  """
7847  Turbulent phase screen
7849  :type: carmaWrap.obj_float
7850  """
7851  @property
7852  def d_ytmp(self) -> carmaWrap.obj_float:
7853  """
7854  contains the extrude update
7855 
7856  :type: carmaWrap.obj_float
7857  """
7858  @property
7859  def d_z(self) -> carmaWrap.obj_float:
7860  """
7861  tmp array for extrusion process
7862 
7863  :type: carmaWrap.obj_float
7864  """
7865  @property
7866  def deltax(self) -> float:
7867  """
7868  number of columns to extrude per iteration
7869 
7870  :type: float
7871  """
7872  @property
7873  def deltay(self) -> float:
7874  """
7875  number of rows to extrude per iteration
7876 
7877  :type: float
7878  """
7879  @property
7880  def device(self) -> int:
7881  """
7882  Device index
7883 
7884  :type: int
7885  """
7886  @property
7887  def r0(self) -> float:
7888  """
7889  layer r0 in pixels
7890 
7891  :type: float
7892  """
7893  @property
7894  def screen_size(self) -> int:
7895  """
7896  size of phase screen
7897 
7898  :type: int
7899  """
7900  @property
7901  def winddir(self) -> float:
7902  """
7903  wind direction of phase screen
7904 
7905  :type: float
7906  """
7907  @property
7908  def windspeed(self) -> float:
7909  """
7910  wind speed of phase screen
7911 
7912  :type: float
7913  """
7914  pass
7915 class PYRWFS(Wfs):
7916  def comp_nphot(self, ittime: float, optthroughput: float, diam: float, cobs: float, zerop: float = 0, gsmag: float = 0) -> int:
7917  """
7918  Compute the currect number of photons for a given system
7919 
7920  Args:
7921  ittime: (float): 1/loop frequency [s].
7922 
7923  optthroughput: (float): wfs global throughput.
7924 
7925  diam: (float): telescope diameter.
7926 
7927  cobs: (float): telescope central obstruction.
7928 
7929  zerop: (float): (optional for LGS) detector zero point expressed in ph/m**2/s in the bandwidth of the WFS.
7930 
7931  gsmag: (float): (optional for LGS) magnitude of guide star.
7932  """
7933  def copy_valid_pix(self, data: numpy.ndarray[numpy.float32], validx: numpy.ndarray[numpy.int32], validy: numpy.ndarray[numpy.int32], dim: int) -> int:
7934  """
7935  Copy the given pixels on the right place in the binimg of PWFS
7936 
7937  Args:
7938  data:
7939 
7940  validx:
7941 
7942  validy:
7943 
7944  dim:
7945 
7946  """
7947  def load_arrays(self, halfxy: numpy.ndarray[numpy.complex64], cx: numpy.ndarray[numpy.float32], cy: numpy.ndarray[numpy.float32], weights: numpy.ndarray[numpy.float32], sincar: numpy.ndarray[numpy.float32], submask: numpy.ndarray[numpy.float32], validsubsx: numpy.ndarray[numpy.int32], validsubsy: numpy.ndarray[numpy.int32], phasemap: numpy.ndarray[numpy.int32], fluxPerSub: numpy.ndarray[numpy.float32], ttprojmat: numpy.ndarray[numpy.float32]) -> int:
7948  """
7949  Load PYRHR WFS arrays
7950 
7951  Args:
7952  halfxy:
7953 
7954  cx:
7955 
7956  cy:
7957 
7958  weights:
7960  sincar:
7961 
7962  submask:
7963 
7964  validsubsx:
7965 
7966  validsubsy:
7967 
7968  phasemap:
7969 
7970  fluxPerSub:
7971 
7972  ttprojmat: (np.array[ndim=2, dtype=np.float32]): slope projection matrix
7973  for geom wfs.
7974 
7975 
7976  """
7977  def set_phalfxy(self, phalfxy: numpy.ndarray[numpy.complex64]) -> int:
7978  """
7979  Set the pyramid mask for each modulation point
7980 
7981  Args:
7982  phalfxy: (np.ndarray[ndim=2, dtype=np.complex64]): pyramid mask for each modulation point
7983 
7984  """
7985  def set_pyr_mod_weights(self, weights: numpy.ndarray[numpy.float32], npts: int) -> int:
7986  """
7987  Set the modulation points weights of a PWFS
7988 
7989  Args:
7990  weights: (np.ndarray[ndim=1, dtype=np.float32_t]): modulation points weights ponderation
7991 
7992  npts: (int): number of modulation points
7993 
7994  """
7995  @typing.overload
7996  def set_pyr_modulation_points(self, cx: numpy.ndarray[numpy.float32], cy: numpy.ndarray[numpy.float32], npts: int) -> int:
7997  """
7998  Set the modulation points of a PWFS
7999 
8000  Args:
8001  cx: (np.ndarray[ndim=1, dtype=np.float32_t]): X position of modulation points
8002 
8003  cy: (np.ndarray[ndim=1, dtype=np.float32_t]): Y position of modulation points
8005  npts: (int): number of modulation points
8006 
8007 
8008 
8009  Set the modulation points and weights of a PWFS
8010 
8011  Args:
8012  cx: (np.ndarray[ndim=1, dtype=np.float32_t]): X position of modulation points
8014  cy: (np.ndarray[ndim=1, dtype=np.float32_t]): Y position of modulation points
8015 
8016  weights: (np.ndarray[ndim=1, dtype=np.float32_t]): modulation points weights ponderation
8017 
8018  npts: (int): number of modulation points
8019 
8020  """
8021  @typing.overload
8022  def set_pyr_modulation_points(self, cx: numpy.ndarray[numpy.float32], cy: numpy.ndarray[numpy.float32], weights: numpy.ndarray[numpy.float32], npts: int) -> int: ...
8023  def set_pyrimg(self, img: numpy.ndarray[numpy.float32]) -> None:
8024  """
8025  Set the image of the PWFS
8026 
8027  Args:
8028  img: (np.array[ndim=2,dtype=np.float32]): new image to set
8029 
8030  """
8031  def set_submask(self, mask: numpy.ndarray[numpy.float32]) -> None:
8032  """
8033  Set the field stop of the PWFS
8034 
8035  Args:
8036  mask: (np.array[ndim=2,dtype=np.float32]): new field stop to set
8037 
8038  """
8039  def set_validpix(self, datax: numpy.ndarray[numpy.int32], datay: numpy.ndarray[numpy.int32]) -> None:
8040  """
8041  Set the valid pixels of the PWFS
8042 
8043  Args:
8044  datax: (np.array[ndim=2,dtype=np.float32]): new X positions of valid pixels
8045 
8046  datay: (np.array[ndim=2,dtype=np.float32]): new Y positions of valid pixels
8047 
8048  """
8049  @property
8050  def compute_pyrfocalplane(self) -> bool:
8051  """
8052  TODO: docstring
8054  :type: bool
8055  """
8056  @compute_pyrfocalplane.setter
8057  def compute_pyrfocalplane(self, arg0: bool) -> None:
8058  """
8059  TODO: docstring
8060  """
8061  @property
8062  def d_hrimg(self) -> carmaWrap.obj_float:
8063  """
8064  TODO: docstring
8065 
8066  :type: carmaWrap.obj_float
8067  """
8068  @property
8069  def d_phalfxy(self) -> carmaWrap.obj_float_complex:
8070  """
8071  TODO: docstring
8072 
8073  :type: carmaWrap.obj_float_complex
8074  """
8075  @property
8076  def d_poffsets(self) -> carmaWrap.obj_float_complex:
8077  """
8078  TODO: docstring
8079 
8080  :type: carmaWrap.obj_float_complex
8081  """
8082  @property
8083  def d_psum(self) -> carmaWrap.obj_float:
8084  """
8085  TODO: docstring
8087  :type: carmaWrap.obj_float
8088  """
8089  @property
8090  def d_pyrfocalplane(self) -> carmaWrap.obj_float:
8091  """
8092  TODO: docstring
8093 
8094  :type: carmaWrap.obj_float
8095  """
8096  @property
8097  def npupils(self) -> int:
8098  """
8099  Number of pupil images
8100 
8101  :type: int
8102  """
8103  @property
8104  def pyr_cx(self) -> carmaWrap.host_obj_float:
8105  """
8106  TODO: docstring
8107 
8108  :type: carmaWrap.host_obj_float
8109  """
8110  @property
8111  def pyr_cy(self) -> carmaWrap.host_obj_float:
8112  """
8113  Modulation points X-positions
8114 
8115  :type: carmaWrap.host_obj_float
8116  """
8117  @property
8118  def pyr_mod_weights(self) -> carmaWrap.host_obj_float:
8119  """
8120  Ponderation weights for each modulation points
8121 
8122  :type: carmaWrap.host_obj_float
8123  """
8124  pass
8125 __version__ = '5.4.4'
int set_seed(self, int idx, float seed)
Set the seed of the selected screen RNG.
Definition: sutraWrap.py:225
int refresh_screen(self, int idx)
Refresh the selected screen by extrusion.
Definition: sutraWrap.py:207
nscreens
Number of turbulent screens.
Definition: sutraWrap.py:241
d_screens
Vector of tscreens.
Definition: sutraWrap.py:232
str __str__(self)
Definition: sutraWrap.py:144
int add_screen(self, float altitude, int size, int stencil_size, float r0, float windspeed, float winddir, float deltax, float deltay, int device)
Add a screen to the atmos object.
Definition: sutraWrap.py:168
int move_atmos(self)
Move the turbulence in the atmos screen following loaded parameters such as windspeed and wind direct...
Definition: sutraWrap.py:199
int del_screen(self, int idx)
Delete the selected screen.
Definition: sutraWrap.py:176
int set_r0(self, float r0)
Change the current global r0 of all layers.
Definition: sutraWrap.py:215
r0
Global r0.
Definition: sutraWrap.py:250
int init_screen(self, int idx, numpy.ndarray[numpy.float32] A, numpy.ndarray[numpy.float32] B, numpy.ndarray[numpy.uint32] istencilx, numpy.ndarray[numpy.uint32] istencily, int seed)
Initialize an newly allocated screen.
Definition: sutraWrap.py:194
d_validy
Y positions of the valid ssp.
Definition: sutraWrap.py:527
int init_calib(self, int n, int m)
Initialize data used for calibration.
Definition: sutraWrap.py:275
int set_npix(self, int npix)
Set the number of pixels per subap for a RTC standalone.
Definition: sutraWrap.py:373
d_ref_Tip
Tip mode reference for filtering.
Definition: sutraWrap.py:500
int set_flat(self, numpy.ndarray[numpy.float32] flat, int n)
Set the flat frame for calibration.
Definition: sutraWrap.py:357
nvalid
Number of valid ssp of the WFS.
Definition: sutraWrap.py:572
d_lutPix
Lookup Table of pixels for calibration.
Definition: sutraWrap.py:482
d_validMask
Flat frame for calibration.
Definition: sutraWrap.py:509
type
Centroider type.
Definition: sutraWrap.py:608
int init_img_raw(self, int n, int m)
Initialize array to store raw WFS image in RTC standalone mode.
Definition: sutraWrap.py:284
int calibrate_img_validPix(self)
Performs the raw WFS frame calibration only on useful pixels.
Definition: sutraWrap.py:262
d_ref_Tilt
Tilt mode reference for filtering.
Definition: sutraWrap.py:491
int get_cog(self)
Computes centroids and stores it in d_slopes of the WFS.
Definition: sutraWrap.py:266
offset
Offset for centroiding computation.
Definition: sutraWrap.py:590
int load_validpos(self, numpy.ndarray[numpy.int32] validx, numpy.ndarray[numpy.int32] validy, int N)
Load the validx and validy arrays.
Definition: sutraWrap.py:332
nxsub
Number of ssp across the pupil diameter.
Definition: sutraWrap.py:581
d_dark
Dark frame for calibration.
Definition: sutraWrap.py:437
d_bincube
Bincube of the WFS image.
Definition: sutraWrap.py:419
d_centroids_ref
Reference slopes vector.
Definition: sutraWrap.py:428
int set_offset(self, float offset)
Set the controider offset [pixels].
Definition: sutraWrap.py:387
int calibrate_img(self)
Performs the raw WFS frame calibration.
Definition: sutraWrap.py:258
d_TT_slopes
Tip/tilt slopes removed after filtering.
Definition: sutraWrap.py:410
int set_dark(self, numpy.ndarray[numpy.float32] dark, int n)
Set the dark frame for calibration.
Definition: sutraWrap.py:348
int set_nxsub(self, int nxsub)
Set the number of ssp across the pupil diameter for a RTC standalone.
Definition: sutraWrap.py:380
wfs
SutraWfs handled by this centroider.
Definition: sutraWrap.py:617
d_flat
Flat frame for calibration.
Definition: sutraWrap.py:446
nslopes
Number of slopes.
Definition: sutraWrap.py:563
device
GPU device index.
Definition: sutraWrap.py:536
d_validx
X positions of the valid ssp.
Definition: sutraWrap.py:518
d_intensities
intensities of the WFS image
Definition: sutraWrap.py:473
int load_img(self, numpy.ndarray[numpy.float32] img, int m, int n, int location)
Load an image in a RTC standalone (host to device)
Definition: sutraWrap.py:317
npix
Number of pixels along a side of WFS subap.
Definition: sutraWrap.py:554
scale
Scale factor to get slopes in arcsec.
Definition: sutraWrap.py:599
filter_TT
Tip/tilt filtering flag.
Definition: sutraWrap.py:545
int set_centroids_ref(self, numpy.ndarray[numpy.float32] refslopes)
Set the references slopes.
Definition: sutraWrap.py:339
d_img_raw
Raw WFS image.
Definition: sutraWrap.py:464
int set_scale(self, float scale)
Set the controider scale factor.
Definition: sutraWrap.py:394
int set_lutPix(self, numpy.ndarray[numpy.int32] lutPix, int n)
Set the lookup Table Pixel vector for calibration.
Definition: sutraWrap.py:366
d_img
Calibrated WFS image.
Definition: sutraWrap.py:455
d_validMask
Flat frame for calibration.
Definition: sutraWrap.py:876
d_dark
Dark frame for calibration.
Definition: sutraWrap.py:804
nvalid
Number of valid ssp of the WFS.
Definition: sutraWrap.py:939
type
Centroider type.
Definition: sutraWrap.py:975
d_bincube
Bincube of the WFS image.
Definition: sutraWrap.py:786
int set_lutPix(self, numpy.ndarray[numpy.int32] lutPix, int n)
Set the lookup Table Pixel vector for calibration.
Definition: sutraWrap.py:733
d_ref_Tilt
Tilt mode reference for filtering.
Definition: sutraWrap.py:858
int set_nxsub(self, int nxsub)
Set the number of ssp across the pupil diameter for a RTC standalone.
Definition: sutraWrap.py:747
device
GPU device index.
Definition: sutraWrap.py:903
d_TT_slopes
Tip/tilt slopes removed after filtering.
Definition: sutraWrap.py:777
d_lutPix
Lookup Table of pixels for calibration.
Definition: sutraWrap.py:849
int set_npix(self, int npix)
Set the number of pixels per subap for a RTC standalone.
Definition: sutraWrap.py:740
d_centroids_ref
Reference slopes vector.
Definition: sutraWrap.py:795
d_flat
Flat frame for calibration.
Definition: sutraWrap.py:813
wfs
SutraWfs handled by this centroider.
Definition: sutraWrap.py:984
nslopes
Number of slopes.
Definition: sutraWrap.py:930
d_img
Calibrated WFS image.
Definition: sutraWrap.py:822
offset
Offset for centroiding computation.
Definition: sutraWrap.py:957
int set_scale(self, float scale)
Set the controider scale factor.
Definition: sutraWrap.py:761
npix
Number of pixels along a side of WFS subap.
Definition: sutraWrap.py:921
filter_TT
Tip/tilt filtering flag.
Definition: sutraWrap.py:912
int set_offset(self, float offset)
Set the controider offset [pixels].
Definition: sutraWrap.py:754
int set_dark(self, numpy.ndarray[numpy.float32] dark, int n)
Set the dark frame for calibration.
Definition: sutraWrap.py:715
nxsub
Number of ssp across the pupil diameter.
Definition: sutraWrap.py:948
d_intensities
intensities of the WFS image
Definition: sutraWrap.py:840
d_ref_Tip
Tip mode reference for filtering.
Definition: sutraWrap.py:867
d_validx
X positions of the valid ssp.
Definition: sutraWrap.py:885
int set_centroids_ref(self, numpy.ndarray[numpy.float32] refslopes)
Set the references slopes.
Definition: sutraWrap.py:706
d_validy
Y positions of the valid ssp.
Definition: sutraWrap.py:894
scale
Scale factor to get slopes in arcsec.
Definition: sutraWrap.py:966
int set_flat(self, numpy.ndarray[numpy.float32] flat, int n)
Set the flat frame for calibration.
Definition: sutraWrap.py:724
d_img_raw
Raw WFS image.
Definition: sutraWrap.py:831
d_corrmax
TODO docstring.
Definition: sutraWrap.py:1037
d_interpmat
TODO docstring.
Definition: sutraWrap.py:1064
interp_sizey
TODO docstring.
Definition: sutraWrap.py:1082
d_corrnorm
TODO docstring.
Definition: sutraWrap.py:1046
d_corrspot
TODO docstring.
Definition: sutraWrap.py:1055
interp_sizex
TODO docstring.
Definition: sutraWrap.py:1073
d_corrfnct
TODO docstring.
Definition: sutraWrap.py:1028
centro_idx
Indices of the handled centroiders.
Definition: sutraWrap.py:1670
int set_com(self, numpy.ndarray[numpy.float32] com, int nElem)
Set the command vector of the controller.
Definition: sutraWrap.py:1599
None set_comRange(self, float volt_min, float volt_max)
Set the volt_min and volt_max value for command clipping.
Definition: sutraWrap.py:1609
d_centroids
Slopes vector.
Definition: sutraWrap.py:1695
open_loop
Open loop flag.
Definition: sutraWrap.py:1821
int set_val_max(self, float val_max)
Set the val_max value for command conversion.
Definition: sutraWrap.py:1655
int command_delay(self)
Delay the command.
Definition: sutraWrap.py:1552
d_voltage
Total voltage to apply on the DMs.
Definition: sutraWrap.py:1767
int clip_commands(self)
Clip the commands between volt_min and volt_max (values set in the controller)
Definition: sutraWrap.py:1548
int add_perturb_voltage(self, str name, numpy.ndarray[numpy.float32] perturb, int N)
Add a new perturbation voltage buffer.
Definition: sutraWrap.py:1544
device
GPU device index.
Definition: sutraWrap.py:1785
int disable_perturb_voltage(self, str name)
Disable a perturbation voltage buffer.
Definition: sutraWrap.py:1564
int comp_voltage(self)
Computes the final voltage to send to the DM.
Definition: sutraWrap.py:1556
int enable_perturb_voltage(self, str name)
Enable a perturbation voltage buffer.
Definition: sutraWrap.py:1572
int set_delay(self, float delay)
Set the delay.
Definition: sutraWrap.py:1617
comRange
type of : typing.Tuple[float, float]
Definition: sutraWrap.py:1677
d_circularComs0
Oldest command vector in the circular buffer.
Definition: sutraWrap.py:1704
d_dmseen
Vector of SutraDm commanded.
Definition: sutraWrap.py:1749
gain
Controller gain.
Definition: sutraWrap.py:1794
nactu
Number of actuators to control.
Definition: sutraWrap.py:1803
int remove_perturb_voltage(self, str name)
Remove a perturbation voltage buffer.
Definition: sutraWrap.py:1580
int reset_perturb_voltage(self)
Remove all perturbation voltage buffers.
Definition: sutraWrap.py:1589
d_com_clipped
Delayed commands.
Definition: sutraWrap.py:1740
d_com
Current command vector.
Definition: sutraWrap.py:1722
type
Controller type.
Definition: sutraWrap.py:1830
int set_gain(self, float gain)
Set the gain.
Definition: sutraWrap.py:1625
int set_perturb_voltage(self, str name, numpy.ndarray[numpy.float32] perturb, int N)
Set an existing perturbation voltage buffer.
Definition: sutraWrap.py:1647
val_max
Maximum value for d_voltage (ADU).
Definition: sutraWrap.py:1839
int add_perturb(self)
Add the perturbation voltage to the command.
Definition: sutraWrap.py:1532
nslope
Number of slopes.
Definition: sutraWrap.py:1812
int reset_coms(self)
Reset the commands circular buffer.
Definition: sutraWrap.py:1584
int set_open_loop(self, int status, bool rst=True)
Open (1) or close (0) the loop.
Definition: sutraWrap.py:1635
d_perturb_map
Perturbation voltage buffers.
Definition: sutraWrap.py:1758
d_circularComs1
Second oldest Command vector in the circular buffer.
Definition: sutraWrap.py:1713
d_com1
Command vector at iteration k-1.
Definition: sutraWrap.py:1731
int set_volt_max(self, float volt_max)
Set the volt_max value for command clipping.
Definition: sutraWrap.py:1663
gain
Controller gain.
Definition: sutraWrap.py:2109
open_loop
Open loop flag.
Definition: sutraWrap.py:2136
nslope
Number of slopes.
Definition: sutraWrap.py:2127
int set_com(self, numpy.ndarray[numpy.float32] com, int nElem)
Set the command vector of the controller.
Definition: sutraWrap.py:1914
val_max
Maximum value for d_voltage (ADU).
Definition: sutraWrap.py:2154
d_com1
Command vector at iteration k-1.
Definition: sutraWrap.py:2046
d_centroids
Slopes vector.
Definition: sutraWrap.py:2010
nactu
Number of actuators to control.
Definition: sutraWrap.py:2118
type
Controller type.
Definition: sutraWrap.py:2145
device
GPU device index.
Definition: sutraWrap.py:2100
d_com
Current command vector.
Definition: sutraWrap.py:2037
d_gain
vector of modal gains
Definition: sutraWrap.py:2901
int set_cmat(self, numpy.ndarray[numpy.float32] cmat)
Set the command matrix.
Definition: sutraWrap.py:2939
d_compbuff
Computation buffer buffer.
Definition: sutraWrap.py:3006
int set_imat(self, numpy.ndarray[numpy.float32] imat)
Set the interaction matrix.
Definition: sutraWrap.py:2960
int set_modal_gains(self, numpy.ndarray[numpy.float32] mgain)
Set the controller modal gains.
Definition: sutraWrap.py:2974
int set_matD(self, numpy.ndarray[numpy.float32] M)
Set D matrix (interaction matrix)
Definition: sutraWrap.py:2189
d_matA
List of A matrices used for state recursion (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2326
n_slope_buffers
number of slope vectors to store in buffer (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2446
d_matK
K matrix, used for projection from state to modes (see compass.io details on the generic linear contr...
Definition: sutraWrap.py:2356
d_matL
List of L matrices used for innovation from measurements (see compass.io details on the generic linea...
Definition: sutraWrap.py:2366
d_matD
D matrix, typically set to the interaction matrix (see compass.io details on the generic linear contr...
Definition: sutraWrap.py:2336
n_modes
number of modes in mode vector (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2436
n_iir_in
number of iir inputs to use (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2416
modal
modal flag (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2406
d_imat
D matrix, typically set to the interaction matrix (see compass.io details on the generic linear contr...
Definition: sutraWrap.py:2316
d_circular_coms
circular command buffer (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2236
d_iir_b
List of iir coefficient vectors for inputs (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2306
d_iir_a
List of iir coefficient vectors for outputs (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2296
int set_iir_b(self, numpy.ndarray[numpy.float32] M, int i)
Set a single iir 'b' vector within list (combined with iir inputs)
Definition: sutraWrap.py:2174
n_iir_out
number of iir outputs to use (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2426
int set_matA(self, numpy.ndarray[numpy.float32] M, int i)
Set a single A matrix within the list of A matrices (state recursions)
Definition: sutraWrap.py:2182
n_states
number of states in state vector (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2466
d_circular_s
circular slope buffer (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2246
d_centroids
centroid/slope vector (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2226
d_matF
F matrix, used to project from modes to actuator voltages (see compass.io details on the generic line...
Definition: sutraWrap.py:2346
d_circular_u_out
circular buffer of iir outputs (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2266
d_x_now
temporary state vector used for control calcs (see compass.io details on the generic linear controlle...
Definition: sutraWrap.py:2396
int set_matL(self, numpy.ndarray[numpy.float32] M, int i)
Set a single L matrix within the list of L matrices (innovations)
Definition: sutraWrap.py:2211
n_state_buffers
number of state vectors to store in buffer (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2456
int set_matF(self, numpy.ndarray[numpy.float32] M)
Set F matrix (mode to actuator voltage projection)
Definition: sutraWrap.py:2196
d_com
command vector (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2286
d_circular_x
circular state buffer (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2276
d_u_now
temporary command vector used for control calcs (see compass.io details on the generic linear control...
Definition: sutraWrap.py:2386
polc
polc flag (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2476
int set_polc(self, bool polc)
Set the POLC flag.
Definition: sutraWrap.py:2218
d_circular_u_in
circular buffer of iir inputs (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2256
int set_matK(self, numpy.ndarray[numpy.float32] M)
Set K matrix (state to mode projection)
Definition: sutraWrap.py:2203
d_s_now
temporary slope vector used for control calcs (see compass.io details on the generic linear controlle...
Definition: sutraWrap.py:2376
int set_polc(self, bool polc)
Set the POLC flag.
Definition: sutraWrap.py:2540
polc
polc flag (see compass.io details on the generic linear controller)
Definition: sutraWrap.py:2798
d_imat
D matrix, typically set to the interaction matrix (see compass.io details on the generic linear contr...
Definition: sutraWrap.py:2638
d_gain
vector of modal gains
Definition: sutraWrap.py:3165
d_gain
vector of modal gains
Definition: sutraWrap.py:3326
d_cenbuff
Centroids circular buffer.
Definition: sutraWrap.py:3507
d_cmat
Control matrix.
Definition: sutraWrap.py:3516
int set_modal_gains(self, numpy.ndarray[numpy.float32] mgain)
Set the controller modal gains.
Definition: sutraWrap.py:3442
int set_imat(self, numpy.ndarray[numpy.float32] imat)
Set the interaction matrix.
Definition: sutraWrap.py:3435
d_err
Current increment on the command.
Definition: sutraWrap.py:3552
d_gain
vector of modal gains
Definition: sutraWrap.py:3561
d_imat
Interaction matrix.
Definition: sutraWrap.py:3570
int build_cmat(self, int nfilt)
Computes the command matrix after imat SVD.
Definition: sutraWrap.py:3391
int set_cmat(self, numpy.ndarray[numpy.float32] cmat)
Set the command matrix.
Definition: sutraWrap.py:3428
d_cmat
Control matrix.
Definition: sutraWrap.py:3769
d_cenbuff
Centroids circular buffer.
Definition: sutraWrap.py:3760
int set_cmat(self, numpy.ndarray[numpy.float32] cmat)
Set the command matrix.
Definition: sutraWrap.py:3681
d_err
Current increment on the command.
Definition: sutraWrap.py:3805
d_imat
Interaction matrix.
Definition: sutraWrap.py:3823
d_gain
vector of modal gains
Definition: sutraWrap.py:3814
int set_imat(self, numpy.ndarray[numpy.float32] imat)
Set the interaction matrix.
Definition: sutraWrap.py:3688
int set_modal_gains(self, numpy.ndarray[numpy.float32] mgain)
Set the controller modal gains.
Definition: sutraWrap.py:3695
device
GPU device index.
Definition: sutraWrap.py:4666
nactus
Number of actuators.
Definition: sutraWrap.py:5018
device
Device index.
Definition: sutraWrap.py:4973
device
GPU device.
Definition: sutraWrap.py:5434
None __init__(self, carmaWrap.context context, int device, int nssp, int nlayers, float gsangle, numpy.ndarray[numpy.float32] vdt, numpy.ndarray[numpy.float32] Htheta, numpy.ndarray[numpy.float32] L0, numpy.ndarray[numpy.float32] winddir, numpy.ndarray[numpy.float32] scale, numpy.ndarray[numpy.float32] pzt2tt, numpy.ndarray[numpy.float32] TTPfilter, numpy.ndarray[numpy.float32] Nact, numpy.ndarray[numpy.float32] xpos, numpy.ndarray[numpy.float32] ypos, float fc)
Initializes Groot to compute aniso and bandwidth model.
Definition: sutraWrap.py:5547
None __init__(self, carmaWrap.context context, Source d_source, int im_dimx, int im_dimy, numpy.ndarray[numpy.float32] wavelength, int nWavelength, int device)
Instantiates a PerfectCoronagraph object.
Definition: sutraWrap.py:6467
int do_imat(self, int ncontrol, Dms dms, int kernconv)
Computes interaction matrix.
Definition: sutraWrap.py:6741
int apply_control(self, int ncontrol, bool compVoltage=True)
Apply the commands on the DM and shape it.
Definition: sutraWrap.py:6669
None build_cmat(self, int ncontrol, int nfilt, bool filt_tt=False)
Computes cmat.
Definition: sutraWrap.py:6680
d_centro
Vector of centroiders.
Definition: sutraWrap.py:6812
int remove_centroider(self, int ncentro)
Remove the specified centroider from the RTC.
Definition: sutraWrap.py:6773
int do_centroids_geom(self, int ncontrol, int type=0)
Computes the centroids geom.
Definition: sutraWrap.py:6709
int do_control(self, int ncontrol)
Computes the commands.
Definition: sutraWrap.py:6730
int do_imat_basis(self, int ncontrol, Dms dms, int nModes, numpy.ndarray[numpy.float32] m2v, numpy.ndarray[numpy.float32] pushAmpl, int kernconv)
Computes a modal interaction matrix.
Definition: sutraWrap.py:6759
None set_modal_gains(self, int ncontrol, numpy.ndarray[numpy.float32] mgain)
Set the modal gain in the controller.
Definition: sutraWrap.py:6805
int do_calibrate_img(self, int ncontrol)
Computes the calibrated image.
Definition: sutraWrap.py:6694
int do_centroids(self, int ncontrol)
Computes the centroids.
Definition: sutraWrap.py:6701
int add_controller(self, carmaWrap.context context, str typec, int device, float delay, int nslope, int nactu, int nslope_buffers=0, int nstates=0, int nstate_buffers=0, int nmodes=0, int niir_in=0, int niir_out=0, bool polc=False, bool is_modal=False, Dms dms=None, numpy.ndarray[numpy.int32] idx_dms=[], int ndm=0, numpy.ndarray[numpy.int32] idx_centro=[], int ncentro=0, int Nphi=0, bool wfs_direction=False)
Add a SutraController object in the RTC.
Definition: sutraWrap.py:6658
int do_clipping(self, int ncontrol)
Clip the command to apply on the DMs on a SutraController object.
Definition: sutraWrap.py:6723
None imat_svd(self, int ncontrol)
Computes imat svd.
Definition: sutraWrap.py:6766
int set_centroids_ref(self, numpy.ndarray[numpy.float32] centroidsRef)
Set the reference centroids.
Definition: sutraWrap.py:6787
None set_gain(self, int ncontrol, float gain)
Set the loop gain in the controller.
Definition: sutraWrap.py:6796
int do_centroids_ref(self, int ncontrol)
Computes the centroids ref.
Definition: sutraWrap.py:6716
d_control
Vector of controllers.
Definition: sutraWrap.py:6821
int remove_controller(self, int ncontrol)
Remove the specified controller from the RTC.
Definition: sutraWrap.py:6780
int add_centroider(self, carmaWrap.context context, int nvalid, float offset, float scale, bool filter_TT, int device, str typec, Wfs wfs)
Add a SutraCentroider object in the RTC.
Definition: sutraWrap.py:6555
int comp_voltage(self, int ncontrol)
Compute the commands on the DM.
Definition: sutraWrap.py:6687
None __init__(self)
Initialize a void rtc object.
Definition: sutraWrap.py:6829
None __init__(self)
Initialize a void rtc object.
Definition: sutraWrap.py:7145
None __init__(self)
Initialize a void rtc object.
Definition: sutraWrap.py:7461
device
GPU device index.
Definition: sutraWrap.py:8031
int compute_electric_field(cuFloatComplex *electric_field, float *phase_opd, float scale, float *amplitude, float *mask, int dimx, int dimy, CarmaDevice *device)
int fill_mask(float *d_odata, float *d_idata, int N, int norm, CarmaDevice *device)