37 """Binding module for libsutra"""
38 from __future__
import annotations
43 _Shape = typing.Tuple[int, ...]
51 "CentroiderMASKEDPIX_FF",
52 "CentroiderMASKEDPIX_UF",
63 "ControllerGENERICLINEAR_FF",
64 "ControllerGENERICLINEAR_FU",
65 "ControllerGENERIC_FF",
66 "ControllerGENERIC_FU",
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:
101 Create and initialise an atmos object
104 context: (CarmaContext) : current carma context
106 nscreens: (float) : number of turbulent layers
108 global_r0: (float): global r0
110 r0_per_layer: (float) : r0 per layer
112 size1: (np.ndarray[ndim=1, dtype=np.int64_t]) : First size of screens
114 size2: (np.ndarray[ndim=1, dtype=np.int64_t]) : Second size of screens
116 altitude: (np.ndarray[ndim=1,dtype=np.float32_t]) : altitudes [m]
118 windspeed: (np.ndarray[ndim=1,dtype=np.float32_t]) : wind speed [m/s]
120 winddir: (np.ndarray[ndim=1,dtype=np.float32_t]) : wind direction [deg]
122 deltax: (np.ndarray[ndim=1,dtype=np.float32_t]) : extrude deltax pixels in the x-direction at each iteration
124 deltay: (np.ndarray[ndim=1,dtype=np.float32_t]) : extrude deltay pixels in the y-direction at each iteration
126 device: (int): GPU device index
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:
132 Add a screen to the atmos object.
135 altitude: (float) : altitude of the screen in meters
137 size: (long) : dimension of the screen (size x size)
139 stencil_size: (long): dimension of the stencil
141 r0: (float) : frac of r0**(5/3)
143 windspeed: (float) : windspeed of the screen [m/s]
145 winddir: (float) : wind direction (deg)
147 deltax: (float) : extrude deltax pixels in the x-direction at each iteration
149 deltay: (float) : extrude deltay pixels in the y-direction at each iteration
151 device: (int) : device number
156 Delete the selected screen
159 idx: (int): index of the screen
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:
164 Initialize an newly allocated screen
167 idx: (int): index of the screen
169 A: (np.ndarray[ndim=2, dtype=np.float32]): A matrix (cf. Assemat)
171 B: (np.ndarray[ndim=2, dtype=np.float32]): B matrix (cf. Assemat)
173 istencilx: (np.ndarray[ndim=2, dtype=int32]): X stencil index
175 istencily: (np.ndarray[ndim=2, dtype=int32]): Y stencil index
177 seed: (int): seed for RNG
182 Move the turbulence in the atmos screen following loaded
183 parameters such as windspeed and wind direction
187 Refresh the selected screen by extrusion
190 idx: (int): index of the screen
193 def set_r0(self, r0: float) -> int:
195 Change the current global r0 of all layers
198 r0: (float): r0 @ 0.5 microns
201 def set_seed(self, idx: int, seed: float) -> int:
203 Set the seed of the selected screen RNG
206 idx: (int): index of the screen
208 seed: (int) :new seed
212 def d_screens(self) -> typing.List[Tscreen]:
216 :type: typing.List[Tscreen]
221 Number of turbulent screens
226 def r0(self) -> float:
233 class Centroider_FF():
234 def calibrate_img(self) -> int:
236 Performs the raw WFS frame calibration
238 def calibrate_img_validPix(self) -> int:
240 Performs the raw WFS frame calibration only on useful pixels
242 def get_cog(self) -> int:
244 Computes centroids and stores it in d_slopes of the WFS
246 def init_calib(self, n: int, m: int) -> int:
248 Initialize data used for calibration
251 n: (int): image support height
253 m: (int): image support width
257 Initialize array to store raw WFS image in RTC standalone mode
260 n: (int): image support height
262 m: (int): image support width
265 def load_img(self, img: numpy.ndarray[numpy.float32], m: int, n: int, location: int) -> int:
267 Load an image in a RTC standalone (host to device)
270 img: (np.ndarray[ndim=2, dtype=np.float32_t]): SH image
272 m: (int): Image support size X
274 n: (int): Image support size Y
276 location: (int): If -1, image is located on the CPU (hostToDevice). Else, it is the GPU index where the image is located
280 Load a square image (n, n) in a RTC standalone
283 img: (np.ndarray[ndim=2, dtype=np.float32_t]): SH image
285 n: (int): Image support size along one axis
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
292 Load an image in a RTC standalone from a CarmaObj
295 img: (CarmaObj): SH image
298 def load_img(self, img: numpy.ndarray[numpy.float32], n: int, location: int = -1) -> int: ...
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:
303 Load the validx and validy arrays
306 validx: (np.array[ndim=1,dtype=np.float32]): X positions of the valid ssp
308 validy: (np.array[ndim=1,dtype=np.float32]): Y positions of the valid ssp
310 N: (int): arrays size
314 Set the references slopes
317 refslopes: (np.array[ndim1,dtype=np.float32]): reference slopes to set
319 def set_dark(self, dark: numpy.ndarray[numpy.float32], n: int) -> int:
321 Set the dark frame for calibration
324 dark: (np.ndarray[ndim=2, dtype=np.float32_t): dark frame (size n by n)
326 n: (int): image support size
328 def set_flat(self, flat: numpy.ndarray[numpy.float32], n: int) -> int:
330 Set the flat frame for calibration
333 flat: (np.ndarray[ndim=2, dtype=np.float32_t): flat frame (size n by n)
335 n: (int): image support size
337 def set_lutPix(self, lutPix: numpy.ndarray[numpy.int32], n: int) -> int:
339 Set the lookup Table Pixel vector for calibration
342 lutPix: (np.ndarray[ndim=1, dtype=np.float32_t): lutPix vector
344 n: (int): image pixel size
346 def set_npix(self, npix: int) -> int:
348 Set the number of pixels per subap for a RTC standalone
351 npix: (int): number of pixel along a subap. side
355 Set the number of ssp across the pupil diameter for a RTC standalone
358 nxsub: (int): number of ssp across the pupil diameter
362 Set the controider offset [pixels]
365 offset: (float): new offset [pixels]
367 def set_scale(self, scale: float) -> int:
369 Set the controider scale factor
372 scale: (float): new scale factor
375 def context(self) -> carmaWrap.context:
379 :type: carmaWrap.context
384 Tip/tilt slopes removed after filtering
386 :type: carmaWrap.obj_float
389 def d_bincube(self) -> carmaWrap.obj_float:
391 Bincube of the WFS image
393 :type: carmaWrap.obj_float
398 Reference slopes vector
400 :type: carmaWrap.obj_float
403 def d_dark(self) -> carmaWrap.obj_float:
405 Dark frame for calibration
407 :type: carmaWrap.obj_float
412 Flat frame for calibration
414 :type: carmaWrap.obj_float
417 def d_img(self) -> carmaWrap.obj_float:
421 :type: carmaWrap.obj_float
424 def d_img_raw(self) -> carmaWrap.obj_float:
428 :type: carmaWrap.obj_float
433 intensities of the WFS image
435 :type: carmaWrap.obj_float
438 def d_lutPix(self) -> carmaWrap.obj_int:
440 Lookup Table of pixels for calibration
442 :type: carmaWrap.obj_int
447 Tilt mode reference for filtering
449 :type: carmaWrap.obj_float
452 def d_ref_Tip(self) -> carmaWrap.obj_float:
454 Tip mode reference for filtering
456 :type: carmaWrap.obj_float
461 Flat frame for calibration
463 :type: carmaWrap.obj_int
466 def d_validx(self) -> carmaWrap.obj_int:
468 X positions of the valid ssp
470 :type: carmaWrap.obj_int
475 Y positions of the valid ssp
477 :type: carmaWrap.obj_int
489 Tip/tilt filtering flag
494 def npix(self) -> int:
496 Number of pixels along a side of WFS subap.
510 Number of valid ssp of the WFS
515 def nxsub(self) -> int:
517 Number of ssp across the pupil diameter
522 def offset(self) -> float:
524 Offset for centroiding computation
529 def scale(self) -> float:
531 Scale factor to get slopes in arcsec
543 def wfs(self) -> Wfs:
545 SutraWfs handled by this centroider
550 class Centroider_UF():
553 Performs the raw WFS frame calibration
557 Performs the raw WFS frame calibration only on useful pixels
561 Computes centroids and stores it in d_slopes of the WFS
565 Initialize data used for calibration
568 n: (int): image support height
570 m: (int): image support width
574 Initialize array to store raw WFS image in RTC standalone mode
577 n: (int): image support height
579 m: (int): image support width
582 def load_img(self, img: numpy.ndarray[numpy.uint16], m: int, n: int, location: int) -> int:
584 Load an image in a RTC standalone (host to device)
587 img: (np.ndarray[ndim=2, dtype=np.float32_t]): SH image
589 m: (int): Image support size X
591 n: (int): Image support size Y
593 location: (int): If -1, image is located on the CPU (hostToDevice). Else, it is the GPU index where the image is located
597 Load a square image (n, n) in a RTC standalone
600 img: (np.ndarray[ndim=2, dtype=np.float32_t]): SH image
602 n: (int): Image support size along one axis
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
609 Load an image in a RTC standalone from a CarmaObj
612 img: (CarmaObj): SH image
615 def load_img(self, img: numpy.ndarray[numpy.uint16], n: int, location: int = -1) -> int: ...
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:
620 Load the validx and validy arrays
623 validx: (np.array[ndim=1,dtype=np.float32]): X positions of the valid ssp
625 validy: (np.array[ndim=1,dtype=np.float32]): Y positions of the valid ssp
627 N: (int): arrays size
631 Set the references slopes
634 refslopes: (np.array[ndim1,dtype=np.float32]): reference slopes to set
636 def set_dark(self, dark: numpy.ndarray[numpy.float32], n: int) -> int:
638 Set the dark frame for calibration
641 dark: (np.ndarray[ndim=2, dtype=np.float32_t): dark frame (size n by n)
643 n: (int): image support size
645 def set_flat(self, flat: numpy.ndarray[numpy.float32], n: int) -> int:
647 Set the flat frame for calibration
650 flat: (np.ndarray[ndim=2, dtype=np.float32_t): flat frame (size n by n)
652 n: (int): image support size
654 def set_lutPix(self, lutPix: numpy.ndarray[numpy.int32], n: int) -> int:
656 Set the lookup Table Pixel vector for calibration
659 lutPix: (np.ndarray[ndim=1, dtype=np.float32_t): lutPix vector
661 n: (int): image pixel size
663 def set_npix(self, npix: int) -> int:
665 Set the number of pixels per subap for a RTC standalone
668 npix: (int): number of pixel along a subap. side
672 Set the number of ssp across the pupil diameter for a RTC standalone
675 nxsub: (int): number of ssp across the pupil diameter
679 Set the controider offset [pixels]
682 offset: (float): new offset [pixels]
686 Set the controider scale factor
689 scale: (float): new scale factor
692 def context(self) -> carmaWrap.context:
696 :type: carmaWrap.context
701 Tip/tilt slopes removed after filtering
703 :type: carmaWrap.obj_float
708 Bincube of the WFS image
710 :type: carmaWrap.obj_float
715 Reference slopes vector
717 :type: carmaWrap.obj_float
720 def d_dark(self) -> carmaWrap.obj_float:
722 Dark frame for calibration
724 :type: carmaWrap.obj_float
727 def d_flat(self) -> carmaWrap.obj_float:
729 Flat frame for calibration
731 :type: carmaWrap.obj_float
734 def d_img(self) -> carmaWrap.obj_float:
738 :type: carmaWrap.obj_float
741 def d_img_raw(self) -> carmaWrap.obj_uint16:
745 :type: carmaWrap.obj_uint16
750 intensities of the WFS image
752 :type: carmaWrap.obj_float
755 def d_lutPix(self) -> carmaWrap.obj_int:
757 Lookup Table of pixels for calibration
759 :type: carmaWrap.obj_int
764 Tilt mode reference for filtering
766 :type: carmaWrap.obj_float
769 def d_ref_Tip(self) -> carmaWrap.obj_float:
771 Tip mode reference for filtering
773 :type: carmaWrap.obj_float
778 Flat frame for calibration
780 :type: carmaWrap.obj_int
783 def d_validx(self) -> carmaWrap.obj_int:
785 X positions of the valid ssp
787 :type: carmaWrap.obj_int
790 def d_validy(self) -> carmaWrap.obj_int:
792 Y positions of the valid ssp
794 :type: carmaWrap.obj_int
806 Tip/tilt filtering flag
811 def npix(self) -> int:
813 Number of pixels along a side of WFS subap.
827 Number of valid ssp of the WFS
832 def nxsub(self) -> int:
834 Number of ssp across the pupil diameter
839 def offset(self) -> float:
841 Offset for centroiding computation
846 def scale(self) -> float:
848 Scale factor to get slopes in arcsec
853 def type(self) -> str:
860 def wfs(self) -> Wfs:
862 SutraWfs handled by this centroider
868 def init_corr(self, isizex: int, isizey: int, interpmat: numpy.ndarray[numpy.float32]) -> int:
870 Initializes corr computation
873 isizex: (int): TODO: docstring
877 interpmat: (np.array[ndim=,dtype=np.float32]):
880 def load_corr(self, corr: numpy.ndarray[numpy.float32], corr_norm: numpy.ndarray[numpy.float32], ndim: int) -> int:
882 Load arrays for correlation computation
885 corr: (np.array[ndim=,dtype=np.float32): TODO: docstring
887 corr_norm: (np.array[ndim=,dtype=np.float32):
893 def d_corr(self) -> carmaWrap.obj_float:
897 :type: carmaWrap.obj_float
900 def d_corrfnct(self) -> carmaWrap.obj_float_complex:
904 :type: carmaWrap.obj_float_complex
907 def d_corrmax(self) -> carmaWrap.obj_int:
911 :type: carmaWrap.obj_int
914 def d_corrnorm(self) -> carmaWrap.obj_float:
918 :type: carmaWrap.obj_float
921 def d_corrspot(self) -> carmaWrap.obj_float_complex:
925 :type: carmaWrap.obj_float_complex
928 def d_interpmat(self) -> carmaWrap.obj_float:
932 :type: carmaWrap.obj_float
935 def interp_sizex(self) -> int:
942 def interp_sizey(self) -> int:
949 def npix(self) -> int:
956 class CentroiderCORR_UF(Centroider_UF):
957 def init_corr(self, isizex: int, isizey: int, interpmat: numpy.ndarray[numpy.float32]) -> int:
959 Initializes corr computation
962 isizex: (int): TODO: docstring
966 interpmat: (np.array[ndim=,dtype=np.float32]):
969 def load_corr(self, corr: numpy.ndarray[numpy.float32], corr_norm: numpy.ndarray[numpy.float32], ndim: int) -> int:
971 Load arrays for correlation computation
974 corr: (np.array[ndim=,dtype=np.float32): TODO: docstring
976 corr_norm: (np.array[ndim=,dtype=np.float32):
982 def d_corr(self) -> carmaWrap.obj_float:
986 :type: carmaWrap.obj_float
989 def d_corrfnct(self) -> carmaWrap.obj_float_complex:
993 :type: carmaWrap.obj_float_complex
996 def d_corrmax(self) -> carmaWrap.obj_int:
1000 :type: carmaWrap.obj_int
1007 :type: carmaWrap.obj_float
1010 def d_corrspot(self) -> carmaWrap.obj_float_complex:
1014 :type: carmaWrap.obj_float_complex
1021 :type: carmaWrap.obj_float
1038 def npix(self) -> int:
1045 class CentroiderMASKEDPIX_FF(Centroider_FF):
1048 Fill the mask of valid pixels
1050 def fill_selected_pix(self, centroids: carmaWrap.obj_float) ->
None:
1052 Return the given pixels vector in an image format
1055 centroids: (CarmaObj): Pixels to map on the image
1058 def d_mask(self) -> carmaWrap.obj_float:
1060 Mask of valid pixels
1062 :type: carmaWrap.obj_float
1065 def d_selected_pix(self) -> carmaWrap.obj_float:
1067 Selected pixels as an image
1069 :type: carmaWrap.obj_float
1072 class CentroiderMASKEDPIX_UF(Centroider_UF):
1075 Fill the mask of valid pixels
1077 def fill_selected_pix(self, centroids: carmaWrap.obj_float) ->
None:
1079 Return the given pixels vector in an image format
1082 centroids: (CarmaObj): Pixels to map on the image
1085 def d_mask(self) -> carmaWrap.obj_float:
1087 Mask of valid pixels
1089 :type: carmaWrap.obj_float
1092 def d_selected_pix(self) -> carmaWrap.obj_float:
1094 Selected pixels as an image
1096 :type: carmaWrap.obj_float
1099 class CentroiderPYR_FF(Centroider_FF):
1100 def set_pyr_method(self, method: int) -> int:
1102 Set the pyramid method for slopes computation
1105 method : (int) : new centroiding method (0: nosinus global
1109 favor use of shesha_constant.PyrCentroiderMethod
1113 def set_pyr_thresh(self, thresh: float) -> int:
1115 Set the pyramid threshold value
1118 thresh : (float) : threshold value
1122 def pyr_method(self) -> str:
1124 Method used for pyramid slopes compuation
1129 class CentroiderPYR_UF(Centroider_UF):
1130 def set_pyr_method(self, method: int) -> int:
1132 Set the pyramid method for slopes computation
1135 method : (int) : new centroiding method (0: nosinus global
1139 favor use of shesha_constant.PyrCentroiderMethod
1143 def set_pyr_thresh(self, thresh: float) -> int:
1145 Set the pyramid threshold value
1148 thresh : (float) : threshold value
1152 def pyr_method(self) -> str:
1154 Method used for pyramid slopes compuation
1159 class CentroiderTCOG_FF(Centroider_FF):
1160 def set_threshold(self, thresh: float) -> int:
1162 Set the threshold value of a TCOG centroider
1165 thresh : (float) : threshold value to set
1170 def threshold(self) -> float:
1177 class CentroiderTCOG_UF(Centroider_UF):
1178 def set_threshold(self, thresh: float) -> int:
1180 Set the threshold value of a TCOG centroider
1183 thresh : (float) : threshold value to set
1188 def threshold(self) -> float:
1195 class CentroiderWCOG_FF(Centroider_FF):
1196 def init_weights(self) -> int:
1198 Initializes WCOG computation
1200 def load_weights(self, weights: numpy.ndarray[numpy.float32], ndim: int) -> int:
1202 Load weights on WCOG
1205 weight: (np.array[ndim=, dtype=np.float32]: weights
1207 ndim: (int): TODO: docstring
1210 def set_threshold(self, thresh: float) -> int:
1212 Set the threshold value of a TCOG centroider
1215 thresh : (float) : threshold value to set
1220 def d_weights(self) -> carmaWrap.obj_float:
1224 :type: carmaWrap.obj_float
1227 def threshold(self) -> float:
1234 class CentroiderWCOG_UF(Centroider_UF):
1235 def init_weights(self) -> int:
1237 Initializes WCOG computation
1239 def load_weights(self, weights: numpy.ndarray[numpy.float32], ndim: int) -> int:
1241 Load weights on WCOG
1244 weight: (np.array[ndim=, dtype=np.float32]: weights
1246 ndim: (int): TODO: docstring
1249 def set_threshold(self, thresh: float) -> int:
1251 Set the threshold value of a TCOG centroider
1254 thresh : (float) : threshold value to set
1259 def d_weights(self) -> carmaWrap.obj_float:
1263 :type: carmaWrap.obj_float
1266 def threshold(self) -> float:
1273 class CentroiderBPCOG_FF(Centroider_FF):
1274 def set_nmax(self, nmax: int) -> int:
1276 Set the number of brightest pixels considered for COG computation
1279 nmax : (float) : nmax value to set
1283 def d_bpind(self) -> carmaWrap.obj_uint:
1285 Brightest pixels indices
1287 :type: carmaWrap.obj_uint
1290 def d_bpix(self) -> carmaWrap.obj_float:
1294 :type: carmaWrap.obj_float
1297 def nmax(self) -> int:
1299 Number of brightest pixels
1304 class CentroiderBPCOG_UF(Centroider_UF):
1305 def set_nmax(self, nmax: int) -> int:
1307 Set the number of brightest pixels considered for COG computation
1310 nmax : (float) : nmax value to set
1314 def d_bpind(self) -> carmaWrap.obj_uint:
1316 Brightest pixels indices
1318 :type: carmaWrap.obj_uint
1321 def d_bpix(self) -> carmaWrap.obj_float:
1325 :type: carmaWrap.obj_float
1328 def nmax(self) -> int:
1330 Number of brightest pixels
1335 class Controller_FF():
1336 def add_perturb(self) -> int:
1338 Add the perturbation voltage to the command
1340 def add_perturb_voltage(self, name: str, perturb: numpy.ndarray[numpy.float32], N: int) -> int:
1342 Add a new perturbation voltage buffer
1345 name: (str): name of the new buffer
1347 perturb: (np.array[ndim=2,dtype=np.float32]): perturbation voltage to set
1349 N: (int): Number of perturb voltage vectors in the buffer
1352 def clip_commands(self) -> int:
1354 Clip the commands between volt_min and volt_max (values set in the controller)
1356 def command_delay(self) -> int:
1360 def comp_voltage(self) -> int:
1362 Computes the final voltage to send to the DM
1364 def disable_perturb_voltage(self, name: str) -> int:
1366 Disable a perturbation voltage buffer
1369 name: (str): name of the buffer to enable
1372 def enable_perturb_voltage(self, name: str) -> int:
1374 Enable a perturbation voltage buffer
1377 name: (str): name of the buffer to enable
1380 def remove_perturb_voltage(self, name: str) -> int:
1382 Remove a perturbation voltage buffer
1385 name: (str): name of the buffer to remove
1388 def reset_coms(self) -> int:
1390 Reset the commands circular buffer
1392 def reset_perturb_voltage(self) -> int:
1394 Remove all perturbation voltage buffers
1397 def set_com(self, com: numpy.ndarray[numpy.float32], nElem: int) -> int:
1399 Set the command vector of the controller
1402 com: (np.array[ndim=3, dtype=np.float32]) : command vector
1404 nElem: (int): Number of elements in com
1407 def set_comRange(self, volt_min: float, volt_max: float) ->
None:
1409 Set the volt_min and volt_max value for command clipping
1412 volt_min: (float): volt_min value for clipping
1414 volt_max: (float): volt_max value for clipping
1417 def set_delay(self, delay: float) -> int:
1422 delay: (float): loop delay in frames
1425 def set_gain(self, gain: float) -> int:
1430 gain: (float): loop gain
1433 def set_open_loop(self, status: int, rst: bool =
True) -> int:
1435 Open (1) or close (0) the loop
1438 status: (int): open loop status
1440 rst: (bool): reset integrator if True
1443 def set_perturb_voltage(self, name: str, perturb: numpy.ndarray[numpy.float32], N: int) -> int:
1445 Set an existing perturbation voltage buffer
1448 name: (str): name of the buffer
1450 perturb: (np.array[ndim=2,dtype=np.float32]): perturbation voltage to set
1452 N: (int): Number of perturb voltage vectors in the buffer
1455 def set_val_max(self, val_max: float) -> int:
1457 Set the val_max value for command conversion
1460 val_max: (float): val_max value for conversion
1463 def set_volt_max(self, volt_max: float) -> int:
1465 Set the volt_max value for command clipping
1468 volt_max: (float): volt_max value for clipping
1472 def centro_idx(self) -> typing.List[int]:
1474 Indices of the handled centroiders
1476 :type: typing.List[int]
1479 def comRange(self) -> typing.Tuple[float, float]:
1481 :type: typing.Tuple[float, float]
1484 def context(self) -> carmaWrap.context:
1488 :type: carmaWrap.context
1491 def d_centroids(self) -> carmaWrap.obj_float:
1495 :type: carmaWrap.obj_float
1498 def d_circularComs0(self) -> carmaWrap.obj_float:
1500 Oldest command vector in the circular buffer
1502 :type: carmaWrap.obj_float
1505 def d_circularComs1(self) -> carmaWrap.obj_float:
1507 Second oldest Command vector in the circular buffer
1509 :type: carmaWrap.obj_float
1512 def d_com(self) -> carmaWrap.obj_float:
1514 Current command vector
1516 :type: carmaWrap.obj_float
1519 def d_com1(self) -> carmaWrap.obj_float:
1521 Command vector at iteration k-1
1523 :type: carmaWrap.obj_float
1526 def d_com_clipped(self) -> carmaWrap.obj_float:
1530 :type: carmaWrap.obj_float
1533 def d_dmseen(self) -> typing.List[Dm]:
1535 Vector of SutraDm commanded
1537 :type: typing.List[Dm]
1540 def d_perturb_map(self) -> typing.Dict[str, typing.Tuple[carmaWrap.obj_float, int, bool]]:
1542 Perturbation voltage buffers
1544 :type: typing.Dict[str, typing.Tuple[carmaWrap.obj_float, int, bool]]
1547 def d_voltage(self) -> carmaWrap.obj_float:
1549 Total voltage to apply on the DMs
1551 :type: carmaWrap.obj_float
1554 def delay(self) -> float:
1568 def gain(self) -> float:
1575 def nactu(self) -> int:
1577 Number of actuators to control
1596 def type(self) -> str:
1605 Maximum value for d_voltage (ADU). Only used if output is expected in uint16
1610 class Controller_FU():
1613 Add the perturbation voltage to the command
1615 def add_perturb_voltage(self, name: str, perturb: numpy.ndarray[numpy.float32], N: int) -> int:
1617 Add a new perturbation voltage buffer
1620 name: (str): name of the new buffer
1622 perturb: (np.array[ndim=2,dtype=np.float32]): perturbation voltage to set
1624 N: (int): Number of perturb voltage vectors in the buffer
1629 Clip the commands between volt_min and volt_max (values set in the controller)
1637 Computes the final voltage to send to the DM
1641 Disable a perturbation voltage buffer
1644 name: (str): name of the buffer to enable
1649 Enable a perturbation voltage buffer
1652 name: (str): name of the buffer to enable
1657 Remove a perturbation voltage buffer
1660 name: (str): name of the buffer to remove
1665 Reset the commands circular buffer
1669 Remove all perturbation voltage buffers
1672 def set_com(self, com: numpy.ndarray[numpy.float32], nElem: int) -> int:
1674 Set the command vector of the controller
1677 com: (np.array[ndim=3, dtype=np.float32]) : command vector
1679 nElem: (int): Number of elements in com
1682 def set_comRange(self, volt_min: float, volt_max: float) ->
None:
1684 Set the volt_min and volt_max value for command clipping
1687 volt_min: (float): volt_min value for clipping
1689 volt_max: (float): volt_max value for clipping
1692 def set_delay(self, delay: float) -> int:
1697 delay: (float): loop delay in frames
1700 def set_gain(self, gain: float) -> int:
1705 gain: (float): loop gain
1708 def set_open_loop(self, status: int, rst: bool =
True) -> int:
1710 Open (1) or close (0) the loop
1713 status: (int): open loop status
1715 rst: (bool): reset integrator if True
1718 def set_perturb_voltage(self, name: str, perturb: numpy.ndarray[numpy.float32], N: int) -> int:
1720 Set an existing perturbation voltage buffer
1723 name: (str): name of the buffer
1725 perturb: (np.array[ndim=2,dtype=np.float32]): perturbation voltage to set
1727 N: (int): Number of perturb voltage vectors in the buffer
1732 Set the val_max value for command conversion
1735 val_max: (float): val_max value for conversion
1740 Set the volt_max value for command clipping
1743 volt_max: (float): volt_max value for clipping
1749 Indices of the handled centroiders
1751 :type: typing.List[int]
1754 def comRange(self) -> typing.Tuple[float, float]:
1756 :type: typing.Tuple[float, float]
1759 def context(self) -> carmaWrap.context:
1763 :type: carmaWrap.context
1770 :type: carmaWrap.obj_float
1775 Oldest command vector in the circular buffer
1777 :type: carmaWrap.obj_float
1782 Second oldest Command vector in the circular buffer
1784 :type: carmaWrap.obj_float
1787 def d_com(self) -> carmaWrap.obj_float:
1789 Current command vector
1791 :type: carmaWrap.obj_float
1796 Command vector at iteration k-1
1798 :type: carmaWrap.obj_float
1805 :type: carmaWrap.obj_float
1808 def d_dmseen(self) -> typing.List[Dm]:
1810 Vector of SutraDm commanded
1812 :type: typing.List[Dm]
1815 def d_perturb_map(self) -> typing.Dict[str, typing.Tuple[carmaWrap.obj_float, int, bool]]:
1817 Perturbation voltage buffers
1819 :type: typing.Dict[str, typing.Tuple[carmaWrap.obj_float, int, bool]]
1822 def d_voltage(self) -> carmaWrap.obj_uint16:
1824 Total voltage to apply on the DMs
1826 :type: carmaWrap.obj_uint16
1829 def delay(self) -> float:
1850 def nactu(self) -> int:
1852 Number of actuators to control
1880 Maximum value for d_voltage (ADU). Only used if output is expected in uint16
1885 class ControllerGENERICLINEAR_FF(Controller_FF):
1886 def set_iir_a(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
1888 Set a single iir 'a' vector within list (combined with iir outputs)
1891 M: (np.array[ndim=1,dtype=np.float32]): Vector to be set
1892 i: (int): index of list to slice vector
1894 def set_iir_b(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
1896 Set a single iir 'b' vector within list (combined with iir inputs)
1899 M: (np.array[ndim=1,dtype=np.float32]): Vector to be set
1900 i: (int): index of list to slice vector
1902 def set_matA(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
1904 Set a single A matrix within the list of A matrices (state recursions)
1907 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be sliced
1908 i: (int): index of list to slice matrix
1910 def set_matD(self, M: numpy.ndarray[numpy.float32]) -> int:
1912 Set D matrix (interaction matrix)
1915 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
1917 def set_matF(self, M: numpy.ndarray[numpy.float32]) -> int:
1919 Set F matrix (mode to actuator voltage projection)
1922 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
1924 def set_matK(self, M: numpy.ndarray[numpy.float32]) -> int:
1926 Set K matrix (state to mode projection)
1929 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
1931 def set_matL(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
1933 Set a single L matrix within the list of L matrices (innovations)
1936 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be sliced
1937 i: (int): index of list to slice matrix
1939 def set_polc(self, polc: bool) -> int:
1944 polc: (bool): POLC flag
1949 centroid/slope vector
1950 (see compass.io details on the generic linear controller)
1952 :type: carmaWrap.obj_float
1955 def d_circular_coms(self) -> typing.List[carmaWrap.obj_float]:
1957 circular command buffer
1958 (see compass.io details on the generic linear controller)
1960 :type: typing.List[carmaWrap.obj_float]
1963 def d_circular_s(self) -> typing.List[carmaWrap.obj_float]:
1965 circular slope buffer
1966 (see compass.io details on the generic linear controller)
1968 :type: typing.List[carmaWrap.obj_float]
1971 def d_circular_u_in(self) -> typing.List[carmaWrap.obj_float]:
1973 circular buffer of iir inputs
1974 (see compass.io details on the generic linear controller)
1976 :type: typing.List[carmaWrap.obj_float]
1979 def d_circular_u_out(self) -> typing.List[carmaWrap.obj_float]:
1981 circular buffer of iir outputs
1982 (see compass.io details on the generic linear controller)
1984 :type: typing.List[carmaWrap.obj_float]
1987 def d_circular_x(self) -> typing.List[carmaWrap.obj_float]:
1989 circular state buffer
1990 (see compass.io details on the generic linear controller)
1992 :type: typing.List[carmaWrap.obj_float]
1995 def d_com(self) -> carmaWrap.obj_float:
1998 (see compass.io details on the generic linear controller)
2000 :type: carmaWrap.obj_float
2003 def d_iir_a(self) -> typing.List[carmaWrap.obj_float]:
2005 List of iir coefficient vectors for outputs
2006 (see compass.io details on the generic linear controller)
2008 :type: typing.List[carmaWrap.obj_float]
2011 def d_iir_b(self) -> typing.List[carmaWrap.obj_float]:
2013 List of iir coefficient vectors for inputs
2014 (see compass.io details on the generic linear controller)
2016 :type: typing.List[carmaWrap.obj_float]
2019 def d_imat(self) -> carmaWrap.obj_float:
2021 D matrix, typically set to the interaction matrix
2022 (see compass.io details on the generic linear controller)
2024 :type: carmaWrap.obj_float
2027 def d_matA(self) -> typing.List[carmaWrap.obj_float]:
2029 List of A matrices used for state recursion
2030 (see compass.io details on the generic linear controller)
2032 :type: typing.List[carmaWrap.obj_float]
2035 def d_matD(self) -> carmaWrap.obj_float:
2037 D matrix, typically set to the interaction matrix
2038 (see compass.io details on the generic linear controller)
2040 :type: carmaWrap.obj_float
2043 def d_matF(self) -> carmaWrap.obj_float:
2045 F matrix, used to project from modes to actuator voltages
2046 (see compass.io details on the generic linear controller)
2048 :type: carmaWrap.obj_float
2051 def d_matK(self) -> carmaWrap.obj_float:
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
2059 def d_matL(self) -> typing.List[carmaWrap.obj_float]:
2061 List of L matrices used for innovation from measurements
2062 (see compass.io details on the generic linear controller)
2064 :type: typing.List[carmaWrap.obj_float]
2067 def d_s_now(self) -> carmaWrap.obj_float:
2069 temporary slope vector used for control calcs
2070 (see compass.io details on the generic linear controller)
2072 :type: carmaWrap.obj_float
2075 def d_u_now(self) -> carmaWrap.obj_float:
2077 temporary command vector used for control calcs
2078 (see compass.io details on the generic linear controller)
2080 :type: carmaWrap.obj_float
2083 def d_x_now(self) -> carmaWrap.obj_float:
2085 temporary state vector used for control calcs
2086 (see compass.io details on the generic linear controller)
2088 :type: carmaWrap.obj_float
2091 def modal(self) -> bool:
2094 (see compass.io details on the generic linear controller)
2099 def n_iir_in(self) -> int:
2101 number of iir inputs to use
2102 (see compass.io details on the generic linear controller)
2107 def n_iir_out(self) -> int:
2109 number of iir outputs to use
2110 (see compass.io details on the generic linear controller)
2115 def n_modes(self) -> int:
2117 number of modes in mode vector
2118 (see compass.io details on the generic linear controller)
2123 def n_slope_buffers(self) -> int:
2125 number of slope vectors to store in buffer
2126 (see compass.io details on the generic linear controller)
2131 def n_state_buffers(self) -> int:
2133 number of state vectors to store in buffer
2134 (see compass.io details on the generic linear controller)
2139 def n_states(self) -> int:
2141 number of states in state vector
2142 (see compass.io details on the generic linear controller)
2147 def polc(self) -> bool:
2150 (see compass.io details on the generic linear controller)
2155 class ControllerGENERICLINEAR_FU(Controller_FU):
2156 def set_iir_a(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
2158 Set a single iir 'a' vector within list (combined with iir outputs)
2161 M: (np.array[ndim=1,dtype=np.float32]): Vector to be set
2162 i: (int): index of list to slice vector
2164 def set_iir_b(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
2166 Set a single iir 'b' vector within list (combined with iir inputs)
2169 M: (np.array[ndim=1,dtype=np.float32]): Vector to be set
2170 i: (int): index of list to slice vector
2172 def set_matA(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
2174 Set a single A matrix within the list of A matrices (state recursions)
2177 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be sliced
2178 i: (int): index of list to slice matrix
2180 def set_matD(self, M: numpy.ndarray[numpy.float32]) -> int:
2182 Set D matrix (interaction matrix)
2185 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
2187 def set_matF(self, M: numpy.ndarray[numpy.float32]) -> int:
2189 Set F matrix (mode to actuator voltage projection)
2192 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
2194 def set_matK(self, M: numpy.ndarray[numpy.float32]) -> int:
2196 Set K matrix (state to mode projection)
2199 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be set
2201 def set_matL(self, M: numpy.ndarray[numpy.float32], i: int) -> int:
2203 Set a single L matrix within the list of L matrices (innovations)
2206 M: (np.array[ndim=2,dtype=np.float32]): Matrix to be sliced
2207 i: (int): index of list to slice matrix
2209 def set_polc(self, polc: bool) -> int:
2214 polc: (bool): POLC flag
2219 centroid/slope vector
2220 (see compass.io details on the generic linear controller)
2222 :type: carmaWrap.obj_float
2227 circular command buffer
2228 (see compass.io details on the generic linear controller)
2230 :type: typing.List[carmaWrap.obj_float]
2233 def d_circular_s(self) -> typing.List[carmaWrap.obj_float]:
2235 circular slope buffer
2236 (see compass.io details on the generic linear controller)
2238 :type: typing.List[carmaWrap.obj_float]
2243 circular buffer of iir inputs
2244 (see compass.io details on the generic linear controller)
2246 :type: typing.List[carmaWrap.obj_float]
2251 circular buffer of iir outputs
2252 (see compass.io details on the generic linear controller)
2254 :type: typing.List[carmaWrap.obj_float]
2257 def d_circular_x(self) -> typing.List[carmaWrap.obj_float]:
2259 circular state buffer
2260 (see compass.io details on the generic linear controller)
2262 :type: typing.List[carmaWrap.obj_float]
2265 def d_com(self) -> carmaWrap.obj_float:
2268 (see compass.io details on the generic linear controller)
2270 :type: carmaWrap.obj_float
2273 def d_iir_a(self) -> typing.List[carmaWrap.obj_float]:
2275 List of iir coefficient vectors for outputs
2276 (see compass.io details on the generic linear controller)
2278 :type: typing.List[carmaWrap.obj_float]
2281 def d_iir_b(self) -> typing.List[carmaWrap.obj_float]:
2283 List of iir coefficient vectors for inputs
2284 (see compass.io details on the generic linear controller)
2286 :type: typing.List[carmaWrap.obj_float]
2289 def d_imat(self) -> carmaWrap.obj_float:
2291 D matrix, typically set to the interaction matrix
2292 (see compass.io details on the generic linear controller)
2294 :type: carmaWrap.obj_float
2297 def d_matA(self) -> typing.List[carmaWrap.obj_float]:
2299 List of A matrices used for state recursion
2300 (see compass.io details on the generic linear controller)
2302 :type: typing.List[carmaWrap.obj_float]
2305 def d_matD(self) -> carmaWrap.obj_float:
2307 D matrix, typically set to the interaction matrix
2308 (see compass.io details on the generic linear controller)
2310 :type: carmaWrap.obj_float
2313 def d_matF(self) -> carmaWrap.obj_float:
2315 F matrix, used to project from modes to actuator voltages
2316 (see compass.io details on the generic linear controller)
2318 :type: carmaWrap.obj_float
2321 def d_matK(self) -> carmaWrap.obj_float:
2323 K matrix, used for projection from state to modes
2324 (see compass.io details on the generic linear controller)
2326 :type: carmaWrap.obj_float
2329 def d_matL(self) -> typing.List[carmaWrap.obj_float]:
2331 List of L matrices used for innovation from measurements
2332 (see compass.io details on the generic linear controller)
2334 :type: typing.List[carmaWrap.obj_float]
2337 def d_s_now(self) -> carmaWrap.obj_float:
2339 temporary slope vector used for control calcs
2340 (see compass.io details on the generic linear controller)
2342 :type: carmaWrap.obj_float
2345 def d_u_now(self) -> carmaWrap.obj_float:
2347 temporary command vector used for control calcs
2348 (see compass.io details on the generic linear controller)
2350 :type: carmaWrap.obj_float
2353 def d_x_now(self) -> carmaWrap.obj_float:
2355 temporary state vector used for control calcs
2356 (see compass.io details on the generic linear controller)
2358 :type: carmaWrap.obj_float
2361 def modal(self) -> bool:
2364 (see compass.io details on the generic linear controller)
2371 number of iir inputs to use
2372 (see compass.io details on the generic linear controller)
2379 number of iir outputs to use
2380 (see compass.io details on the generic linear controller)
2387 number of modes in mode vector
2388 (see compass.io details on the generic linear controller)
2395 number of slope vectors to store in buffer
2396 (see compass.io details on the generic linear controller)
2403 number of state vectors to store in buffer
2404 (see compass.io details on the generic linear controller)
2411 number of states in state vector
2412 (see compass.io details on the generic linear controller)
2417 def polc(self) -> bool:
2420 (see compass.io details on the generic linear controller)
2425 class ControllerGENERIC_FF(Controller_FF):
2426 def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
2428 Set the command matrix
2431 cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
2433 def set_commandlaw(self, commandlaw: str) -> int:
2435 Set the command law to use
2438 commandlaw: (str): command law "integrator", "modal_integrator" or "2matrices"
2440 def set_decayFactor(self, decayFactor: numpy.ndarray[numpy.float32]) -> int:
2442 Set the decay factor vector
2445 decayFactor: (np.array[ndim=1,dtype=np.float32]): decay factor
2447 def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
2449 Set the interaction matrix
2452 imat: (np.array[ndim=2,dtype=np.float32]): interaction matrix to set
2454 def set_matE(self, E: numpy.ndarray[numpy.float32]) -> int:
2459 E: (np.array[ndim=2,dtype=np.float32]): E matrix to set
2461 def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2463 Set the controller modal gains
2466 mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
2468 def set_polc(self, polc: bool) -> int:
2473 polc: (bool): polc flag
2476 def command_law(self) -> str:
2478 Command law currently used
2483 def d_cmat(self) -> carmaWrap.obj_float:
2487 :type: carmaWrap.obj_float
2490 def d_compbuff(self) -> carmaWrap.obj_float:
2492 Computation buffer buffer
2494 :type: carmaWrap.obj_float
2497 def d_decayFactor(self) -> carmaWrap.obj_float:
2499 decayFactor vector (see compass.io details on generic controller)
2501 :type: carmaWrap.obj_float
2504 def d_err_ngpu(self) -> typing.List[carmaWrap.obj_float]:
2506 :type: typing.List[carmaWrap.obj_float]
2509 def d_gain(self) -> carmaWrap.obj_float:
2511 vector of modal gains
2513 :type: carmaWrap.obj_float
2516 def d_imat(self) -> carmaWrap.obj_float:
2520 :type: carmaWrap.obj_float
2523 def d_matE(self) -> carmaWrap.obj_float:
2525 E matrix (see compass.io details on generic controller)
2527 :type: carmaWrap.obj_float
2530 def polc(self) -> bool:
2537 class ControllerGENERIC_FU(Controller_FU):
2538 def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
2540 Set the command matrix
2543 cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
2545 def set_commandlaw(self, commandlaw: str) -> int:
2547 Set the command law to use
2550 commandlaw: (str): command law "integrator", "modal_integrator" or "2matrices"
2552 def set_decayFactor(self, decayFactor: numpy.ndarray[numpy.float32]) -> int:
2554 Set the decay factor vector
2557 decayFactor: (np.array[ndim=1,dtype=np.float32]): decay factor
2559 def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
2561 Set the interaction matrix
2564 imat: (np.array[ndim=2,dtype=np.float32]): interaction matrix to set
2566 def set_matE(self, E: numpy.ndarray[numpy.float32]) -> int:
2571 E: (np.array[ndim=2,dtype=np.float32]): E matrix to set
2573 def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2575 Set the controller modal gains
2578 mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
2580 def set_polc(self, polc: bool) -> int:
2585 polc: (bool): polc flag
2588 def command_law(self) -> str:
2590 Command law currently used
2595 def d_cmat(self) -> carmaWrap.obj_float:
2599 :type: carmaWrap.obj_float
2602 def d_compbuff(self) -> carmaWrap.obj_float:
2604 Computation buffer buffer
2606 :type: carmaWrap.obj_float
2609 def d_decayFactor(self) -> carmaWrap.obj_float:
2611 decayFactor vector (see compass.io details on generic controller)
2613 :type: carmaWrap.obj_float
2616 def d_err_ngpu(self) -> typing.List[carmaWrap.obj_float]:
2618 :type: typing.List[carmaWrap.obj_float]
2621 def d_gain(self) -> carmaWrap.obj_float:
2623 vector of modal gains
2625 :type: carmaWrap.obj_float
2632 :type: carmaWrap.obj_float
2635 def d_matE(self) -> carmaWrap.obj_float:
2637 E matrix (see compass.io details on generic controller)
2639 :type: carmaWrap.obj_float
2642 def polc(self) -> bool:
2649 class ControllerGEO_FF(Controller_FF):
2650 def comp_dphi(self, source: Source, wfs_direction: bool) -> int:
2652 Get the pupil phase and remove piston before projection
2655 source: (SutraSource): Phase source
2657 wfs_direction: (bool): Must be True if the source is a WFS GS
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:
2661 Initializes projection matrices
2664 dms: (SutraDms): SutraDms object
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
2671 indx_mpup: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the medium pupil
2673 roket: (bool): ROKET flag
2675 def load_Btt(self, Btt_pzt: numpy.ndarray[numpy.float32], Btt_tt: numpy.ndarray[numpy.float32]) -> int:
2677 Load the Btt modal basis in the geo controller for ROKET
2680 Btt_pzt: (np.array[ndim=2,dtype=np.float32]) : PZT DM component
2682 Btt_tt: (np.array[ndim=2,dtype=np.float32]) : TT mirror component
2685 def load_mgain(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2687 Set the controller modal gains
2690 mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
2693 def Nphi(self) -> int:
2695 Number of points in the pupil
2700 def Ntt(self) -> int:
2702 Number of tip-tilt mirror
2707 def d_IFsparse(self) -> carmaWrap.sparse_obj_double:
2709 Influence functions in the pupil (sparse representation
2711 :type: carmaWrap.sparse_obj_double
2714 def d_TT(self) -> carmaWrap.obj_float:
2716 Tip-tilt influence functions
2718 :type: carmaWrap.obj_float
2721 def d_compdouble(self) -> carmaWrap.obj_double:
2723 Buffer for computation (double precision)
2725 :type: carmaWrap.obj_double
2728 def d_compfloat(self) -> carmaWrap.obj_float:
2730 Buffer for computation (simple precision)
2732 :type: carmaWrap.obj_float
2735 def d_gain(self) -> carmaWrap.obj_float:
2737 vector of modal gains
2739 :type: carmaWrap.obj_float
2742 def d_geocov(self) -> carmaWrap.obj_float:
2744 Geometric covariance matrix
2746 :type: carmaWrap.obj_float
2749 def d_geocovTT(self) -> carmaWrap.obj_float:
2751 Geometric covariance matrix for TT mirror
2753 :type: carmaWrap.obj_float
2756 def d_indx_mpup(self) -> carmaWrap.obj_int:
2758 Indices of the valid pixels in mpupil
2760 :type: carmaWrap.obj_int
2763 def d_indx_pup(self) -> carmaWrap.obj_int:
2765 Indices of the valid pixels in spupil
2767 :type: carmaWrap.obj_int
2770 def d_phi(self) -> carmaWrap.obj_double:
2772 Phase in the pupil without piston (double)
2774 :type: carmaWrap.obj_double
2777 def d_phif(self) -> carmaWrap.obj_float:
2779 Phase in the pupil without piston (float)
2781 :type: carmaWrap.obj_float
2784 class ControllerGEO_FU(Controller_FU):
2785 def comp_dphi(self, source: Source, wfs_direction: bool) -> int:
2787 Get the pupil phase and remove piston before projection
2790 source: (SutraSource): Phase source
2792 wfs_direction: (bool): Must be True if the source is a WFS GS
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:
2796 Initializes projection matrices
2799 dms: (SutraDms): SutraDms object
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
2804 indx_pup: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the small pupil
2806 indx_mpup: (np.array[ndim=1,dtype=np.int64]): Indices of valid pixels of the medium pupil
2808 roket: (bool): ROKET flag
2810 def load_Btt(self, Btt_pzt: numpy.ndarray[numpy.float32], Btt_tt: numpy.ndarray[numpy.float32]) -> int:
2812 Load the Btt modal basis in the geo controller for ROKET
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
2820 def load_mgain(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2822 Set the controller modal gains
2825 mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
2828 def Nphi(self) -> int:
2830 Number of points in the pupil
2835 def Ntt(self) -> int:
2837 Number of tip-tilt mirror
2842 def d_IFsparse(self) -> carmaWrap.sparse_obj_double:
2844 Influence functions in the pupil (sparse representation
2846 :type: carmaWrap.sparse_obj_double
2849 def d_TT(self) -> carmaWrap.obj_float:
2851 Tip-tilt influence functions
2853 :type: carmaWrap.obj_float
2856 def d_compdouble(self) -> carmaWrap.obj_double:
2858 Buffer for computation (double precision)
2860 :type: carmaWrap.obj_double
2863 def d_compfloat(self) -> carmaWrap.obj_float:
2865 Buffer for computation (simple precision)
2867 :type: carmaWrap.obj_float
2870 def d_gain(self) -> carmaWrap.obj_float:
2872 vector of modal gains
2874 :type: carmaWrap.obj_float
2877 def d_geocov(self) -> carmaWrap.obj_float:
2879 Geometric covariance matrix
2881 :type: carmaWrap.obj_float
2884 def d_geocovTT(self) -> carmaWrap.obj_float:
2886 Geometric covariance matrix for TT mirror
2888 :type: carmaWrap.obj_float
2891 def d_indx_mpup(self) -> carmaWrap.obj_int:
2893 Indices of the valid pixels in mpupil
2895 :type: carmaWrap.obj_int
2898 def d_indx_pup(self) -> carmaWrap.obj_int:
2900 Indices of the valid pixels in spupil
2902 :type: carmaWrap.obj_int
2905 def d_phi(self) -> carmaWrap.obj_double:
2907 Phase in the pupil without piston (double)
2909 :type: carmaWrap.obj_double
2912 def d_phif(self) -> carmaWrap.obj_float:
2914 Phase in the pupil without piston (float)
2916 :type: carmaWrap.obj_float
2920 def build_cmat(self, nfilt: int) -> int:
2922 Computes the command matrix after imat SVD
2925 nfilt: (int): number of modes to filter
2927 def init_modalOpti(self, nmodes: int, nrec: int, M2V: numpy.ndarray[numpy.float32], gmin: float, gmax: float, ngain: int, Fs: float) -> int:
2929 Initialize modal optimization control
2932 nmodes: (int): number of modes to control
2934 nrec: (int): number of open loop slopes to consider
2936 M2V: (np.array[ndim=2,dtype=np.float32]): Modes to Volt matrix
2938 gmin: (float): Minimal gain
2940 gmax: (float): Maximal gain
2942 ngain: (int): Number of gain values to test between gmin and gmax
2944 Fs: (float): Sampling frequency [Hz]
2946 def loadopen_loopSlp(self, slopes: numpy.ndarray[numpy.float32]) -> int:
2948 Load recorded open loop slopes for modal optimization initialization
2951 slopes: (np.array[ndim=2,dtype=np.float32]): Open loop slopes
2953 def modalControlOptimization(self) -> int:
2957 def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
2959 Set the command matrix
2962 cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
2964 def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
2966 Set the interaction matrix
2969 imat: (np.array[ndim=2,dtype=np.float32]): interaction matrix to set
2971 def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
2973 Set the controller modal gains
2976 mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
2978 def svdec_imat(self) -> int:
2980 Performs interaction matrix SVD
2983 def Fs(self) -> float:
2985 Sampling frequency for modal optimization
2990 def cpt_rec(self) -> int:
2992 Counter for modal gains refresh
2997 def d_Hcor(self) -> carmaWrap.obj_float:
2999 Transfer function for modal optimization
3001 :type: carmaWrap.obj_float
3004 def d_M2V(self) -> carmaWrap.obj_float:
3006 Modes to volt matrix for modal optimization
3008 :type: carmaWrap.obj_float
3011 def d_S2M(self) -> carmaWrap.obj_float:
3013 Slopes to modes matrix for modal optimization
3015 :type: carmaWrap.obj_float
3018 def d_U(self) -> carmaWrap.obj_float:
3020 Eigen modes of the imat
3022 :type: carmaWrap.obj_float
3025 def d_cenbuff(self) -> carmaWrap.obj_float:
3027 Centroids circular buffer
3029 :type: carmaWrap.obj_float
3032 def d_cmat(self) -> carmaWrap.obj_float:
3036 :type: carmaWrap.obj_float
3041 Buffer for POLC computation
3043 :type: carmaWrap.obj_float
3046 def d_compbuff2(self) -> carmaWrap.obj_float:
3048 Buffer for POLC computation
3050 :type: carmaWrap.obj_float
3053 def d_eigenvals(self) -> carmaWrap.obj_float:
3055 Eigen values of the imat
3057 :type: carmaWrap.obj_float
3060 def d_err(self) -> carmaWrap.obj_float:
3062 Current increment on the command
3064 :type: carmaWrap.obj_float
3067 def d_gain(self) -> carmaWrap.obj_float:
3069 vector of modal gains
3071 :type: carmaWrap.obj_float
3074 def d_imat(self) -> carmaWrap.obj_float:
3078 :type: carmaWrap.obj_float
3081 def d_slpol(self) -> carmaWrap.obj_float:
3083 Open loop slopes for modal optimization
3085 :type: carmaWrap.obj_float
3088 def gmax(self) -> float:
3090 Maximal gain for modal optimization
3095 def gmin(self) -> float:
3097 Minimal gain for modal optimization
3102 def is_modopti(self) -> int:
3104 Falg for modal optimization
3109 def ngain(self) -> int:
3111 Number of gain values to test between gmin and gmax for modal optimization
3116 def nmodes(self) -> int:
3118 Number of modes for modal optimization
3123 def nrec(self) -> int:
3125 Number of open loop slopes to take for modal optimization
3130 class ControllerLS_FU(Controller_FU):
3131 def build_cmat(self, nfilt: int) -> int:
3133 Computes the command matrix after imat SVD
3136 nfilt: (int): number of modes to filter
3138 def init_modalOpti(self, nmodes: int, nrec: int, M2V: numpy.ndarray[numpy.float32], gmin: float, gmax: float, ngain: int, Fs: float) -> int:
3140 Initialize modal optimization control
3143 nmodes: (int): number of modes to control
3145 nrec: (int): number of open loop slopes to consider
3147 M2V: (np.array[ndim=2,dtype=np.float32]): Modes to Volt matrix
3149 gmin: (float): Minimal gain
3151 gmax: (float): Maximal gain
3153 ngain: (int): Number of gain values to test between gmin and gmax
3155 Fs: (float): Sampling frequency [Hz]
3157 def loadopen_loopSlp(self, slopes: numpy.ndarray[numpy.float32]) -> int:
3159 Load recorded open loop slopes for modal optimization initialization
3162 slopes: (np.array[ndim=2,dtype=np.float32]): Open loop slopes
3164 def modalControlOptimization(self) -> int:
3168 def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
3170 Set the command matrix
3173 cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3175 def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
3177 Set the interaction matrix
3180 imat: (np.array[ndim=2,dtype=np.float32]): interaction matrix to set
3182 def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
3184 Set the controller modal gains
3187 mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
3189 def svdec_imat(self) -> int:
3191 Performs interaction matrix SVD
3194 def Fs(self) -> float:
3196 Sampling frequency for modal optimization
3201 def cpt_rec(self) -> int:
3203 Counter for modal gains refresh
3208 def d_Hcor(self) -> carmaWrap.obj_float:
3210 Transfer function for modal optimization
3212 :type: carmaWrap.obj_float
3215 def d_M2V(self) -> carmaWrap.obj_float:
3217 Modes to volt matrix for modal optimization
3219 :type: carmaWrap.obj_float
3222 def d_S2M(self) -> carmaWrap.obj_float:
3224 Slopes to modes matrix for modal optimization
3226 :type: carmaWrap.obj_float
3229 def d_U(self) -> carmaWrap.obj_float:
3231 Eigen modes of the imat
3233 :type: carmaWrap.obj_float
3236 def d_cenbuff(self) -> carmaWrap.obj_float:
3238 Centroids circular buffer
3240 :type: carmaWrap.obj_float
3243 def d_cmat(self) -> carmaWrap.obj_float:
3247 :type: carmaWrap.obj_float
3250 def d_compbuff(self) -> carmaWrap.obj_float:
3252 Buffer for POLC computation
3254 :type: carmaWrap.obj_float
3257 def d_compbuff2(self) -> carmaWrap.obj_float:
3259 Buffer for POLC computation
3261 :type: carmaWrap.obj_float
3264 def d_eigenvals(self) -> carmaWrap.obj_float:
3266 Eigen values of the imat
3268 :type: carmaWrap.obj_float
3271 def d_err(self) -> carmaWrap.obj_float:
3273 Current increment on the command
3275 :type: carmaWrap.obj_float
3278 def d_gain(self) -> carmaWrap.obj_float:
3280 vector of modal gains
3282 :type: carmaWrap.obj_float
3285 def d_imat(self) -> carmaWrap.obj_float:
3289 :type: carmaWrap.obj_float
3292 def d_slpol(self) -> carmaWrap.obj_float:
3294 Open loop slopes for modal optimization
3296 :type: carmaWrap.obj_float
3299 def gmax(self) -> float:
3301 Maximal gain for modal optimization
3306 def gmin(self) -> float:
3308 Minimal gain for modal optimization
3313 def is_modopti(self) -> int:
3315 Falg for modal optimization
3320 def ngain(self) -> int:
3322 Number of gain values to test between gmin and gmax for modal optimization
3327 def nmodes(self) -> int:
3329 Number of modes for modal optimization
3334 def nrec(self) -> int:
3336 Number of open loop slopes to take for modal optimization
3341 class ControllerMV_FF(Controller_FF):
3342 def build_cmat(self, cond: float) -> int:
3344 Computes the command matrix
3347 cond: (float): Conditioning number for inversion
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:
3351 Compute the Cmm matrix
3354 atmos : (SutraAtmos): SutraAtmos object
3356 sensors: (SutraSensors): SutraSensors object
3358 LO: (np.array[ndim=1,dtype=np.float64]): outer scale of each layer
3360 Cn2: (np.array[ndim=1,dtype=np.float64]): Cn2 profile
3362 alphaX: (np.array[ndim=1,dtype=np.float64]): X position of each WFS
3364 alphaY: (np.array[ndim=1,dtype=np.float64]): Y position of each WFS
3366 diamTel: (double): Telescope diameter
3368 cobs: (double): Central obstruction ratio
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:
3372 Compute the Cphim matrix
3375 atmos : (SutraAtmos): SutraAtmos object
3377 sensors: (SutraSensors): SutraSensors object
3379 dms: (SutraDms): SutraDms object
3381 LO: (np.array[ndim=1,dtype=np.float64]): outer scale of each layer
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
3387 alphaY: (np.array[ndim=1,dtype=np.float64]): Y position of each WFS
3389 X: (np.array[ndim=1,dtype=np.float64]): X position of each subaperture
3391 Y: (np.array[ndim=1,dtype=np.float64]): Y position of each subaperture
3393 xactu: (np.array[ndim=1,dtype=np.float64]): X position of each actuators
3395 yactu: (np.array[ndim=1,dtype=np.float64]): Y position of each actuators
3397 diamTel: (double): Telescope diameter
3399 k2: (np.array[ndim=1,dtype=np.float64]): scales
3401 NlayerDm: (np.array[ndim=1,dtype=np.int64]): Number of layers handled by each DM
3403 indLayerDm: (np.array[ndim=1,dtype=np.int64]): Indices of layers handled by each DM
3405 FoV: (double): Field of view
3407 pitch: (np.array[ndim=1,dtype=np.int64]): Pitch of each DM
3409 alt_dm: (np.array[ndim=1,dtype=np.int64]): Altitude of each DM
3411 def filter_cmat(self, cond: float) -> int:
3413 Filter command matrix from TT
3416 cond: (float): TODO: docstring
3418 def filter_cphim(self, F: numpy.ndarray[numpy.float32], Nact: numpy.ndarray[numpy.float32]) -> int:
3420 Filter Cphim from piston and apply coupling
3423 F: (np.array[ndim=2,dtype=np.float32]): Piston filter matrix
3425 Nact: (np.array[ndim=2,dtype=np.float32]): Coupling matrix
3427 def load_noisemat(self, noisemat: numpy.ndarray[numpy.float32]) -> int:
3429 Load the noise covariance matrix
3432 noisemat: (float): noise covariance marix
3434 def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
3436 Set the command matrix
3439 cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3441 def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
3443 Set the interaction matrix
3446 imat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3448 def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
3450 Set the controller modal gains
3453 mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
3456 def d_Cmm(self) -> carmaWrap.obj_float:
3458 Slope covariance matrix
3460 :type: carmaWrap.obj_float
3463 def d_Cphim(self) -> carmaWrap.obj_float:
3465 Actuators-Slopes covariance marix
3467 :type: carmaWrap.obj_float
3470 def d_KLbasis(self) -> carmaWrap.obj_float:
3474 :type: carmaWrap.obj_float
3477 def d_cenbuff(self) -> carmaWrap.obj_float:
3479 Centroids circular buffer
3481 :type: carmaWrap.obj_float
3484 def d_cmat(self) -> carmaWrap.obj_float:
3488 :type: carmaWrap.obj_float
3491 def d_com1(self) -> carmaWrap.obj_float:
3493 Commands at iteration k-1 (for POLC)
3495 :type: carmaWrap.obj_float
3498 def d_covmat(self) -> carmaWrap.obj_float:
3502 :type: carmaWrap.obj_float
3505 def d_err(self) -> carmaWrap.obj_float:
3509 :type: carmaWrap.obj_float
3512 def d_gain(self) -> carmaWrap.obj_float:
3514 vector of modal gains
3516 :type: carmaWrap.obj_float
3519 def d_imat(self) -> carmaWrap.obj_float:
3523 :type: carmaWrap.obj_float
3526 def d_noisemat(self) -> carmaWrap.obj_float:
3528 Noise on WFS measurements matrix
3530 :type: carmaWrap.obj_float
3533 def d_olmeas(self) -> carmaWrap.obj_float:
3535 Reconstructed open loop measurement
3537 :type: carmaWrap.obj_float
3540 def h_Cmmeigenvals(self) -> carmaWrap.host_obj_float:
3544 :type: carmaWrap.host_obj_float
3547 def h_eigenvals(self) -> carmaWrap.host_obj_float:
3551 :type: carmaWrap.host_obj_float
3554 class ControllerMV_FU(Controller_FU):
3557 Computes the command matrix
3560 cond: (float): Conditioning number for inversion
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:
3564 Compute the Cmm matrix
3567 atmos : (SutraAtmos): SutraAtmos object
3569 sensors: (SutraSensors): SutraSensors object
3571 LO: (np.array[ndim=1,dtype=np.float64]): outer scale of each layer
3573 Cn2: (np.array[ndim=1,dtype=np.float64]): Cn2 profile
3575 alphaX: (np.array[ndim=1,dtype=np.float64]): X position of each WFS
3577 alphaY: (np.array[ndim=1,dtype=np.float64]): Y position of each WFS
3579 diamTel: (double): Telescope diameter
3581 cobs: (double): Central obstruction ratio
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:
3585 Compute the Cphim matrix
3588 atmos : (SutraAtmos): SutraAtmos object
3590 sensors: (SutraSensors): SutraSensors object
3592 dms: (SutraDms): SutraDms object
3594 LO: (np.array[ndim=1,dtype=np.float64]): outer scale of each layer
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
3600 alphaY: (np.array[ndim=1,dtype=np.float64]): Y position of each WFS
3602 X: (np.array[ndim=1,dtype=np.float64]): X position of each subaperture
3604 Y: (np.array[ndim=1,dtype=np.float64]): Y position of each subaperture
3606 xactu: (np.array[ndim=1,dtype=np.float64]): X position of each actuators
3608 yactu: (np.array[ndim=1,dtype=np.float64]): Y position of each actuators
3610 diamTel: (double): Telescope diameter
3612 k2: (np.array[ndim=1,dtype=np.float64]): scales
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
3618 FoV: (double): Field of view
3620 pitch: (np.array[ndim=1,dtype=np.int64]): Pitch of each DM
3622 alt_dm: (np.array[ndim=1,dtype=np.int64]): Altitude of each DM
3624 def filter_cmat(self, cond: float) -> int:
3626 Filter command matrix from TT
3629 cond: (float): TODO: docstring
3631 def filter_cphim(self, F: numpy.ndarray[numpy.float32], Nact: numpy.ndarray[numpy.float32]) -> int:
3633 Filter Cphim from piston and apply coupling
3636 F: (np.array[ndim=2,dtype=np.float32]): Piston filter matrix
3638 Nact: (np.array[ndim=2,dtype=np.float32]): Coupling matrix
3640 def load_noisemat(self, noisemat: numpy.ndarray[numpy.float32]) -> int:
3642 Load the noise covariance matrix
3645 noisemat: (float): noise covariance marix
3647 def set_cmat(self, cmat: numpy.ndarray[numpy.float32]) -> int:
3649 Set the command matrix
3652 cmat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3654 def set_imat(self, imat: numpy.ndarray[numpy.float32]) -> int:
3656 Set the interaction matrix
3659 imat: (np.array[ndim=2,dtype=np.float32]): command matrix to set
3661 def set_modal_gains(self, mgain: numpy.ndarray[numpy.float32]) -> int:
3663 Set the controller modal gains
3666 mgain: (np.array[ndim1,dtype=np.float32]): modal gains to set
3669 def d_Cmm(self) -> carmaWrap.obj_float:
3671 Slope covariance matrix
3673 :type: carmaWrap.obj_float
3676 def d_Cphim(self) -> carmaWrap.obj_float:
3678 Actuators-Slopes covariance marix
3680 :type: carmaWrap.obj_float
3683 def d_KLbasis(self) -> carmaWrap.obj_float:
3687 :type: carmaWrap.obj_float
3690 def d_cenbuff(self) -> carmaWrap.obj_float:
3692 Centroids circular buffer
3694 :type: carmaWrap.obj_float
3697 def d_cmat(self) -> carmaWrap.obj_float:
3701 :type: carmaWrap.obj_float
3704 def d_com1(self) -> carmaWrap.obj_float:
3706 Commands at iteration k-1 (for POLC)
3708 :type: carmaWrap.obj_float
3711 def d_covmat(self) -> carmaWrap.obj_float:
3715 :type: carmaWrap.obj_float
3718 def d_err(self) -> carmaWrap.obj_float:
3722 :type: carmaWrap.obj_float
3725 def d_gain(self) -> carmaWrap.obj_float:
3727 vector of modal gains
3729 :type: carmaWrap.obj_float
3732 def d_imat(self) -> carmaWrap.obj_float:
3736 :type: carmaWrap.obj_float
3739 def d_noisemat(self) -> carmaWrap.obj_float:
3741 Noise on WFS measurements matrix
3743 :type: carmaWrap.obj_float
3746 def d_olmeas(self) -> carmaWrap.obj_float:
3748 Reconstructed open loop measurement
3750 :type: carmaWrap.obj_float
3753 def h_Cmmeigenvals(self) -> carmaWrap.host_obj_float:
3757 :type: carmaWrap.host_obj_float
3760 def h_eigenvals(self) -> carmaWrap.host_obj_float:
3764 :type: carmaWrap.host_obj_float
3767 class ControllerCURED_FF(Controller_FF):
3768 def init_cured(self, nxsub: int, isvalid: numpy.ndarray[numpy.int32], ndivs: int, tt: int) -> int:
3773 nxsub: (int): TODO: docstring
3782 def d_cenbuff(self) -> carmaWrap.obj_float:
3784 Centroids circular buffer
3786 :type: carmaWrap.obj_float
3789 def d_err(self) -> carmaWrap.obj_float:
3793 :type: carmaWrap.obj_float
3800 :type: carmaWrap.obj_float
3803 def h_centroids(self) -> carmaWrap.host_obj_float:
3807 :type: carmaWrap.host_obj_float
3810 def h_err(self) -> carmaWrap.host_obj_float:
3814 :type: carmaWrap.host_obj_float
3817 def ndivs(self) -> int:
3819 Number of subdivision levels
3824 def tt_flag(self) -> bool:
3831 class ControllerCURED_FU(Controller_FU):
3832 def init_cured(self, nxsub: int, isvalid: numpy.ndarray[numpy.int32], ndivs: int, tt: int) -> int:
3837 nxsub: (int): TODO: docstring
3846 def d_cenbuff(self) -> carmaWrap.obj_float:
3848 Centroids circular buffer
3850 :type: carmaWrap.obj_float
3853 def d_err(self) -> carmaWrap.obj_float:
3857 :type: carmaWrap.obj_float
3860 def d_imat(self) -> carmaWrap.obj_float:
3864 :type: carmaWrap.obj_float
3867 def h_centroids(self) -> carmaWrap.host_obj_float:
3871 :type: carmaWrap.host_obj_float
3874 def h_err(self) -> carmaWrap.host_obj_float:
3878 :type: carmaWrap.host_obj_float
3881 def ndivs(self) -> int:
3883 Number of subdivision levels
3888 def tt_flag(self) -> bool:
3895 class Coronagraph():
3898 Computes the electric field from the specified wavelength
3901 wavelengthIndex: (int): Index of the wavelength to use
3903 def compute_image(self, accumulate: bool =
True) -> int:
3905 Computes the coronagraphic image from the source phase screen
3908 accumulate: (bool, optionnal): If True (default), accumulate the short exposure image in the long exposure one
3910 def compute_psf(self, accumulate: bool =
True) -> int:
3912 Computes the psf from the source phase screen
3915 accumulate: (bool, optionnal): If True (default), accumulate the short exposure psf in the long exposure one
3917 def reset(self) -> int:
3919 Reset long exposure image and counter
3921 def set_amplitude(self, arg0: numpy.ndarray[numpy.float32]) -> int:
3923 Set the electric field amplitude
3926 amplitude: (np.ndarray[ndim=3, dtype=np.float32]): electric field amplitude
3929 def amplitude(self) -> typing.List[carmaWrap.obj_float]:
3931 Electric field amplitude in the pupil
3933 :type: typing.List[carmaWrap.obj_float]
3936 def cntImg(self) -> int:
3938 Accumulation counter of coronagraphic images
3943 def cntPsf(self) -> int:
3945 Accumulation counter of psf
3950 def d_complex_image(self) -> carmaWrap.obj_float_complex:
3952 Complex coronagraphic image
3954 :type: carmaWrap.obj_float_complex
3957 def d_electric_field(self) -> carmaWrap.obj_float_complex:
3959 Electric field in the pupil
3961 :type: carmaWrap.obj_float_complex
3964 def d_image_le(self) -> carmaWrap.obj_float:
3966 Long exposure coronagraphic image
3968 :type: carmaWrap.obj_float
3971 def d_image_se(self) -> carmaWrap.obj_float:
3973 Short exposure coronagraphic image
3975 :type: carmaWrap.obj_float
3978 def d_psf_le(self) -> carmaWrap.obj_float:
3980 Long exposure coronagraphic psf
3982 :type: carmaWrap.obj_float
3985 def d_psf_se(self) -> carmaWrap.obj_float:
3987 Short exposure coronagraphic psf
3989 :type: carmaWrap.obj_float
3992 def d_pupil(self) -> carmaWrap.obj_float:
3996 :type: carmaWrap.obj_float
3999 def d_source(self) -> Source:
4001 SutraSource used as OPD input
4013 def imageDimx(self) -> int:
4015 Coronagraphic image dimension along X-axis
4020 def imageDimy(self) -> int:
4022 Coronagraphic image dimension along Y-axis
4027 def pupDimx(self) -> int:
4029 Pupil dimension along X-axis
4034 def pupDimy(self) -> int:
4036 Pupil dimension along Y-axis
4041 def type(self) -> str:
4048 def wavelength(self) -> typing.List[float]:
4050 Vector of wavelength used to compute coronagraphic image
4052 :type: typing.List[float]
4056 def __str__(self) -> str: ...
4057 def comp_oneactu(self, nactu: int, ampli: float) -> int:
4059 Push the specified actuator and computes the corresponding DM shape
4062 nactu: (int): Actuator index
4064 ampli: (float): Volt to apply to this actuator
4068 def comp_shape(self) -> int:
4070 Compute the DM shape according to commands d_com
4074 Compute the DM shape according to given commands
4077 com: (np.ndarray[ndim=1,dtype=np.float32_t]): commands to apply
4082 Compute the DM shape according to given commands
4085 com: (np.ndarray[ndim=1,dtype=np.uint16_t]): commands to apply
4090 def comp_shape(self, com: numpy.ndarray[numpy.float32]) -> int: ...
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:
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
4101 xpos: (np.ndarray[ndim=1,dtype=np.float32_t]) : x-position of actuators
4103 ypos: (np.ndarray[ndim=1,dtype=np.float32_t]) : y-position of actuators
4105 indx_pup: (np.ndarray[ndim=1,dtype=np.int32_t]) : indices of pupil points
4107 dim: (long) : number of points in the pupil
4109 norm: (float) : normalization factor
4111 ampli: (float) : amplitude
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:
4116 Load all the arrays computed during the initialization for a kl DM in a SutraDm object
4119 rabas: (np.ndarray[ndim=1,dtype=np.float32_t]): TODO docstring
4121 azbas: (np.ndarray[ndim=1,dtype=np.float32_t]):
4123 ords: (np.ndarray[ndim=1,dtype=np.int32_t]):
4125 cr: (np.ndarray[ndim=1,dtype=np.float32_t]):
4127 cp: (np.ndarray[ndim=1,dtype=np.float32_t]):
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:
4132 Load all the arrays computed during the initialization for a pzt DM in a SutraDm object
4135 influ: (np.ndarray[ndim=3,dtype=np.float32_t]) : influence functions cube
4141 influpos: (np.ndarray[ndim=1,dtype=np.int32_t]) : positions of the IF in the pupil
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
4147 istart: (np.ndarray[ndim=1,dtype=np.int32_t]) :
4149 xoff: (np.ndarray[ndim=1,dtype=np.int32_t]) : x-offset for shape computation
4151 yoff: (np.ndarray[ndim=1,dtype=np.int32_t]) : y-offset or shape computation
4154 def reset_shape(self) -> int:
4156 Reset the DM shape to zeros (flat)
4158 def set_com(self, com: numpy.ndarray[numpy.float32], shape_dm: bool =
True) ->
None:
4160 Set the command vector of a SutraDm, and computes the DM shape
4163 com: (np.array(ndim=1, dtype=np.float32)): Command vector
4165 shape_dm: (bool): (optionnal, default=True) Computes the DM shape
4168 def set_registration(self, dx: float, dy: float, theta: float, G: float) -> int:
4170 Set the registration parameters : dx, dy, theta and G
4173 dx: (float): X axis misregistration [pixels]
4175 dy: (float): Y axis misregistration [pixels]
4177 theta: (float): Rotation angle misregistration [radians]
4179 G: (float): Magnification factor
4182 def tt_loadarrays(self, influ: numpy.ndarray[numpy.float32]) -> int:
4184 Load all the arrays computed during the initialization for a tt DM in a SutraDm object
4187 influ: (np.ndarray[ndim=3,dtype=np.float32_t]) : influence functions cube
4191 def G(self) -> float:
4193 Magnification factor registration in pixels
4198 def altitude(self) -> float:
4200 DM conjugaison altitude
4205 def d_KLbasis(self) -> carmaWrap.obj_float:
4209 :type: carmaWrap.obj_float
4212 def d_com(self) -> carmaWrap.obj_float:
4214 Current commands of the DM
4216 :type: carmaWrap.obj_float
4219 def d_influ(self) -> carmaWrap.obj_float:
4221 Cube of influence functions
4223 :type: carmaWrap.obj_float
4226 def d_influpos(self) -> carmaWrap.obj_int:
4228 Influence functions positions in the pupil
4230 :type: carmaWrap.obj_int
4233 def d_istart(self) -> carmaWrap.obj_int:
4237 :type: carmaWrap.obj_int
4240 def d_kl(self) -> SutraKL:
4247 def d_npoints(self) -> carmaWrap.obj_int:
4249 Number of IF that impact each pixel of the pupil
4251 :type: carmaWrap.obj_int
4254 def d_shape(self) -> carmaWrap.obj_float:
4258 :type: carmaWrap.obj_float
4261 def d_xoff(self) -> carmaWrap.obj_int:
4265 :type: carmaWrap.obj_int
4268 def d_yoff(self) -> carmaWrap.obj_int:
4272 :type: carmaWrap.obj_int
4282 def dim(self) -> int:
4289 def dx(self) -> float:
4291 X registration in pixels
4296 def dy(self) -> float:
4298 Y registration in pixels
4303 def influsize(self) -> int:
4305 Influence function support size
4310 def nactus(self) -> int:
4317 def push4imat(self) -> float:
4319 Voltage to apply for imat computation
4324 def thetaML(self) -> float:
4326 thetaML registration in radians
4331 def type(self) -> str:
4339 def __init__(self) -> None:
4341 Create a void DMS object
4343 def __str__(self) -> str: ...
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:
4347 Add a SutraDm in the SutraDms vector
4350 context: (CarmaContext) : current carma context
4352 type: (str): DM type ("pzt", "kl", or "tt")
4354 alt: (float): Conjugaison altitude in meters
4356 dim: (long): Support dimension
4358 nactus: (long): Number of actuators
4360 influsize: (long): Influenction function support size
4362 ninflupos: (long): Size of _influpos array
4364 n_npoints: (long): Size of _ninflu array
4366 push4imat: (float): Voltage to apply for imat computation
4368 nord: (long): Number of radial order for kl dm (0 if not kl)
4370 dx: (float): X axis misregistration [pixels]
4372 dy: (float): Y axis misregistration [pixels]
4374 theta: (float): Rotation angle misregistration [radians]
4376 G: (float): Magnification factor
4378 device: (int): Device index
4382 Add a SutraDm in the SutraDms vector
4385 context: (CarmaContext) : current carma context
4387 type: (str): DM type ("pzt", "kl", or "tt")
4389 alt: (float): Conjugaison altitude in meters
4391 dim: (long): Support dimension
4393 nactus: (long): Number of actuators
4395 influsize: (long): Influenction function support size
4397 ninflupos: (long): Size of _influpos array
4399 n_npoints: (long): Size of _ninflu array
4401 push4imat: (float): Voltage to apply for imat computation
4403 nord: (long): Number of radial order for kl dm (0 if not kl)
4405 device: (int): Device index
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:
4412 Add a SutraDm in the SutraDms vector at the specified index
4415 context: (CarmaContext) : current carma context
4417 type: (str): DM type ("pzt", "kl", or "tt")
4419 alt: (float): Conjugaison altitude in meters
4421 dim: (long): Support dimension
4423 nactus: (long): Number of actuators
4425 influsize: (long): Influenction function support size
4427 ninflupos: (long): Size of _influpos array
4429 n_npoints: (long): Size of _ninflu array
4431 push4imat: (float): Voltage to apply for imat computation
4433 nord: (long): Number of radial order for kl dm (0 if not kl)
4435 dx: (float): X axis misregistration [pixels]
4437 dy: (float): Y axis misregistration [pixels]
4439 theta: (float): Rotation angle misregistration [radians]
4441 G: (float): Magnification factor
4443 device: (int): Device index
4445 idx: (int) : DM index in the vector dms
4448 def remove_dm(self, idx: int) -> int:
4450 Remove and delete the selected DM from SutraDms
4453 idx: (int): index of DM
4456 def set_full_com(self, com: numpy.ndarray[numpy.float32], shape_dm: bool =
True) ->
None:
4458 Set the command vector of all DM in SutraDms, and computes the DMs shapes
4461 com: (np.array(ndim=1, dtype=np.float32)): Concatened command vectors
4463 shape_dm: (bool): (optionnal, default=True) Computes the DM shape
4467 def d_dms(self) -> typing.List[SutraDm]:
4471 :type: typing.List[SutraDm]
4474 def nact_total(self) -> int:
4476 Total number of actuators in SutraDms
4481 def ndm(self) -> int:
4483 Number of SutraDm in SutraDms
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:
4494 context: (CarmaContext): context
4496 device: (int): context active device
4498 type : (str) : reconstruction method used ("roket" or "Vii")
4500 nactus : (int) : number of actuators
4502 nmodes (int) : number of modes
4504 niter : (int) : number of iterations performed with roket
4506 IFvalue : (np.ndarray[ndim=1,dtype=float32_t]) : Non zeros values of pzt influence function matrix
4508 IFrowind : (np.ndarray[ndim=1,dtype=int32_t]) : Row indices of nnz values (csr sparse format)
4510 IFcolind : (np.ndarray[ndim=1,dtype=int32_t]) : Column indices of nnz values (csr sparse format)
4512 IFnz: (int): number of non zero element in IF
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
4518 size: (int): pupil size
4520 Npts: (int): number of points in the pupil
4522 scale : (float) : 2*pi/lambda_target with lambda_target expressed in microns
4524 Btt : (np.ndarray[ndim=2, dtype=np.float32_t]) : Volts to Btt modes matrix
4526 covmodes : (np.ndarray[ndim=2, dtype=np.float32_t]) : error covariance matrix expressed in a modal basis
4529 def psf_rec_Vii(self) -> int:
4531 Vii PSF reconstruction
4533 def psf_rec_roket(self, err: numpy.ndarray[numpy.float32]) -> int:
4535 Reconstruct the PSF from ROKET error buffer
4538 err: (np.array[ndim=2,dtype=np.float32]): ROKET error buffer
4541 def Npts(self) -> int:
4543 number of points in the pupil
4548 def d_Btt(self) -> carmaWrap.obj_float:
4552 :type: carmaWrap.obj_float
4555 def d_Dphi(self) -> carmaWrap.obj_float_complex:
4559 :type: carmaWrap.obj_float_complex
4562 def d_IF(self) -> carmaWrap.sparse_obj_float:
4566 :type: carmaWrap.sparse_obj_float
4569 def d_TT(self) -> carmaWrap.obj_float:
4573 :type: carmaWrap.obj_float
4576 def d_amplipup(self) -> carmaWrap.obj_float_complex:
4578 Complex amplitude in the pupil
4580 :type: carmaWrap.obj_float_complex
4583 def d_covmodes(self) -> carmaWrap.obj_float:
4585 error covariance marix on the modes
4587 :type: carmaWrap.obj_float
4590 def d_eigenvals(self) -> carmaWrap.obj_float:
4592 Eigenvalues of Vii diago
4594 :type: carmaWrap.obj_float
4597 def d_err(self) -> carmaWrap.obj_float:
4601 :type: carmaWrap.obj_float
4604 def d_mask(self) -> carmaWrap.obj_float:
4608 :type: carmaWrap.obj_float
4611 def d_newmodek(self) -> carmaWrap.obj_float_complex:
4615 :type: carmaWrap.obj_float_complex
4618 def d_otfVii(self) -> carmaWrap.obj_float:
4620 OTF reconstructed from Vii
4622 :type: carmaWrap.obj_float
4625 def d_otftel(self) -> carmaWrap.obj_float:
4627 OTF of the telescope
4629 :type: carmaWrap.obj_float
4632 def d_phase(self) -> carmaWrap.obj_float:
4636 :type: carmaWrap.obj_float
4639 def d_psf(self) -> carmaWrap.obj_float:
4643 :type: carmaWrap.obj_float
4646 def d_pupfft(self) -> carmaWrap.obj_float_complex:
4650 :type: carmaWrap.obj_float_complex
4653 def d_term1(self) -> carmaWrap.obj_float:
4655 Buffer for Vii computation
4657 :type: carmaWrap.obj_float
4660 def d_term2(self) -> carmaWrap.obj_float:
4662 Buffer for Vii computation
4664 :type: carmaWrap.obj_float
4667 def d_wherephase(self) -> carmaWrap.obj_int:
4669 index of valid point
4671 :type: carmaWrap.obj_int
4681 def nactus(self) -> int:
4688 def niter(self) -> int:
4690 number of iterations
4695 def nmodes(self) -> int:
4702 def scale(self) -> float:
4709 def size(self) -> int:
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:
4720 Initializes Groot to compute aniso and bandwidth model
4723 context: (CarmaContext): context
4725 device: (int): context active device
4757 Initializes Groot to compute aliasing model
4760 context: (CarmaContext): context
4762 device: (int): context active device
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:
4785 Computes the aliasing error covariance matrix
4787 def compute_Cerr(self) -> int:
4789 Computes the aniso and bandwidth error covariance matrix
4792 def d(self) -> float:
4799 def d_CaXX(self) -> carmaWrap.obj_float:
4801 XX component of the aliasing model
4803 :type: carmaWrap.obj_float
4806 def d_CaYY(self) -> carmaWrap.obj_float:
4808 YY component of the aliasing model
4810 :type: carmaWrap.obj_float
4813 def d_Cerr(self) -> carmaWrap.obj_float:
4815 Model of aniso and bandwidth covariance error matrix
4817 :type: carmaWrap.obj_float
4820 def d_Nact(self) -> carmaWrap.obj_float:
4824 :type: carmaWrap.obj_float
4827 def d_TT(self) -> carmaWrap.obj_float:
4831 :type: carmaWrap.obj_float
4834 def d_TTPfilter(self) -> carmaWrap.obj_float:
4836 Tip-tilt and piston filter matrix (= Btt.dot(P))
4838 :type: carmaWrap.obj_float
4841 def d_pzt2tt(self) -> carmaWrap.obj_float:
4845 :type: carmaWrap.obj_float
4848 def d_tab_int_x(self) -> carmaWrap.obj_float:
4852 :type: carmaWrap.obj_float
4855 def d_tab_int_y(self) -> carmaWrap.obj_float:
4859 :type: carmaWrap.obj_float
4862 def d_xpos(self) -> carmaWrap.obj_float:
4864 X-positions of DM actuators or ssp [m]
4866 :type: carmaWrap.obj_float
4869 def d_ypos(self) -> carmaWrap.obj_float:
4871 Y-positions of DM actuators or ssp [m]
4873 :type: carmaWrap.obj_float
4883 def fc(self) -> float:
4885 DM cut-off frequency [m]
4890 def gsangle(self) -> float:
4892 Guide star angle [rad]
4904 def nlayers(self) -> int:
4906 number of turbulent layers
4911 def npts(self) -> int:
4913 number of samples for aliasig computation
4918 def nssp(self) -> int:
4925 def scale(self) -> float:
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:
4935 Initialize LGS object
4938 nprof: (int): TODO: docstring
4948 doffaxis:(np.array[ndim= , dtype=np.float32]):
4950 prof1d:(np.array[ndim= , dtype=np.float32]):
4952 profcum:(np.array[ndim= , dtype=np.float32]):
4954 beam:(np.array[ndim= , dtype=np.float32]):
4956 ftbeam:(np.array[ndim= , dtype=np.complex64]):
4958 azimuth:(np.array[ndim= , dtype=np.float32]):
4961 def d_azimuth(self) -> carmaWrap.obj_float:
4965 :type: carmaWrap.obj_float
4968 def d_beam(self) -> carmaWrap.obj_float:
4972 :type: carmaWrap.obj_float
4975 def d_doffaxis(self) -> carmaWrap.obj_float:
4979 :type: carmaWrap.obj_float
4982 def d_ftbeam(self) -> carmaWrap.obj_float_complex:
4986 :type: carmaWrap.obj_float_complex
4989 def d_ftlgskern(self) -> carmaWrap.obj_float_complex:
4993 :type: carmaWrap.obj_float_complex
4996 def d_lgskern(self) -> carmaWrap.obj_float:
5000 :type: carmaWrap.obj_float
5003 def d_prof1d(self) -> carmaWrap.obj_float:
5007 :type: carmaWrap.obj_float
5010 def d_prof2d(self) -> carmaWrap.obj_float_complex:
5014 :type: carmaWrap.obj_float_complex
5017 def d_profcum(self) -> carmaWrap.obj_float:
5021 :type: carmaWrap.obj_float
5024 def deltah(self) -> float:
5038 def h0(self) -> float:
5045 def hg(self) -> float:
5052 def nmaxhr(self) -> int:
5059 def npix(self) -> int:
5066 def nprof(self) -> int:
5073 def nvalid(self) -> int:
5080 def pixsize(self) -> float:
5082 Pixel size on sky[arcsec]
5088 def comp_image(self, noise: bool =
True) -> int:
5090 Computes the WFS image from the WFS phase
5093 noise: (bool): take noise into account or not
5095 def fill_binimage(self, arg0: int) -> int:
5097 Fill d_binimg from d_bincube
5099 def set_binimg(self, binimg: numpy.ndarray[numpy.float32], nElem: int) -> int:
5101 Set the binimg of the SH WFS
5104 binimg: (np.array[ndim=3, dtype=np.float32]) : cube of subap. images
5106 nElem: (int): Number of elements in binimg
5109 def set_dark(self, dark: numpy.ndarray[numpy.float32], nElem: int) -> int:
5111 Set the dark of the SH WFS
5114 dark: (np.array[ndim=2, dtype=np.float32]) : dark image
5116 nElem: (int): Number of elements in dark
5119 def set_fakecam(self, fakecam: bool) -> int:
5121 Enable or disable uint16 computation for the WFS
5124 fakecam: (bool): fakecam flag
5127 def set_flat(self, flat: numpy.ndarray[numpy.float32], nElem: int) -> int:
5129 Set the flat of the SH WFS
5132 flat: (np.array[ndim=2, dtype=np.float32]) : flat image
5134 nElem: (int): Number of elements in flat
5137 def set_max_flux_per_pix(self, max_flux_per_pix: int) -> int:
5139 Set the maximum number of photons allowed before pixel saturation
5142 max_flux_per_pix: (int): maximum number of photons allowed before pixel saturation
5145 def set_max_pix_value(self, max_pix_value: int) -> int:
5147 Set the maximum number of ADU allowed in the uint16 image
5150 max_pix_value: (int): maximum number of ADU allowed in the uint16 image
5153 def set_noise(self, noise: float, seed: int) -> int:
5155 Set the noise of the WFS
5158 noise: (float): desired noise (< 0 = no noise
5160 > 0 = photon + ron in e-)
5161 seed: (int): seed for the RNG
5164 def set_pupil(self, pupil: numpy.ndarray[numpy.float32]) ->
None:
5166 Set the pupil seen by the WFS
5169 pupil: (np.array(ndim=2,dtype=np.float32)): pupil to set
5172 def slopes_geom(self, type: int = 0) -> int:
5174 Computes theoretical slopes in wfs.d_slopes
5177 type: (int): method to use (0: reduce, 1: derive)
5181 Computes theoretical slopes in given array
5184 slopes: (np.array(ndim=1, dtype=np.float32)):
5186 type: (int): method to use (0: reduce, 1: derive)
5189 def slopes_geom(self, slopes: numpy.ndarray[numpy.float32], type: int = 0) -> int: ...
5191 def d_bincube(self) -> carmaWrap.obj_float:
5193 WFS spots as a 3D array
5195 :type: carmaWrap.obj_float
5198 def d_binimg(self) -> carmaWrap.obj_float:
5202 :type: carmaWrap.obj_float
5205 def d_binimg_notnoisy(self) -> carmaWrap.obj_float:
5207 WFS image without noise (ROKET only)
5209 :type: carmaWrap.obj_float
5212 def d_camimg(self) -> carmaWrap.obj_uint16:
5216 :type: carmaWrap.obj_uint16
5219 def d_camplifoc(self) -> carmaWrap.obj_float_complex:
5221 Complex amplitude in the focal plane
5223 :type: carmaWrap.obj_float_complex
5226 def d_camplipup(self) -> carmaWrap.obj_float_complex:
5228 Complex amplitude in the pupil
5230 :type: carmaWrap.obj_float_complex
5233 def d_dark(self) -> carmaWrap.obj_float:
5237 :type: carmaWrap.obj_float
5240 def d_flat(self) -> carmaWrap.obj_float:
5244 :type: carmaWrap.obj_float
5247 def d_fluxPerSub(self) -> carmaWrap.obj_float:
5249 Normalized flux per ssp
5251 :type: carmaWrap.obj_float
5254 def d_fttotim(self) -> carmaWrap.obj_float_complex:
5256 Buffer for FFT computation
5258 :type: carmaWrap.obj_float_complex
5261 def d_gs(self) -> Source:
5263 WGS GS (SutraSource object)
5268 def d_hrmap(self) -> carmaWrap.obj_int:
5272 :type: carmaWrap.obj_int
5275 def d_intensities(self) -> carmaWrap.obj_float:
5277 Sum of intensities in each ssp
5279 :type: carmaWrap.obj_float
5282 def d_offsets(self) -> carmaWrap.obj_float:
5286 :type: carmaWrap.obj_float
5289 def d_phasemap(self) -> carmaWrap.obj_int:
5293 :type: carmaWrap.obj_int
5296 def d_pupil(self) -> carmaWrap.obj_float:
5300 :type: carmaWrap.obj_float
5303 def d_sincar(self) -> carmaWrap.obj_float:
5307 :type: carmaWrap.obj_float
5310 def d_slopes(self) -> carmaWrap.obj_float:
5314 :type: carmaWrap.obj_float
5317 def d_submask(self) -> carmaWrap.obj_float:
5321 :type: carmaWrap.obj_float
5324 def d_ttprojmat(self) -> carmaWrap.obj_float:
5326 TT projection matrix from subap phase to slopes (geom wfs type 2)
5328 :type: carmaWrap.obj_float
5331 def d_ttprojvec(self) -> carmaWrap.obj_float:
5333 Input vector for TT projection from subap phase to slopes (geom wfs type 2)
5335 :type: carmaWrap.obj_float
5338 def d_validsubsx(self) -> carmaWrap.obj_int:
5340 X-position of valid ssp
5342 :type: carmaWrap.obj_int
5345 def d_validsubsy(self) -> carmaWrap.obj_int:
5347 Y-position of valid ssp
5349 :type: carmaWrap.obj_int
5359 def fakecam(self) -> bool:
5361 Flag for uint16 image
5366 def is_low_order(self) -> bool:
5368 Flag for low order WFS
5373 def kernconv(self) -> bool:
5375 Convolution kernel for spot computation
5380 def lgs(self) -> bool:
5382 Is the WFS a LGS one ?
5387 def max_flux_per_pix(self) -> int:
5389 Maximum number of photons allowed before pixel saturation
5394 def max_pix_value(self) -> int:
5396 Maximum number of ADU allowed in the uint16 image
5401 def nfft(self) -> int:
5408 def nffthr(self) -> int:
5415 def nmaxhr(self) -> int:
5422 def noise(self) -> float:
5429 def nphase(self) -> int:
5431 Number of phase point per ssp
5436 def nphot(self) -> float:
5438 Number of photons/ssp/iter
5443 def nphot4imat(self) -> float:
5445 Number of photons/ssp/iter used for imat computation
5450 def npix(self) -> int:
5457 def npup(self) -> int:
5464 def nrebin(self) -> int:
5471 def ntot(self) -> int:
5478 def nvalid(self) -> int:
5485 def nxsub(self) -> int:
5487 Number of ssp in the diameter
5492 def roket(self) -> bool:
5494 Is the WFS a LGS one ?
5499 def subapd(self) -> float:
5501 ssp diameter in pixels
5506 def type(self) -> str:
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:
5516 Instantiates a PerfectCoronagraph object
5519 context: (CarmaContext): context
5521 d_source: (SutraSource): Coronagraph source input
5523 im_dimx: (int): Coronagraphic image dimension along x axis
5525 im_dimy: (int): Coronagraphic image dimension along y axis
5527 wavelength: (np.ndarray[ndim=1, dtype=np.float32]): vector of wavelengths
5529 nWavelength: (int): number of wavelength
5531 device: (int): GPU device index
5533 def set_mft(self, A: numpy.ndarray[numpy.complex64], B: numpy.ndarray[numpy.complex64], norm: numpy.ndarray[numpy.float32], mft_type: str) -> int:
5535 Set MFT matrices for coronagraphic image computation
5538 A : (np.ndarray[dtype=np.complex32, ndims=3]): A MFT matrix for each wavelength
5540 B : (np.ndarray[dtype=np.complex32, ndims=3]): B MFT matrix for each wavelength
5542 norm : (np.ndarray[dtype=np.complex32, ndims=3]): MFT normalization for each wavelength
5544 mft_type : (str): MFT matrices to set, i.e. "img" or "psf"
5547 def AA(self) -> typing.Dict[str, typing.List[carmaWrap.obj_float_complex]]:
5551 :type: typing.Dict[str, typing.List[carmaWrap.obj_float_complex]]
5554 def BB(self) -> typing.Dict[str, typing.List[carmaWrap.obj_float_complex]]:
5558 :type: typing.Dict[str, typing.List[carmaWrap.obj_float_complex]]
5561 def norm(self) -> typing.Dict[str, typing.List[float]]:
5565 :type: typing.Dict[str, typing.List[float]]
5571 Initialize a void rtc object
5574 def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str, wfs: Wfs) -> int:
5576 Add a SutraCentroider object in the RTC
5579 context: (CarmaContext): carma context
5581 nvalid:(int): Number of WFS valid ssp
5583 offset: (float): offset for centroiding computation
5585 scale: (float): scale factor to get the right unit, ie. arcsec
5587 filt_TT: (bool): flag to control TT filtering
5589 device: (int): GPU device index
5591 typec: (str): Centroider type
5593 wfs: (SutraWfs): SutraWfs handled by the centroider
5598 Add a SutraCentroider object in the RTC
5601 context: (CarmaContext): carma context
5603 nvalid:(int): Number of WFS valid ssp
5605 offset: (float): offset for centroiding computation
5607 scale: (float): scale factor to get the right unit, ie. arcsec
5609 filt_TT: (bool): flag to control TT filtering
5611 device: (int): GPU device index
5613 typec: (str): Centroider type
5616 def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str) -> int: ...
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:
5620 Add a SutraController object in the RTC
5623 context: (CarmaContext): carma context
5625 typec: (str): Controller type
5627 device: (int): GPU device index
5629 delay: (float): Loop delay [frames]
5631 nslope: (int): Number of slopes
5633 nactu:(int): Number of actuators to command
5637 nslope_buffers: (int) : Number of historic slopes vectors to use
5639 nstates : (int) : Number of states in state vector
5641 nstate_buffers: (int) : Number of historic state vectors to use
5643 nmodes : (int) : Number of modes in mode vector
5645 niir_in : (int) : Number of input mode vectors for iir filter
5647 niir_out : (int) : Number of output mode vectors for iir filter
5649 polc : (bool) : Activate the Pseudo Open Loop Control if available
5651 is_modal : (bool) : Activate projection from modes to actu if available
5653 dms : (SutraDms) : SutraDms object
5655 idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
5657 ndm : (int) : Number of DM to command
5659 idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
5661 ncentro : (int) : Number of centroiders handled
5663 Nphi : (int) : umber of pixels in the pupil
5665 wfs_direction : (bool) : Flag for ROKET
5670 Add a SutraController object in the RTC
5673 context: (CarmaContext): carma context
5675 typec: (str): Controller type
5677 device: (int): GPU device index
5679 delay: (float): Loop delay [frames]
5681 nslope: (int): Number of slopes
5683 nactu:(int): Number of actuators to command
5686 nslope_buffers: (int) : Number of historic slopes vectors to use
5688 nstates : (int) : Number of states in state vector
5690 nstate_buffers: (int) : Number of historic state vectors to use
5692 nmodes : (int) : Number of modes in mode vector
5694 niir_in : (int) : Number of input mode vectors for iir filter
5696 niir_out : (int) : Number of output mode vectors for iir filter
5698 polc : (bool) : Activate the Pseudo Open Loop Control if available
5700 is_modal : (bool) : Activate projection from modes to actu if available
5702 dms : (SutraDms) : SutraDms object
5704 idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
5706 ndm : (int) : Number of DM to command
5708 idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
5710 ncentro : (int) : Number of centroiders handled
5712 Nphi : (int) : umber of pixels in the pupil
5714 wfs_direction : (bool) : Flag for ROKET
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:
5722 Apply the commands on the DM and shape it
5725 ncontrol: (int): Index of the controller
5727 compVoltage: (bool): if True (default), computes delay and perturb voltages. Else, applies just the vector command
5729 def build_cmat(self, ncontrol: int, nfilt: int, filt_tt: bool =
False) ->
None:
5734 ncontrol : (int): controller index
5736 nfilt: (int): number of modes to filter
5738 filt_tt: (bool): Flag for TT filter
5740 def comp_voltage(self, ncontrol: int) -> int:
5742 Compute the commands on the DM
5745 ncontrol: (int): Index of the controller
5747 def do_calibrate_img(self, ncontrol: int) -> int:
5749 Computes the calibrated image
5752 ncontrol: (int): Index of the controller
5754 def do_centroids(self, ncontrol: int) -> int:
5756 Computes the centroids
5759 ncontrol: (int): Index of the controller
5761 def do_centroids_geom(self, ncontrol: int, type: int = 0) -> int:
5763 Computes the centroids geom
5766 ncontrol: (int): Index of the controller
5767 type: (int): Centroiding method of geom wfs
5769 def do_centroids_ref(self, ncontrol: int) -> int:
5771 Computes the centroids ref
5774 ncontrol: (int): Index of the controller
5776 def do_clipping(self, ncontrol: int) -> int:
5778 Clip the command to apply on the DMs on a SutraController object
5781 ncontrol: (int) : controller index
5783 def do_control(self, ncontrol: int) -> int:
5785 Computes the commands
5788 ncontrol: (int): Index of the controller
5790 def do_imat(self, ncontrol: int, dms: Dms, kernconv: int) -> int:
5792 Computes interaction matrix
5795 ncontrol: (int): Index of the controller
5797 dms: (SutraDms): SutraDms object
5799 kernconv : (bool) : Flag for WFS spot convolution
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:
5803 Computes a modal interaction matrix
5806 ncontrol: (int): Index of the controller
5808 dms: (SutraDms): SutraDms object
5810 nModes: (int): number of modes in the basis
5812 m2v: (np.array[ndim=2,dtype=np.float32]): modeToActu matrix
5814 pushAmpl: (np.array[ndim=1,dtype=np.float32]): pushpull strength in mode units
5816 kernconv : (bool) : Flag for WFS spot convolution
5819 def imat_svd(self, ncontrol: int) ->
None:
5824 ncontrol : (int): controller index
5826 def remove_centroider(self, ncentro: int) -> int:
5828 Remove the specified centroider from the RTC
5831 ncentro : (int): index of the centroider to remove
5833 def remove_controller(self, ncontrol: int) -> int:
5835 Remove the specified controller from the RTC
5838 ncontrol : (int): index of the controller to remove
5840 def set_centroids_ref(self, centroidsRef: numpy.ndarray[numpy.float32]) -> int:
5842 Set the reference centroids
5845 centroids_ref : (np.array(ndim=1, dtype=np.float32)): ref centroids
5847 def set_gain(self, ncontrol: int, gain: float) ->
None:
5849 Set the loop gain in the controller
5852 ncontrol: (int): controller index
5854 gain: (float): gain to set
5856 def set_modal_gains(self, ncontrol: int, mgain: numpy.ndarray[numpy.float32]) ->
None:
5858 Set the modal gain in the controller
5861 ncontrol: (int): controller index
5863 mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
5866 def d_centro(self) -> typing.List[Centroider_FF]:
5868 Vector of centroiders
5870 :type: typing.List[Centroider_FF]
5873 def d_control(self) -> typing.List[Controller_FF]:
5875 Vector of controllers
5877 :type: typing.List[Controller_FF]
5881 def __init__(self) -> None:
5883 Initialize a void rtc object
5886 def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str, wfs: Wfs) -> int:
5888 Add a SutraCentroider object in the RTC
5891 context: (CarmaContext): carma context
5893 nvalid:(int): Number of WFS valid ssp
5895 offset: (float): offset for centroiding computation
5897 scale: (float): scale factor to get the right unit, ie. arcsec
5899 filt_TT: (bool): flag to control TT filtering
5901 device: (int): GPU device index
5903 typec: (str): Centroider type
5905 wfs: (SutraWfs): SutraWfs handled by the centroider
5910 Add a SutraCentroider object in the RTC
5913 context: (CarmaContext): carma context
5915 nvalid:(int): Number of WFS valid ssp
5917 offset: (float): offset for centroiding computation
5919 scale: (float): scale factor to get the right unit, ie. arcsec
5921 filt_TT: (bool): flag to control TT filtering
5923 device: (int): GPU device index
5925 typec: (str): Centroider type
5928 def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str) -> int: ...
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:
5932 Add a SutraController object in the RTC
5935 context: (CarmaContext): carma context
5937 typec: (str): Controller type
5939 device: (int): GPU device index
5941 delay: (float): Loop delay [frames]
5943 nslope: (int): Number of slopes
5945 nactu:(int): Number of actuators to command
5949 nslope_buffers: (int) : Number of historic slopes vectors to use
5951 nstates : (int) : Number of states in state vector
5953 nstate_buffers: (int) : Number of historic state vectors to use
5955 nmodes : (int) : Number of modes in mode vector
5957 niir_in : (int) : Number of input mode vectors for iir filter
5959 niir_out : (int) : Number of output mode vectors for iir filter
5961 polc : (bool) : Activate the Pseudo Open Loop Control if available
5963 is_modal : (bool) : Activate projection from modes to actu if available
5965 dms : (SutraDms) : SutraDms object
5967 idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
5969 ndm : (int) : Number of DM to command
5971 idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
5973 ncentro : (int) : Number of centroiders handled
5975 Nphi : (int) : umber of pixels in the pupil
5977 wfs_direction : (bool) : Flag for ROKET
5982 Add a SutraController object in the RTC
5985 context: (CarmaContext): carma context
5987 typec: (str): Controller type
5989 device: (int): GPU device index
5991 delay: (float): Loop delay [frames]
5993 nslope: (int): Number of slopes
5995 nactu:(int): Number of actuators to command
5998 nslope_buffers: (int) : Number of historic slopes vectors to use
6000 nstates : (int) : Number of states in state vector
6002 nstate_buffers: (int) : Number of historic state vectors to use
6004 nmodes : (int) : Number of modes in mode vector
6006 niir_in : (int) : Number of input mode vectors for iir filter
6008 niir_out : (int) : Number of output mode vectors for iir filter
6010 polc : (bool) : Activate the Pseudo Open Loop Control if available
6012 is_modal : (bool) : Activate projection from modes to actu if available
6014 dms : (SutraDms) : SutraDms object
6016 idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6018 ndm : (int) : Number of DM to command
6020 idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6022 ncentro : (int) : Number of centroiders handled
6024 Nphi : (int) : umber of pixels in the pupil
6026 wfs_direction : (bool) : Flag for ROKET
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:
6034 Apply the commands on the DM and shape it
6037 ncontrol: (int): Index of the controller
6039 compVoltage: (bool): if True (default), computes delay and perturb voltages. Else, applies just the vector command
6041 def build_cmat(self, ncontrol: int, nfilt: int, filt_tt: bool =
False) ->
None:
6046 ncontrol : (int): controller index
6048 nfilt: (int): number of modes to filter
6050 filt_tt: (bool): Flag for TT filter
6052 def comp_voltage(self, ncontrol: int) -> int:
6054 Compute the commands on the DM
6057 ncontrol: (int): Index of the controller
6059 def do_calibrate_img(self, ncontrol: int) -> int:
6061 Computes the calibrated image
6064 ncontrol: (int): Index of the controller
6066 def do_centroids(self, ncontrol: int) -> int:
6068 Computes the centroids
6071 ncontrol: (int): Index of the controller
6073 def do_centroids_geom(self, ncontrol: int, type: int = 0) -> int:
6075 Computes the centroids geom
6078 ncontrol: (int): Index of the controller
6079 type: (int): Centroiding method of geom wfs
6081 def do_centroids_ref(self, ncontrol: int) -> int:
6083 Computes the centroids ref
6086 ncontrol: (int): Index of the controller
6088 def do_clipping(self, ncontrol: int) -> int:
6090 Clip the command to apply on the DMs on a SutraController object
6093 ncontrol: (int) : controller index
6095 def do_control(self, ncontrol: int) -> int:
6097 Computes the commands
6100 ncontrol: (int): Index of the controller
6102 def do_imat(self, ncontrol: int, dms: Dms, kernconv: int) -> int:
6104 Computes interaction matrix
6107 ncontrol: (int): Index of the controller
6109 dms: (SutraDms): SutraDms object
6111 kernconv : (bool) : Flag for WFS spot convolution
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:
6115 Computes a modal interaction matrix
6118 ncontrol: (int): Index of the controller
6120 dms: (SutraDms): SutraDms object
6122 nModes: (int): number of modes in the basis
6124 m2v: (np.array[ndim=2,dtype=np.float32]): modeToActu matrix
6126 pushAmpl: (np.array[ndim=1,dtype=np.float32]): pushpull strength in mode units
6128 kernconv : (bool) : Flag for WFS spot convolution
6131 def imat_svd(self, ncontrol: int) ->
None:
6136 ncontrol : (int): controller index
6138 def remove_centroider(self, ncentro: int) -> int:
6140 Remove the specified centroider from the RTC
6143 ncentro : (int): index of the centroider to remove
6145 def remove_controller(self, ncontrol: int) -> int:
6147 Remove the specified controller from the RTC
6150 ncontrol : (int): index of the controller to remove
6152 def set_centroids_ref(self, centroidsRef: numpy.ndarray[numpy.float32]) -> int:
6154 Set the reference centroids
6157 centroids_ref : (np.array(ndim=1, dtype=np.float32)): ref centroids
6159 def set_gain(self, ncontrol: int, gain: float) ->
None:
6161 Set the loop gain in the controller
6164 ncontrol: (int): controller index
6166 gain: (float): gain to set
6168 def set_modal_gains(self, ncontrol: int, mgain: numpy.ndarray[numpy.float32]) ->
None:
6170 Set the modal gain in the controller
6173 ncontrol: (int): controller index
6175 mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
6178 def d_centro(self) -> typing.List[Centroider_FF]:
6180 Vector of centroiders
6182 :type: typing.List[Centroider_FF]
6185 def d_control(self) -> typing.List[Controller_FU]:
6187 Vector of controllers
6189 :type: typing.List[Controller_FU]
6193 def __init__(self) -> None:
6195 Initialize a void rtc object
6198 def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str, wfs: Wfs) -> int:
6200 Add a SutraCentroider object in the RTC
6203 context: (CarmaContext): carma context
6205 nvalid:(int): Number of WFS valid ssp
6207 offset: (float): offset for centroiding computation
6209 scale: (float): scale factor to get the right unit, ie. arcsec
6211 filt_TT: (bool): flag to control TT filtering
6213 device: (int): GPU device index
6215 typec: (str): Centroider type
6217 wfs: (SutraWfs): SutraWfs handled by the centroider
6222 Add a SutraCentroider object in the RTC
6225 context: (CarmaContext): carma context
6227 nvalid:(int): Number of WFS valid ssp
6229 offset: (float): offset for centroiding computation
6231 scale: (float): scale factor to get the right unit, ie. arcsec
6233 filt_TT: (bool): flag to control TT filtering
6235 device: (int): GPU device index
6237 typec: (str): Centroider type
6240 def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str) -> int: ...
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:
6244 Add a SutraController object in the RTC
6247 context: (CarmaContext): carma context
6249 typec: (str): Controller type
6251 device: (int): GPU device index
6253 delay: (float): Loop delay [frames]
6255 nslope: (int): Number of slopes
6257 nactu:(int): Number of actuators to command
6261 nslope_buffers: (int) : Number of historic slopes vectors to use
6263 nstates : (int) : Number of states in state vector
6265 nstate_buffers: (int) : Number of historic state vectors to use
6267 nmodes : (int) : Number of modes in mode vector
6269 niir_in : (int) : Number of input mode vectors for iir filter
6271 niir_out : (int) : Number of output mode vectors for iir filter
6273 polc : (bool) : Activate the Pseudo Open Loop Control if available
6275 is_modal : (bool) : Activate projection from modes to actu if available
6277 dms : (SutraDms) : SutraDms object
6279 idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
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
6285 ncentro : (int) : Number of centroiders handled
6287 Nphi : (int) : umber of pixels in the pupil
6289 wfs_direction : (bool) : Flag for ROKET
6294 Add a SutraController object in the RTC
6297 context: (CarmaContext): carma context
6299 typec: (str): Controller type
6301 device: (int): GPU device index
6303 delay: (float): Loop delay [frames]
6305 nslope: (int): Number of slopes
6307 nactu:(int): Number of actuators to command
6310 nslope_buffers: (int) : Number of historic slopes vectors to use
6312 nstates : (int) : Number of states in state vector
6314 nstate_buffers: (int) : Number of historic state vectors to use
6316 nmodes : (int) : Number of modes in mode vector
6318 niir_in : (int) : Number of input mode vectors for iir filter
6320 niir_out : (int) : Number of output mode vectors for iir filter
6322 polc : (bool) : Activate the Pseudo Open Loop Control if available
6324 is_modal : (bool) : Activate projection from modes to actu if available
6326 dms : (SutraDms) : SutraDms object
6328 idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6330 ndm : (int) : Number of DM to command
6332 idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6334 ncentro : (int) : Number of centroiders handled
6336 Nphi : (int) : umber of pixels in the pupil
6338 wfs_direction : (bool) : Flag for ROKET
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:
6346 Apply the commands on the DM and shape it
6349 ncontrol: (int): Index of the controller
6351 compVoltage: (bool): if True (default), computes delay and perturb voltages. Else, applies just the vector command
6353 def build_cmat(self, ncontrol: int, nfilt: int, filt_tt: bool =
False) ->
None:
6358 ncontrol : (int): controller index
6360 nfilt: (int): number of modes to filter
6362 filt_tt: (bool): Flag for TT filter
6364 def comp_voltage(self, ncontrol: int) -> int:
6366 Compute the commands on the DM
6369 ncontrol: (int): Index of the controller
6371 def do_calibrate_img(self, ncontrol: int) -> int:
6373 Computes the calibrated image
6376 ncontrol: (int): Index of the controller
6378 def do_centroids(self, ncontrol: int) -> int:
6380 Computes the centroids
6383 ncontrol: (int): Index of the controller
6385 def do_centroids_geom(self, ncontrol: int, type: int = 0) -> int:
6387 Computes the centroids geom
6390 ncontrol: (int): Index of the controller
6391 type: (int): Centroiding method of geom wfs
6393 def do_centroids_ref(self, ncontrol: int) -> int:
6395 Computes the centroids ref
6398 ncontrol: (int): Index of the controller
6400 def do_clipping(self, ncontrol: int) -> int:
6402 Clip the command to apply on the DMs on a SutraController object
6405 ncontrol: (int) : controller index
6407 def do_control(self, ncontrol: int) -> int:
6409 Computes the commands
6412 ncontrol: (int): Index of the controller
6414 def do_imat(self, ncontrol: int, dms: Dms, kernconv: int) -> int:
6416 Computes interaction matrix
6419 ncontrol: (int): Index of the controller
6421 dms: (SutraDms): SutraDms object
6423 kernconv : (bool) : Flag for WFS spot convolution
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:
6427 Computes a modal interaction matrix
6430 ncontrol: (int): Index of the controller
6432 dms: (SutraDms): SutraDms object
6434 nModes: (int): number of modes in the basis
6436 m2v: (np.array[ndim=2,dtype=np.float32]): modeToActu matrix
6438 pushAmpl: (np.array[ndim=1,dtype=np.float32]): pushpull strength in mode units
6440 kernconv : (bool) : Flag for WFS spot convolution
6443 def imat_svd(self, ncontrol: int) ->
None:
6448 ncontrol : (int): controller index
6450 def remove_centroider(self, ncentro: int) -> int:
6452 Remove the specified centroider from the RTC
6455 ncentro : (int): index of the centroider to remove
6457 def remove_controller(self, ncontrol: int) -> int:
6459 Remove the specified controller from the RTC
6462 ncontrol : (int): index of the controller to remove
6464 def set_centroids_ref(self, centroidsRef: numpy.ndarray[numpy.float32]) -> int:
6466 Set the reference centroids
6469 centroids_ref : (np.array(ndim=1, dtype=np.float32)): ref centroids
6471 def set_gain(self, ncontrol: int, gain: float) ->
None:
6473 Set the loop gain in the controller
6476 ncontrol: (int): controller index
6478 gain: (float): gain to set
6480 def set_modal_gains(self, ncontrol: int, mgain: numpy.ndarray[numpy.float32]) ->
None:
6482 Set the modal gain in the controller
6485 ncontrol: (int): controller index
6487 mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
6490 def d_centro(self) -> typing.List[Centroider_UF]:
6492 Vector of centroiders
6494 :type: typing.List[Centroider_UF]
6497 def d_control(self) -> typing.List[Controller_FF]:
6499 Vector of controllers
6501 :type: typing.List[Controller_FF]
6507 Initialize a void rtc object
6510 def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str, wfs: Wfs) -> int:
6512 Add a SutraCentroider object in the RTC
6515 context: (CarmaContext): carma context
6517 nvalid:(int): Number of WFS valid ssp
6519 offset: (float): offset for centroiding computation
6521 scale: (float): scale factor to get the right unit, ie. arcsec
6523 filt_TT: (bool): flag to control TT filtering
6525 device: (int): GPU device index
6527 typec: (str): Centroider type
6529 wfs: (SutraWfs): SutraWfs handled by the centroider
6534 Add a SutraCentroider object in the RTC
6537 context: (CarmaContext): carma context
6539 nvalid:(int): Number of WFS valid ssp
6541 offset: (float): offset for centroiding computation
6543 scale: (float): scale factor to get the right unit, ie. arcsec
6545 filt_TT: (bool): flag to control TT filtering
6547 device: (int): GPU device index
6549 typec: (str): Centroider type
6552 def add_centroider(self, context: carmaWrap.context, nvalid: int, offset: float, scale: float, filter_TT: bool, device: int, typec: str) -> int: ...
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:
6556 Add a SutraController object in the RTC
6559 context: (CarmaContext): carma context
6561 typec: (str): Controller type
6563 device: (int): GPU device index
6565 delay: (float): Loop delay [frames]
6567 nslope: (int): Number of slopes
6569 nactu:(int): Number of actuators to command
6573 nslope_buffers: (int) : Number of historic slopes vectors to use
6575 nstates : (int) : Number of states in state vector
6577 nstate_buffers: (int) : Number of historic state vectors to use
6579 nmodes : (int) : Number of modes in mode vector
6581 niir_in : (int) : Number of input mode vectors for iir filter
6583 niir_out : (int) : Number of output mode vectors for iir filter
6585 polc : (bool) : Activate the Pseudo Open Loop Control if available
6587 is_modal : (bool) : Activate projection from modes to actu if available
6589 dms : (SutraDms) : SutraDms object
6591 idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6593 ndm : (int) : Number of DM to command
6595 idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6597 ncentro : (int) : Number of centroiders handled
6599 Nphi : (int) : umber of pixels in the pupil
6601 wfs_direction : (bool) : Flag for ROKET
6606 Add a SutraController object in the RTC
6609 context: (CarmaContext): carma context
6611 typec: (str): Controller type
6613 device: (int): GPU device index
6615 delay: (float): Loop delay [frames]
6617 nslope: (int): Number of slopes
6619 nactu:(int): Number of actuators to command
6622 nslope_buffers: (int) : Number of historic slopes vectors to use
6624 nstates : (int) : Number of states in state vector
6626 nstate_buffers: (int) : Number of historic state vectors to use
6628 nmodes : (int) : Number of modes in mode vector
6630 niir_in : (int) : Number of input mode vectors for iir filter
6632 niir_out : (int) : Number of output mode vectors for iir filter
6634 polc : (bool) : Activate the Pseudo Open Loop Control if available
6636 is_modal : (bool) : Activate projection from modes to actu if available
6638 dms : (SutraDms) : SutraDms object
6640 idx_dms : (np.array[ndim=1,dtype=np.int64]) : index of DM in SutraDms to command
6642 ndm : (int) : Number of DM to command
6644 idx_centro : (np.array[ndim=1,dtype=np.int64]): (optional) Index of centoiders in sutra_rtc.d_centro to handle
6646 ncentro : (int) : Number of centroiders handled
6648 Nphi : (int) : umber of pixels in the pupil
6650 wfs_direction : (bool) : Flag for ROKET
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:
6658 Apply the commands on the DM and shape it
6661 ncontrol: (int): Index of the controller
6663 compVoltage: (bool): if True (default), computes delay and perturb voltages. Else, applies just the vector command
6665 def build_cmat(self, ncontrol: int, nfilt: int, filt_tt: bool =
False) ->
None:
6670 ncontrol : (int): controller index
6672 nfilt: (int): number of modes to filter
6674 filt_tt: (bool): Flag for TT filter
6678 Compute the commands on the DM
6681 ncontrol: (int): Index of the controller
6685 Computes the calibrated image
6688 ncontrol: (int): Index of the controller
6692 Computes the centroids
6695 ncontrol: (int): Index of the controller
6699 Computes the centroids geom
6702 ncontrol: (int): Index of the controller
6703 type: (int): Centroiding method of geom wfs
6707 Computes the centroids ref
6710 ncontrol: (int): Index of the controller
6714 Clip the command to apply on the DMs on a SutraController object
6717 ncontrol: (int) : controller index
6721 Computes the commands
6724 ncontrol: (int): Index of the controller
6726 def do_imat(self, ncontrol: int, dms: Dms, kernconv: int) -> int:
6728 Computes interaction matrix
6731 ncontrol: (int): Index of the controller
6733 dms: (SutraDms): SutraDms object
6735 kernconv : (bool) : Flag for WFS spot convolution
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:
6739 Computes a modal interaction matrix
6742 ncontrol: (int): Index of the controller
6744 dms: (SutraDms): SutraDms object
6746 nModes: (int): number of modes in the basis
6748 m2v: (np.array[ndim=2,dtype=np.float32]): modeToActu matrix
6750 pushAmpl: (np.array[ndim=1,dtype=np.float32]): pushpull strength in mode units
6752 kernconv : (bool) : Flag for WFS spot convolution
6755 def imat_svd(self, ncontrol: int) ->
None:
6760 ncontrol : (int): controller index
6764 Remove the specified centroider from the RTC
6767 ncentro : (int): index of the centroider to remove
6771 Remove the specified controller from the RTC
6774 ncontrol : (int): index of the controller to remove
6778 Set the reference centroids
6781 centroids_ref : (np.array(ndim=1, dtype=np.float32)): ref centroids
6783 def set_gain(self, ncontrol: int, gain: float) ->
None:
6785 Set the loop gain in the controller
6788 ncontrol: (int): controller index
6790 gain: (float): gain to set
6792 def set_modal_gains(self, ncontrol: int, mgain: numpy.ndarray[numpy.float32]) ->
None:
6794 Set the modal gain in the controller
6797 ncontrol: (int): controller index
6799 mgain: (np.array[ndim=1,dtype=np.float32]): modal gains to set
6802 def d_centro(self) -> typing.List[Centroider_UF]:
6804 Vector of centroiders
6806 :type: typing.List[Centroider_UF]
6809 def d_control(self) -> typing.List[Controller_FU]:
6811 Vector of controllers
6813 :type: typing.List[Controller_FU]
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:
6819 Compute the currect number of photons for a given system
6822 ittime: (float): 1/loop frequency [s].
6824 optthroughput: (float): wfs global throughput.
6826 diam: (float): telescope diameter.
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.
6832 gsmag: (float): (optional for LGS) magnitude of guide star.
6834 lgsreturnperwatt: (float): (optional for NGS) return per watt factor (high season : 10 ph/cm2/s/W).
6836 laserpower: (float): (optional for NGS) laser power in W.
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:
6843 phasemap: TODO: docstring
6851 fluxPerSub: (np.array[ndim=2,dtype=np.float32]): Normalized flux per ssp
6853 validsubsx: (np.array[ndim=1, dtype=np.int64]): X position of each valid ssp
6855 validsubsy: (np.array[ndim=1, dtype=np.int64]): Y position of each valid ssp
6861 ttprojmat: (np.array[ndim=2, dtype=np.float32]): slope projection matrix
6866 def set_bincube(self, bincube: numpy.ndarray[numpy.float32], nElem: int) -> int:
6868 Set the bincube of the SH WFS
6871 bincube: (np.array[ndim=3, dtype=np.float32]) : cube of subap. images
6873 nElem: (int): Number of elements in bincube
6877 def d_binmap(self) -> carmaWrap.obj_int:
6881 :type: carmaWrap.obj_int
6884 def d_fsamplifoc(self) -> carmaWrap.obj_float_complex:
6886 Focal plane with field stop
6888 :type: carmaWrap.obj_float_complex
6891 def d_fsamplipup(self) -> carmaWrap.obj_float_complex:
6893 Complex amplitude in the pupil in the field stop array size
6895 :type: carmaWrap.obj_float_complex
6898 def d_validpuppixx(self) -> carmaWrap.obj_int:
6900 X position of the bottom left corner of each ssp
6902 :type: carmaWrap.obj_int
6905 def d_validpuppixy(self) -> carmaWrap.obj_int:
6907 Y position of the bottom left corner of each ssp
6909 :type: carmaWrap.obj_int
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:
6915 Create and initialise a sensors object
6918 context: (CarmaContext) : current carma context
6920 d_tel: (SutraTelescope) : SutraTelescope object
6922 type: (list of string): WFS types
6924 nwfs: (int) : number of WFS
6926 nxsub: (np.ndarray[ndim=1, dtype=np.int64]) : number of ssp in the diameter for each WFS
6928 nvalid: (np.ndarray[ndim=1, dtype=np.int64]) : number of valid ssp for each WFS
6930 npupils: (np.ndarray[ndim=1, dtype=np.int64]) : number of pupil images for each WFS
6932 npix: (np.ndarray[ndim=1,dtype=np.int64]) : number of pix per ssp for each WFS
6934 nphase: (np.ndarray[ndim=1,dtype=np.int64]) : number of phase points per ssp for each WFS
6936 nrebin: (np.ndarray[ndim=1,dtype=np.int64]) : rebin factor for each WFS
6938 nfft: (np.ndarray[ndim=1,dtype=np.int64]) : FFT support size for each WFS
6940 ntot: (np.ndarray[ndim=1,dtype=np.int64]) : HR support size for each WFS
6942 npup: (np.ndarray[ndim=1,dtype=np.int64]) : Pupil support size for each WFS
6944 pdiam: (np.ndarray[ndim=1,dtype=np.float32]) : ssp diameter in pixels for each WFS
6946 nphot: (np.ndarray[ndim=1,dtype=np.float32]) : photons per subap per iter for each WFS
6948 nphot4imat: (np.ndarray[ndim=1,dtype=np.float32]) : photons per subap per iter for each WFS (for imat computation only)
6950 lgs: (np.ndarray[ndim=1,dtype=np.int64]) : LGS flag for each WFS
6952 fakecam: (bool): if True, image is computed in uint16
6954 max_flux_per_pix: (np.ndarray[ndim=1, dtype=np.int32]): maximum number of photons a pixel can handle before saturation
6956 max_pix_value: (np.ndarray[ndim=1, dtype=np.int32]): maximum number of ADU possible in the uint16 image
6958 device: (int): GPU device index
6960 roket : (bool): flag for enabling ROKET
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:
6965 Initializes the guide stars of all WFS
6968 xpos: (np.array(ndim=1,dtype=np.float32)): X position of the GSs [arcsec]
6970 ypos: (np.array(ndim=1,dtype=np.float32)): Y position of the GSs [arcsec]
6972 lambda_um: (np.array(ndim=1,dtype=np.float32)): Wavelength of the GSs [µm]
6974 mag: (np.array(ndim=1,dtype=np.float32)): Magnitude of the GSs
6976 zerop: (float): Flux at magnitude 0
6978 sizes: (np.array(ndim=1,dtype=np.int64)): Support size of the GSs
6980 noise: (np.array(ndim=1,dtype=np.float32)): Noise of the WFS [e-]
6982 seeds: (np.array(ndim=1,dtype=np.int64)): seeds for noise generation
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
6988 dx: (np.array(ndim=1,dtype=np.float32)): X axis misalignment for WFS
6990 dy: (np.array(ndim=1,dtype=np.float32)): Y axis misalignment for WFS
6993 def set_field_stop(self, nwfs: int, field_stop: numpy.ndarray[numpy.float32], N: int) -> int:
6995 Set new field stop for the specified SH WFS
6998 nwfs: (int): WFS index
7000 field_stop: (np.array(ndim=2,dtype=np.float32)): Field stop to use
7002 N : (int): Size of the field stop array along one axis
7005 def d_camplifoc(self) -> carmaWrap.obj_float_complex:
7007 Complex amplitude in the focal plane
7009 :type: carmaWrap.obj_float_complex
7012 def d_camplipup(self) -> carmaWrap.obj_float_complex:
7014 Complex amplitude in the pupil
7016 :type: carmaWrap.obj_float_complex
7019 def d_ftlgskern(self) -> carmaWrap.obj_float_complex:
7021 Convolution kernel for LGS spot
7023 :type: carmaWrap.obj_float_complex
7026 def d_fttotim(self) -> carmaWrap.obj_float_complex:
7028 Buffer for FFT computation
7030 :type: carmaWrap.obj_float_complex
7033 def d_lgskern(self) -> carmaWrap.obj_float:
7037 :type: carmaWrap.obj_float
7040 def d_wfs(self) -> typing.List[SutraWfs]:
7044 :type: typing.List[SutraWfs]
7047 def device(self) -> int:
7054 def nsensors(self) -> int:
7061 def roket(self) -> bool:
7069 def __str__(self) -> str: ...
7070 def add_layer(self, context: str, type: int, xoff: float, yoff: float) -> int:
7072 Add a phase screen "dm" or "atmos" as layers to consider for raytracing
7075 context: (CarmaContext) : carma or carmaWrap context
7077 type: (str) : "atmos" or "dm"
7079 xoff: (float) : x-offset for raytracing
7081 yoff: (float) : y-offset for raytracing
7084 def comp_image(self, puponly: int = 0, comp_le: bool =
True) -> int:
7086 Compute short and long exposure images
7089 puponly: (int) : Airy computation
7091 comp_le: (bool) : Flag for computing LE image
7094 def comp_strehl(self, do_fit: bool =
True) -> int:
7096 Compute Strehl ratio
7098 def init_strehlmeter(self) -> int:
7100 Initialize Strehl ratio computation
7103 def raytrace(self, rst: bool =
False) -> int:
7105 Raytrace through ncpa layers
7108 rst: (bool): reset screen phase before raytracing
7112 Raytrace through telescope aberrations
7115 tel: (SutraTelescope): SutraTelescope object
7117 rst: (bool): reset screen phase before raytracing
7121 Raytrace through turbulent layers. Calling this function will automatically reset the screen phase before raytracing.
7124 atmos: (SutraAtmos): SutraAtmos object
7126 do_async: (bool): asynchronous mode
7130 Raytrace through DMs
7133 dms: (SutraDms): SutraDms object
7135 rst: (bool): reset phase screen before raytracing
7137 do_phase_var: (bool): compute the residual phase variance
7139 do_async: (bool): asynchronous mode
7143 Raytrace through all layers (turbu, dms, telescope, ncpa)
7146 tel: (sutra_tel): SutraTelescope object
7148 atm: (SutraAtmos): SutraAtmos object
7150 dms: (SutraDms): SutraDms object
7152 do_phase_var: (bool): compute the residual phase variance
7154 do_async: (bool): asynchronous mode
7157 def raytrace(self, tel: Telescope, rst: bool =
False) -> int: ...
7159 def raytrace(self, atmos: Atmos, do_async: bool =
False) -> int: ...
7161 def raytrace(self, dms: Dms, rst: bool =
False, do_phase_var: bool =
True, do_async: bool =
False) -> int: ...
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:
7166 Remove a phase screen for raytracing
7169 type: (str) : "atmos" or "dm"
7171 idx: (int) : index of the DM or turbulent layer to remove
7174 def reset_phase(self) -> int:
7176 Reset the phase screen
7178 def reset_strehlmeter(self) -> int:
7182 def set_ncpa(self, data: numpy.ndarray[numpy.float32]) ->
None:
7187 data: (np.array(ndim=2,dtype=np.float32)): NCPA phase to set
7190 def set_phase(self, data: numpy.ndarray[numpy.float32]) ->
None:
7192 Set the target screen phase
7195 data: (np.array(ndim=2,dtype=np.float32)): target phase to set
7198 def G(self) -> float:
7200 Magnifying factor for WFS misalignment
7205 def block_size(self) -> int:
7207 Optimum block size of device
7212 def d_amplipup(self) -> carmaWrap.obj_float_complex:
7214 Complex amplitude in the pupil plane
7216 :type: carmaWrap.obj_float_complex
7219 def d_image_le(self) -> carmaWrap.obj_float:
7221 Long exposure image of the source
7223 :type: carmaWrap.obj_float
7226 def d_image_se(self) -> carmaWrap.obj_float:
7228 Short exposure image of the source
7230 :type: carmaWrap.obj_float
7233 def d_lgs(self) -> SutraLGS:
7235 LGS structure of WFS
7240 def d_ncpa_phase(self) -> carmaWrap.obj_float:
7244 :type: carmaWrap.obj_float
7247 def d_phase(self) -> carmaWrap.obj_float:
7249 Phase screen of the source
7251 :type: carmaWrap.obj_float
7254 def d_phasepts(self) -> carmaWrap.obj_float:
7256 Phase on the valid pixels of the pupil plane
7258 :type: carmaWrap.obj_float
7261 def d_pupil(self) -> carmaWrap.obj_float:
7265 :type: carmaWrap.obj_float
7268 def d_wherephase(self) -> carmaWrap.obj_int:
7270 Indices of the valid pixels of the pupil
7272 :type: carmaWrap.obj_int
7275 def device(self) -> int:
7282 def dx(self) -> float:
7284 X axis WFS misalignment [pixels]
7289 def dy(self) -> float:
7291 Y axis WFS misalignment [pixels]
7296 def lambda_um(self) -> float:
7298 Wavelength of the source in µm
7303 def lgs(self) -> bool:
7310 def mag(self) -> float:
7312 Magnitude of the source
7317 def npts(self) -> int:
7319 Number of points in the pupil
7324 def phase_telemetry(self) -> carmaWrap.host_obj_float:
7328 :type: carmaWrap.host_obj_float
7331 def phase_var(self) -> float:
7333 Short exposure variance in the pupil [µm²]
7338 def phase_var_avg(self) -> float:
7340 Long exposure variance in the pupil [µm²]
7345 def phase_var_count(self) -> int:
7347 Counter fo long exposure variance computation
7352 def posx(self) -> float:
7354 X position of the source
7359 def posy(self) -> float:
7361 Y position of the source
7366 def ref_strehl(self) -> float:
7368 reference for Strehl computation (Airy)
7373 def scale(self) -> float:
7375 Phase scale factor (2*pi/lambda)
7380 def strehl_counter(self) -> int:
7382 Counter for LE Strehl computation
7387 def strehl_le(self) -> float:
7389 Long exposure Strehl ratio
7394 def strehl_se(self) -> float:
7396 Short exposure Strehl ratio
7401 def thetaML(self) -> float:
7403 Pupil rotation angle for WFS misalignment
7408 def type(self) -> str:
7410 Type of source (Target or WFS GS)
7415 def xoff(self) -> typing.Dict[typing.Tuple[str, int], float]:
7417 X offset for raytracing
7419 :type: typing.Dict[typing.Tuple[str, int], float]
7422 def yoff(self) -> typing.Dict[typing.Tuple[str, int], float]:
7424 Y offset for raytracing
7426 :type: typing.Dict[typing.Tuple[str, int], float]
7429 def zp(self) -> float:
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:
7439 Instantiates a StellarCoronagraph object
7442 context: (CarmaContext): context
7444 d_source: (SutraSource): Coronagraph source input
7446 im_dimx: (int): Coronagraphic image dimension along x axis
7448 im_dimy: (int): Coronagraphic image dimension along y axis
7450 fpm_dimx: (int): Focal plane dimension along x axis
7452 fpm_dimy: (int): Focal plane dimension along y axis
7454 wavelength: (np.ndarray[ndim=1, dtype=np.float32]): vector of wavelengths
7456 nWavelength: (int): number of wavelength
7458 babinet: (bool): Flag to enable Babinet trick
7460 device: (int): GPU device index
7462 def compute_image_normalization(self) -> int:
7464 Compute image for normalization
7467 def set_apodizer(self, mask: numpy.ndarray[numpy.float32]) -> int:
7469 Set apodizer for coronagraphic image computation
7472 mask: (np.ndarray[ndim=2, dtype=np.float32]): apodizer
7474 def set_focal_plane_mask(self, mask: numpy.ndarray[numpy.float32]) -> int:
7476 Set focal plane mask for coronagraphic image computation
7479 mask: (np.ndarray[ndim=3, dtype=np.float32]): Focal plane mask for each wavelength
7481 def set_lyot_stop(self, mask: numpy.ndarray[numpy.float32]) -> int:
7483 Set lyot_stop for coronagraphic image computation
7486 mask: (np.ndarray[ndim=2, dtype=np.float32]): lyot_stop
7488 def set_mft(self, A: numpy.ndarray[numpy.complex64], B: numpy.ndarray[numpy.complex64], norm: numpy.ndarray[numpy.float32], mft_type: str) -> int:
7490 Set MFT matrices for coronagraphic image computation
7493 A : (np.ndarray[dtype=np.complex32, ndims=3]): A MFT matrix for each wavelength
7495 B : (np.ndarray[dtype=np.complex32, ndims=3]): B MFT matrix for each wavelength
7497 norm : (np.ndarray[dtype=np.complex32, ndims=3]): MFT normalization for each wavelength
7499 mft_type : (str): MFT matrices to set, i.e. "img" or "psf"
7502 def AA(self) -> typing.Dict[str, typing.Tuple[typing.List[carmaWrap.obj_float_complex], typing.List[int]]]:
7506 :type: typing.Dict[str, typing.Tuple[typing.List[carmaWrap.obj_float_complex], typing.List[int]]]
7509 def BB(self) -> typing.Dict[str, typing.Tuple[typing.List[carmaWrap.obj_float_complex], typing.List[int]]]:
7513 :type: typing.Dict[str, typing.Tuple[typing.List[carmaWrap.obj_float_complex], typing.List[int]]]
7516 def babinet(self) -> bool:
7523 def d_apodizer(self) -> carmaWrap.obj_float:
7527 :type: carmaWrap.obj_float
7530 def d_lyot_stop(self) -> carmaWrap.obj_float:
7534 :type: carmaWrap.obj_float
7537 def focal_plane_mask(self) -> typing.List[carmaWrap.obj_float]:
7541 :type: typing.List[carmaWrap.obj_float]
7544 def fpmDimx(self) -> int:
7546 Focal plane dimension
7551 def fpmDimy(self) -> int:
7553 Focal plane dimension
7558 def norm(self) -> typing.Dict[str, typing.List[float]]:
7562 :type: typing.Dict[str, typing.List[float]]
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:
7568 Create and initialise an target object
7571 context: (CarmaContext) : current carma context
7573 d_tel: (SutraTelescope) : SutraTelescope object
7575 ntargets: (int): number of targets
7577 xpos: (np.ndarray[ndim=1,dtype=np.float32_t]) : X positions of each target in arcsec
7579 ypos: (np.ndarray[ndim=1,dtype=np.float32_t]) : Y positions of each target in arcsec
7581 lambda_um: (np.ndarray[ndim=1,dtype=np.float32_t]) : Wavelength of each target in µm
7583 mag: (np.ndarray[ndim=1,dtype=np.float32_t]) : magnitude of each target
7585 zerop: (float) : Flux at magnitude 0 in photons/m²/s
7587 sizes: (np.ndarray[ndim=1,dtype=np.int64_t]) : Support size of each target
7589 Npts : (int): number of points in the pupil
7591 device: (int): GPU device index
7594 def __str__(self) -> str: ...
7596 def d_targets(self) -> typing.List[Source]:
7600 :type: typing.List[Source]
7603 def ntargets(self) -> int:
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:
7613 Create and initialise a Telescope object
7616 context: (CarmaContext) : current carma context
7618 n_pup: (long) : spupil size
7620 npos : (long): number of points in the pupil
7622 pupil: (np.ndarray[ndim=2, dtype=np.float32_t]) : spupil
7624 n_pup_m: (long) : mpupil size
7626 pupil_m: (np.ndarray[ndim=2, dtype=np.float32_t]) : mpupil
7629 def reset_input_phase(self) -> int:
7631 Reset circular buffer d_input_phase
7633 def set_input_phase(self, phase_ab: numpy.ndarray[numpy.float32]) -> int:
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
7638 input_hase: (np.ndarray[ndim=3,dtype=np.float32_t]) : Cube of input phase screens
7641 def set_phase_ab_M1(self, phase_ab: numpy.ndarray[numpy.float32]) -> int:
7643 Set the M1 phase aberration in the small pupil
7646 phase_ab: (np.ndarray[ndim=2,dtype=np.float32_t]) : M1 phase aberration in the small pupil
7649 def set_phase_ab_M1_m(self, phase_ab: numpy.ndarray[numpy.float32]) -> int:
7651 Set the M1 phase aberration in the medium pupil
7654 phase_ab: (np.ndarray[ndim=2,dtype=np.float32_t]) : M1 phase aberration in the medium pupil
7657 def set_pupil(self, pup: numpy.ndarray[numpy.float32]) ->
None:
7662 pup: (np.ndarray[ndim=2,dtype=np.float32_t]) : small pupil
7665 def set_pupil_m(self, pup: numpy.ndarray[numpy.float32]) ->
None:
7667 Set the medium pupil
7670 pup: (np.ndarray[ndim=2,dtype=np.float32_t]) : medium pupil
7673 def update_input_phase(self) -> int:
7675 Update input_phase_counter to take the next phase screen in the circular buffer d_input_phase
7678 def d_input_phase(self) -> carmaWrap.obj_float:
7680 Cube of user-defined input phase screens
7682 :type: carmaWrap.obj_float
7685 def d_phase_ab_M1(self) -> carmaWrap.obj_float:
7687 M1 aberrations on the small pupil
7689 :type: carmaWrap.obj_float
7692 def d_phase_ab_M1_m(self) -> carmaWrap.obj_float:
7694 M1 aberrations on the medium pupil
7696 :type: carmaWrap.obj_float
7699 def d_pupil(self) -> carmaWrap.obj_float:
7701 Small pupil of the Telescope
7703 :type: carmaWrap.obj_float
7706 def d_pupil_m(self) -> carmaWrap.obj_float:
7708 Medium pupil of the Telescope
7710 :type: carmaWrap.obj_float
7713 def device(self) -> int:
7720 def input_phase_counter(self) -> int:
7722 Index of the current phase screen in the cube d_input_phase
7727 def num_eleme_pup(self) -> int:
7729 number of points in the pupil
7734 def pup_size(self) -> int:
7741 def pup_size_m(self) -> int:
7749 def set_deltax(self, deltax: float) -> int:
7751 Set the screen movement along the X-axis at each iteration in pixels
7754 deltax: (float) : Number of columns to add at each iteration
7757 def set_deltay(self, deltay: float) -> int:
7759 Set the screen movement along the Y-axis at each iteration in pixels
7762 deltay: (float) : Number of lines to add at each iteration
7765 def set_istencilx(self, stencil: numpy.ndarray[numpy.uint32]) -> int:
7767 Set the stencil along the X-Axis
7770 stencil: (np.array) : Stencil along the X-axis
7773 def set_istencily(self, stencil: numpy.ndarray[numpy.uint32]) -> int:
7775 Set the stencil along the Y-Axis
7778 stencil: (np.array) : Stencil along the Y-axis
7782 def accumx(self) -> float:
7784 accumulate columns to extrude
7789 def accumy(self) -> float:
7791 accumulate rows to extrude
7796 def altitude(self) -> float:
7798 altitude of the phase screen
7803 def amplitude(self) -> float:
7805 amplitude for extrusion (r0**(-5/6)
7810 def d_istencilx(self) -> carmaWrap.obj_uint:
7812 stencil for row extrusion
7814 :type: carmaWrap.obj_uint
7817 def d_istencily(self) -> carmaWrap.obj_uint:
7819 stencil for column extrusion
7821 :type: carmaWrap.obj_uint
7824 def d_mat_a(self) -> carmaWrap.obj_float:
7826 A matrix for extrusion
7828 :type: carmaWrap.obj_float
7831 def d_mat_b(self) -> carmaWrap.obj_float:
7833 B matrix for extrusion
7835 :type: carmaWrap.obj_float
7838 def d_noise(self) -> carmaWrap.obj_float:
7840 random numbers for extrusion
7842 :type: carmaWrap.obj_float
7845 def d_screen(self) -> carmaWrap.obj_float:
7847 Turbulent phase screen
7849 :type: carmaWrap.obj_float
7852 def d_ytmp(self) -> carmaWrap.obj_float:
7854 contains the extrude update
7856 :type: carmaWrap.obj_float
7859 def d_z(self) -> carmaWrap.obj_float:
7861 tmp array for extrusion process
7863 :type: carmaWrap.obj_float
7866 def deltax(self) -> float:
7868 number of columns to extrude per iteration
7873 def deltay(self) -> float:
7875 number of rows to extrude per iteration
7887 def r0(self) -> float:
7894 def screen_size(self) -> int:
7896 size of phase screen
7901 def winddir(self) -> float:
7903 wind direction of phase screen
7908 def windspeed(self) -> float:
7910 wind speed of phase screen
7916 def comp_nphot(self, ittime: float, optthroughput: float, diam: float, cobs: float, zerop: float = 0, gsmag: float = 0) -> int:
7918 Compute the currect number of photons for a given system
7921 ittime: (float): 1/loop frequency [s].
7923 optthroughput: (float): wfs global throughput.
7925 diam: (float): telescope diameter.
7927 cobs: (float): telescope central obstruction.
7929 zerop: (float): (optional for LGS) detector zero point expressed in ph/m**2/s in the bandwidth of the WFS.
7931 gsmag: (float): (optional for LGS) magnitude of guide star.
7933 def copy_valid_pix(self, data: numpy.ndarray[numpy.float32], validx: numpy.ndarray[numpy.int32], validy: numpy.ndarray[numpy.int32], dim: int) -> int:
7935 Copy the given pixels on the right place in the binimg of PWFS
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:
7949 Load PYRHR WFS arrays
7972 ttprojmat: (np.array[ndim=2, dtype=np.float32]): slope projection matrix
7977 def set_phalfxy(self, phalfxy: numpy.ndarray[numpy.complex64]) -> int:
7979 Set the pyramid mask for each modulation point
7982 phalfxy: (np.ndarray[ndim=2, dtype=np.complex64]): pyramid mask for each modulation point
7985 def set_pyr_mod_weights(self, weights: numpy.ndarray[numpy.float32], npts: int) -> int:
7987 Set the modulation points weights of a PWFS
7990 weights: (np.ndarray[ndim=1, dtype=np.float32_t]): modulation points weights ponderation
7992 npts: (int): number of modulation points
7996 def set_pyr_modulation_points(self, cx: numpy.ndarray[numpy.float32], cy: numpy.ndarray[numpy.float32], npts: int) -> int:
7998 Set the modulation points of a PWFS
8001 cx: (np.ndarray[ndim=1, dtype=np.float32_t]): X position of modulation points
8003 cy: (np.ndarray[ndim=1, dtype=np.float32_t]): Y position of modulation points
8005 npts: (int): number of modulation points
8009 Set the modulation points and weights of a PWFS
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
8016 weights: (np.ndarray[ndim=1, dtype=np.float32_t]): modulation points weights ponderation
8018 npts: (int): number of modulation points
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:
8025 Set the image of the PWFS
8028 img: (np.array[ndim=2,dtype=np.float32]): new image to set
8031 def set_submask(self, mask: numpy.ndarray[numpy.float32]) ->
None:
8033 Set the field stop of the PWFS
8036 mask: (np.array[ndim=2,dtype=np.float32]): new field stop to set
8039 def set_validpix(self, datax: numpy.ndarray[numpy.int32], datay: numpy.ndarray[numpy.int32]) ->
None:
8041 Set the valid pixels of the PWFS
8044 datax: (np.array[ndim=2,dtype=np.float32]): new X positions of valid pixels
8046 datay: (np.array[ndim=2,dtype=np.float32]): new Y positions of valid pixels
8050 def compute_pyrfocalplane(self) -> bool:
8056 @compute_pyrfocalplane.setter
8057 def compute_pyrfocalplane(self, arg0: bool) ->
None:
8062 def d_hrimg(self) -> carmaWrap.obj_float:
8066 :type: carmaWrap.obj_float
8069 def d_phalfxy(self) -> carmaWrap.obj_float_complex:
8073 :type: carmaWrap.obj_float_complex
8076 def d_poffsets(self) -> carmaWrap.obj_float_complex:
8080 :type: carmaWrap.obj_float_complex
8083 def d_psum(self) -> carmaWrap.obj_float:
8087 :type: carmaWrap.obj_float
8090 def d_pyrfocalplane(self) -> carmaWrap.obj_float:
8094 :type: carmaWrap.obj_float
8097 def npupils(self) -> int:
8099 Number of pupil images
8104 def pyr_cx(self) -> carmaWrap.host_obj_float:
8108 :type: carmaWrap.host_obj_float
8111 def pyr_cy(self) -> carmaWrap.host_obj_float:
8113 Modulation points X-positions
8115 :type: carmaWrap.host_obj_float
8118 def pyr_mod_weights(self) -> carmaWrap.host_obj_float:
8120 Ponderation weights for each modulation points
8122 :type: carmaWrap.host_obj_float
8125 __version__ =
'5.4.4'
int set_seed(self, int idx, float seed)
Set the seed of the selected screen RNG.
int refresh_screen(self, int idx)
Refresh the selected screen by extrusion.
nscreens
Number of turbulent screens.
d_screens
Vector of tscreens.
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.
int move_atmos(self)
Move the turbulence in the atmos screen following loaded parameters such as windspeed and wind direct...
int del_screen(self, int idx)
Delete the selected screen.
int set_r0(self, float r0)
Change the current global r0 of all layers.
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.
d_validy
Y positions of the valid ssp.
int init_calib(self, int n, int m)
Initialize data used for calibration.
int set_npix(self, int npix)
Set the number of pixels per subap for a RTC standalone.
d_ref_Tip
Tip mode reference for filtering.
int set_flat(self, numpy.ndarray[numpy.float32] flat, int n)
Set the flat frame for calibration.
nvalid
Number of valid ssp of the WFS.
d_lutPix
Lookup Table of pixels for calibration.
d_validMask
Flat frame for calibration.
int init_img_raw(self, int n, int m)
Initialize array to store raw WFS image in RTC standalone mode.
int calibrate_img_validPix(self)
Performs the raw WFS frame calibration only on useful pixels.
d_ref_Tilt
Tilt mode reference for filtering.
int get_cog(self)
Computes centroids and stores it in d_slopes of the WFS.
offset
Offset for centroiding computation.
int load_validpos(self, numpy.ndarray[numpy.int32] validx, numpy.ndarray[numpy.int32] validy, int N)
Load the validx and validy arrays.
nxsub
Number of ssp across the pupil diameter.
d_dark
Dark frame for calibration.
d_bincube
Bincube of the WFS image.
d_centroids_ref
Reference slopes vector.
int set_offset(self, float offset)
Set the controider offset [pixels].
int calibrate_img(self)
Performs the raw WFS frame calibration.
d_TT_slopes
Tip/tilt slopes removed after filtering.
int set_dark(self, numpy.ndarray[numpy.float32] dark, int n)
Set the dark frame for calibration.
int set_nxsub(self, int nxsub)
Set the number of ssp across the pupil diameter for a RTC standalone.
wfs
SutraWfs handled by this centroider.
d_flat
Flat frame for calibration.
d_validx
X positions of the valid ssp.
d_intensities
intensities of the WFS image
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)
npix
Number of pixels along a side of WFS subap.
scale
Scale factor to get slopes in arcsec.
filter_TT
Tip/tilt filtering flag.
int set_centroids_ref(self, numpy.ndarray[numpy.float32] refslopes)
Set the references slopes.
int set_scale(self, float scale)
Set the controider scale factor.
int set_lutPix(self, numpy.ndarray[numpy.int32] lutPix, int n)
Set the lookup Table Pixel vector for calibration.
d_img
Calibrated WFS image.
d_validMask
Flat frame for calibration.
d_dark
Dark frame for calibration.
nvalid
Number of valid ssp of the WFS.
d_bincube
Bincube of the WFS image.
int set_lutPix(self, numpy.ndarray[numpy.int32] lutPix, int n)
Set the lookup Table Pixel vector for calibration.
d_ref_Tilt
Tilt mode reference for filtering.
int set_nxsub(self, int nxsub)
Set the number of ssp across the pupil diameter for a RTC standalone.
d_TT_slopes
Tip/tilt slopes removed after filtering.
d_lutPix
Lookup Table of pixels for calibration.
int set_npix(self, int npix)
Set the number of pixels per subap for a RTC standalone.
d_centroids_ref
Reference slopes vector.
d_flat
Flat frame for calibration.
wfs
SutraWfs handled by this centroider.
d_img
Calibrated WFS image.
offset
Offset for centroiding computation.
int set_scale(self, float scale)
Set the controider scale factor.
npix
Number of pixels along a side of WFS subap.
filter_TT
Tip/tilt filtering flag.
int set_offset(self, float offset)
Set the controider offset [pixels].
int set_dark(self, numpy.ndarray[numpy.float32] dark, int n)
Set the dark frame for calibration.
nxsub
Number of ssp across the pupil diameter.
d_intensities
intensities of the WFS image
d_ref_Tip
Tip mode reference for filtering.
d_validx
X positions of the valid ssp.
int set_centroids_ref(self, numpy.ndarray[numpy.float32] refslopes)
Set the references slopes.
d_validy
Y positions of the valid ssp.
scale
Scale factor to get slopes in arcsec.
int set_flat(self, numpy.ndarray[numpy.float32] flat, int n)
Set the flat frame for calibration.
d_interpmat
TODO docstring.
interp_sizey
TODO docstring.
d_corrnorm
TODO docstring.
d_corrspot
TODO docstring.
interp_sizex
TODO docstring.
d_corrfnct
TODO docstring.
centro_idx
Indices of the handled centroiders.
int set_com(self, numpy.ndarray[numpy.float32] com, int nElem)
Set the command vector of the controller.
None set_comRange(self, float volt_min, float volt_max)
Set the volt_min and volt_max value for command clipping.
d_centroids
Slopes vector.
int set_val_max(self, float val_max)
Set the val_max value for command conversion.
int command_delay(self)
Delay the command.
d_voltage
Total voltage to apply on the DMs.
int clip_commands(self)
Clip the commands between volt_min and volt_max (values set in the controller)
int add_perturb_voltage(self, str name, numpy.ndarray[numpy.float32] perturb, int N)
Add a new perturbation voltage buffer.
int disable_perturb_voltage(self, str name)
Disable a perturbation voltage buffer.
int comp_voltage(self)
Computes the final voltage to send to the DM.
int enable_perturb_voltage(self, str name)
Enable a perturbation voltage buffer.
int set_delay(self, float delay)
Set the delay.
comRange
type of : typing.Tuple[float, float]
d_circularComs0
Oldest command vector in the circular buffer.
d_dmseen
Vector of SutraDm commanded.
nactu
Number of actuators to control.
int remove_perturb_voltage(self, str name)
Remove a perturbation voltage buffer.
int reset_perturb_voltage(self)
Remove all perturbation voltage buffers.
d_com_clipped
Delayed commands.
d_com
Current command vector.
int set_gain(self, float gain)
Set the gain.
int set_perturb_voltage(self, str name, numpy.ndarray[numpy.float32] perturb, int N)
Set an existing perturbation voltage buffer.
val_max
Maximum value for d_voltage (ADU).
int add_perturb(self)
Add the perturbation voltage to the command.
int reset_coms(self)
Reset the commands circular buffer.
int set_open_loop(self, int status, bool rst=True)
Open (1) or close (0) the loop.
d_perturb_map
Perturbation voltage buffers.
d_circularComs1
Second oldest Command vector in the circular buffer.
d_com1
Command vector at iteration k-1.
int set_volt_max(self, float volt_max)
Set the volt_max value for command clipping.
int set_com(self, numpy.ndarray[numpy.float32] com, int nElem)
Set the command vector of the controller.
val_max
Maximum value for d_voltage (ADU).
d_com1
Command vector at iteration k-1.
d_centroids
Slopes vector.
nactu
Number of actuators to control.
d_com
Current command vector.
d_gain
vector of modal gains
int set_cmat(self, numpy.ndarray[numpy.float32] cmat)
Set the command matrix.
d_compbuff
Computation buffer buffer.
int set_imat(self, numpy.ndarray[numpy.float32] imat)
Set the interaction matrix.
int set_modal_gains(self, numpy.ndarray[numpy.float32] mgain)
Set the controller modal gains.
int set_matD(self, numpy.ndarray[numpy.float32] M)
Set D matrix (interaction matrix)
d_matA
List of A matrices used for state recursion (see compass.io details on the generic linear controller)
n_slope_buffers
number of slope vectors to store in buffer (see compass.io details on the generic linear controller)
d_matK
K matrix, used for projection from state to modes (see compass.io details on the generic linear contr...
d_matL
List of L matrices used for innovation from measurements (see compass.io details on the generic linea...
d_matD
D matrix, typically set to the interaction matrix (see compass.io details on the generic linear contr...
n_modes
number of modes in mode vector (see compass.io details on the generic linear controller)
n_iir_in
number of iir inputs to use (see compass.io details on the generic linear controller)
modal
modal flag (see compass.io details on the generic linear controller)
d_imat
D matrix, typically set to the interaction matrix (see compass.io details on the generic linear contr...
d_circular_coms
circular command buffer (see compass.io details on the generic linear controller)
d_iir_b
List of iir coefficient vectors for inputs (see compass.io details on the generic linear controller)
d_iir_a
List of iir coefficient vectors for outputs (see compass.io details on the generic linear controller)
int set_iir_b(self, numpy.ndarray[numpy.float32] M, int i)
Set a single iir 'b' vector within list (combined with iir inputs)
n_iir_out
number of iir outputs to use (see compass.io details on the generic linear controller)
int set_matA(self, numpy.ndarray[numpy.float32] M, int i)
Set a single A matrix within the list of A matrices (state recursions)
n_states
number of states in state vector (see compass.io details on the generic linear controller)
d_circular_s
circular slope buffer (see compass.io details on the generic linear controller)
d_centroids
centroid/slope vector (see compass.io details on the generic linear controller)
d_matF
F matrix, used to project from modes to actuator voltages (see compass.io details on the generic line...
d_circular_u_out
circular buffer of iir outputs (see compass.io details on the generic linear controller)
d_x_now
temporary state vector used for control calcs (see compass.io details on the generic linear controlle...
int set_matL(self, numpy.ndarray[numpy.float32] M, int i)
Set a single L matrix within the list of L matrices (innovations)
n_state_buffers
number of state vectors to store in buffer (see compass.io details on the generic linear controller)
int set_matF(self, numpy.ndarray[numpy.float32] M)
Set F matrix (mode to actuator voltage projection)
d_com
command vector (see compass.io details on the generic linear controller)
d_circular_x
circular state buffer (see compass.io details on the generic linear controller)
d_u_now
temporary command vector used for control calcs (see compass.io details on the generic linear control...
polc
polc flag (see compass.io details on the generic linear controller)
int set_polc(self, bool polc)
Set the POLC flag.
d_circular_u_in
circular buffer of iir inputs (see compass.io details on the generic linear controller)
int set_matK(self, numpy.ndarray[numpy.float32] M)
Set K matrix (state to mode projection)
d_s_now
temporary slope vector used for control calcs (see compass.io details on the generic linear controlle...
int set_polc(self, bool polc)
Set the POLC flag.
polc
polc flag (see compass.io details on the generic linear controller)
d_imat
D matrix, typically set to the interaction matrix (see compass.io details on the generic linear contr...
d_gain
vector of modal gains
d_gain
vector of modal gains
d_cenbuff
Centroids circular buffer.
int set_modal_gains(self, numpy.ndarray[numpy.float32] mgain)
Set the controller modal gains.
int set_imat(self, numpy.ndarray[numpy.float32] imat)
Set the interaction matrix.
d_err
Current increment on the command.
d_gain
vector of modal gains
d_imat
Interaction matrix.
int build_cmat(self, int nfilt)
Computes the command matrix after imat SVD.
int set_cmat(self, numpy.ndarray[numpy.float32] cmat)
Set the command matrix.
d_cenbuff
Centroids circular buffer.
int set_cmat(self, numpy.ndarray[numpy.float32] cmat)
Set the command matrix.
d_err
Current increment on the command.
d_imat
Interaction matrix.
d_gain
vector of modal gains
int set_imat(self, numpy.ndarray[numpy.float32] imat)
Set the interaction matrix.
int set_modal_gains(self, numpy.ndarray[numpy.float32] mgain)
Set the controller modal gains.
nactus
Number of actuators.
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.
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.
int do_imat(self, int ncontrol, Dms dms, int kernconv)
Computes interaction matrix.
int apply_control(self, int ncontrol, bool compVoltage=True)
Apply the commands on the DM and shape it.
None build_cmat(self, int ncontrol, int nfilt, bool filt_tt=False)
Computes cmat.
d_centro
Vector of centroiders.
int remove_centroider(self, int ncentro)
Remove the specified centroider from the RTC.
int do_centroids_geom(self, int ncontrol, int type=0)
Computes the centroids geom.
int do_control(self, int ncontrol)
Computes the commands.
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.
None set_modal_gains(self, int ncontrol, numpy.ndarray[numpy.float32] mgain)
Set the modal gain in the controller.
int do_calibrate_img(self, int ncontrol)
Computes the calibrated image.
int do_centroids(self, int ncontrol)
Computes the centroids.
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.
int do_clipping(self, int ncontrol)
Clip the command to apply on the DMs on a SutraController object.
None imat_svd(self, int ncontrol)
Computes imat svd.
int set_centroids_ref(self, numpy.ndarray[numpy.float32] centroidsRef)
Set the reference centroids.
None set_gain(self, int ncontrol, float gain)
Set the loop gain in the controller.
int do_centroids_ref(self, int ncontrol)
Computes the centroids ref.
d_control
Vector of controllers.
int remove_controller(self, int ncontrol)
Remove the specified controller from the RTC.
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.
int comp_voltage(self, int ncontrol)
Compute the commands on the DM.
None __init__(self)
Initialize a void rtc object.
None __init__(self)
Initialize a void rtc object.
None __init__(self)
Initialize a void rtc object.
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)