42 from shesha.ao import imats, cmats, tomo, basis, modopti
46 from typing
import List
49 from shesha.sutra_wrap import (carmaWrap_context, Sensors, Dms, Target, Rtc_brahma,
50 Rtc_cacao_FFF, Atmos, Telescope)
54 def rtc_init(context: carmaWrap_context, tel: Telescope, wfs: Sensors, dms: Dms,
55 atmos: Atmos, p_wfss: list, p_tel: conf.Param_tel, p_geom: conf.Param_geom,
56 p_atmos: conf.Param_atmos, ittime: float, p_centroiders=
None,
57 p_controllers=
None, p_dms=
None, do_refslp=
False, brahma=
False, cacao=
False,
58 tar=
None, dataBase={}, use_DB=
False):
59 """Initialize all the SutraRtc objects : centroiders and controllers
62 context: (carmaWrap_context): context
64 tel: (Telescope) : Telescope object
66 wfs: (Sensors) : Sensors object
68 dms: (Dms) : Dms object
70 atmos: (Atmos) : Atmos object
72 p_wfss: (list of Param_wfs) : wfs settings
74 p_tel: (Param_tel) : telescope settings
76 p_geom: (Param_geom) : geom settings
78 p_atmos: (Param_atmos) : atmos settings
80 ittime: (float) : iteration time [s]
83 p_centroiders : (list of Param_centroider): centroiders settings
85 p_controllers : (list of Param_controller): controllers settings
87 p_dms: (list of Param_dms) : dms settings
89 do_refslp : (bool): do ref slopes flag, default=False
91 brahma: (bool) : brahma flag
93 cacao: (bool) : cacao flag
95 tar: (Target) : Target object
97 dataBase: (dict): dict containig paths to files to load
99 use_DB: (bool): use dataBase flag
102 Rtc : (Rtc) : Rtc object
107 rtc = Rtc_brahma(context, wfs, tar,
"rtc_brahma")
109 rtc = Rtc_cacao_FFF(p_controllers[0].calpix_name, p_controllers[0].loopdata_name)
117 ncentro = len(p_centroiders)
122 ncontrol = len(p_controllers)
126 if p_centroiders
is not None:
127 for i
in range(ncentro):
128 nwfs = p_centroiders[i].nwfs
132 if p_controllers
is not None:
133 if (p_wfss
is not None and p_dms
is not None):
134 for i
in range(ncontrol):
135 if not "dm" in dataBase:
136 imat = imats.imat_geom(wfs, dms, p_wfss, p_dms, p_controllers[i],
141 if p_dms[0].type == scons.DmType.PZT:
142 dm_init.correct_dm(context, dms, p_dms, p_controllers[i], p_geom,
143 imat, dataBase=dataBase, use_DB=use_DB)
146 p_atmos, ittime, p_tel, rtc, dms, wfs, tel, atmos,
147 p_centroiders, do_refslp, dataBase=dataBase,
151 roket_flag =
True in [w.roket
for w
in p_wfss]
153 p_controller = p_controllers[0]
154 Nphi = np.where(p_geom._spupil)[0].size
156 list_dmseen = [p_dms[j].type
for j
in p_controller.ndm]
157 nactu = np.sum([p_dms[j]._ntotact
for j
in p_controller.ndm])
160 if(p_controller.nmodes
is not None):
161 nmodes = p_controller.nmodes
163 rtc.add_controller(context, scons.ControllerType.GEO, context.active_device,
164 0, p_controller.nslope, p_controller.nactu,
165 p_controller.nslope_buffer, p_controller.nstates, p_controller.nstate_buffer,
166 nmodes, p_controller.n_iir_in, p_controller.n_iir_out,
167 p_controller.polc, p_controller.modal, dms, p_controller.ndm,
168 p_controller.ndm.size, p_controller.nwfs, p_controller.nwfs.size, Nphi,
True)
175 def rtc_standalone(context: carmaWrap_context, nwfs: int, nvalid: list, nactu: int,
176 centroider_type: list, delay: list, offset: list, scale: list,
177 brahma: bool =
False, fp16: bool =
False, cacao: bool =
False) -> Rtc:
178 """Initialize all the SutraRtc objects : centroiders and controllers
181 context: (carmaWrap_context): context
183 nwfs: (int): number of wavefront sensors
185 nvalid: (int): number of valid measures as input
187 nactu: (int): number of actuators as output
189 centroider_type: (list): type of centroiders
191 delay: (list): delay of each controller
193 offset: (list): offset added in the cog computation of each WFS
195 scale: (list): scale factor used in the cog computation of each WFS
198 brahma: (bool) : brahma flag (default=False)
200 fp16: (bool) : fp16 flag (default=False)
202 cacao: (bool) : cacao flag (default=False)
205 Rtc : (Rtc) : Rtc object
207 print(
"start rtc_standalone")
209 rtc = Rtc_brahma(context,
None,
None,
"rtc_brahma")
213 rtc = Rtc_cacao_FHF(
"compass_calPix",
"compass_loopData")
215 rtc = Rtc_cacao_FFF(
"compass_calPix",
"compass_loopData")
222 for k
in range(nwfs):
225 rtc.add_centroider(context, nvalid[k], offset[k], scale[k],
False,
226 context.active_device, centroider_type[k])
228 nslopes = sum([c.nslopes
for c
in rtc.d_centro])
230 rtc.add_controller(context,
"generic", context.active_device,delay[0],
231 nslopes, nactu, idx_centro=np.arange(nwfs),
234 print(
"rtc_standalone set")
239 p_centroider: conf.Param_centroider, p_tel: conf.Param_tel,
240 p_atmos: conf.Param_atmos, wfs: Sensors, rtc: Rtc):
241 """ Initialize a centroider object in Rtc
244 context: (carmaWrap_context): context
246 nwfs : (int) : index of wfs
248 p_wfs : (Param_wfs): wfs settings
250 p_centroider : (Param_centroider) : centroider settings
252 wfs: (Sensors): Sensor object
254 rtc : (Rtc) : Rtc object
256 if (p_wfs.type == scons.WFSType.SH):
257 if (p_centroider.type != scons.CentroiderType.CORR):
258 s_offset = p_wfs.npix // 2. - 0.5
260 if (p_centroider.type_fct == scons.CentroiderFctType.MODEL):
261 if (p_wfs.npix % 2 == 0):
262 s_offset = p_wfs.npix // 2 - 0.5
264 s_offset = p_wfs.npix // 2
266 s_offset = p_wfs.npix // 2 - 0.5
267 s_scale = p_wfs.pixsize
269 elif (p_wfs.type == scons.WFSType.PYRHR
or p_wfs.type == scons.WFSType.PYRLR):
271 s_scale = (p_wfs.Lambda * 1e-6 / p_tel.diam) * \
272 p_wfs.pyr_ampl * CONST.RAD2ARCSEC
274 rtc.add_centroider(context, p_wfs._nvalid, s_offset, s_scale, p_centroider.filter_TT,
275 context.active_device, p_centroider.type, wfs.d_wfs[nwfs])
276 rtc.d_centro[-1].load_validpos(p_wfs._validsubsx, p_wfs._validsubsy,
277 p_wfs._nvalid * p_wfs.nPupils)
279 rtc.d_centro[-1].set_npix(p_wfs.npix)
281 if (p_centroider.type != scons.CentroiderType.MASKEDPIX):
282 p_centroider._nslope = 2 * p_wfs._nvalid
284 p_centroider._nslope = p_wfs._validsubsx.size
286 if (p_centroider.type == scons.CentroiderType.PYR):
288 rtc.d_centro[nwfs].set_pyr_method(p_centroider.method)
289 rtc.d_centro[nwfs].set_pyr_thresh(p_centroider.thresh)
291 elif (p_wfs.type == scons.WFSType.SH):
292 if (p_centroider.type == scons.CentroiderType.TCOG
or
293 p_centroider.type == scons.CentroiderType.WCOG):
294 rtc.d_centro[nwfs].set_threshold(p_centroider.thresh)
295 if (p_centroider.type == scons.CentroiderType.BPCOG):
296 rtc.d_centro[nwfs].set_nmax(p_centroider.nmax)
297 if (p_centroider.type == scons.CentroiderType.WCOG
or
298 p_centroider.type == scons.CentroiderType.CORR):
299 r0 = p_atmos.r0 * (p_wfs.Lambda / 0.5)**(6 / 5.)
300 seeing = CONST.RAD2ARCSEC * (p_wfs.Lambda * 1.e-6) / r0
301 npix = seeing // p_wfs.pixsize
303 if p_centroider.type == scons.CentroiderType.WCOG:
304 rtc.d_centro[nwfs].init_weights()
305 rtc.d_centro[nwfs].load_weights(p_centroider.weights,
306 p_centroider.weights.ndim)
308 corrnorm = np.ones((2 * p_wfs.npix, 2 * p_wfs.npix), dtype=np.float32)
309 p_centroider.sizex = 3
310 p_centroider.sizey = 3
311 p_centroider.interpmat = rtc_util.create_interp_mat(
312 p_centroider.sizex, p_centroider.sizey).astype(np.float32)
314 if (p_centroider.weights
is None):
315 raise ValueError(
"p_centroider.weights is None")
316 rtc.d_centro[nwfs].init_corr(p_centroider.sizex, p_centroider.sizey,
317 p_centroider.interpmat)
318 rtc.d_centro[nwfs].load_corr(p_centroider.weights, corrnorm,
319 p_centroider.weights.ndim)
322 def comp_weights(p_centroider: conf.Param_centroider, p_wfs: conf.Param_wfs, npix: int):
323 """ Compute the weights used by centroider wcog and corr
326 p_centroider : (Param_centroider) : centroider settings
328 p_wfs : (Param_wfs) : wfs settings
332 if (p_centroider.type_fct == scons.CentroiderFctType.MODEL):
334 if (p_wfs.gsalt > 0):
336 tmp2 = utilities.makegaussian(tmp.shape[1],
337 npix * p_wfs._nrebin).astype(np.float32)
338 tmp3 = np.zeros((tmp.shape[1], tmp.shape[1], p_wfs._nvalid),
341 for j
in range(p_wfs._nvalid):
342 tmp3[:, :, j] = np.fft.ifft2(
343 np.fft.fft2(tmp[:, :, j]) * np.fft.fft2(tmp2.T)).real
344 tmp3[:, :, j] *= tmp3.shape[0] * tmp3.shape[1]
345 tmp3[:, :, j] = np.fft.fftshift(tmp3[:, :, j])
347 offset = (p_wfs._Ntot - p_wfs._nrebin * p_wfs.npix) // 2
348 j = offset + p_wfs._nrebin * p_wfs.npix
349 tmp = np.zeros((j - offset + 1, j - offset + 1, tmp3.shape[2]),
351 tmp3 = np.cumsum(tmp3[offset:j, offset:j, :], axis=0)
352 tmp[1:, 1:, :] = np.cumsum(tmp3, axis=1)
353 tmp = np.diff(tmp[::p_wfs._nrebin, ::p_wfs._nrebin, :], axis=0)
354 tmp = np.diff(tmp, axis=1)
356 p_centroider.weights = tmp
358 p_centroider.type_fct = scons.CentroiderFctType.GAUSS
359 print(
"No LGS found, centroider weighting function becomes gaussian")
361 if (p_centroider.type_fct == scons.CentroiderFctType.GAUSS):
362 if p_centroider.width
is None:
363 p_centroider.width = npix
364 if (p_wfs.npix % 2 == 1):
365 p_centroider.weights = utilities.makegaussian(
366 p_wfs.npix, p_centroider.width, p_wfs.npix // 2,
367 p_wfs.npix // 2).astype(np.float32)
368 elif (p_centroider.type == scons.CentroiderType.CORR):
369 p_centroider.weights = utilities.makegaussian(
370 p_wfs.npix, p_centroider.width, p_wfs.npix // 2,
371 p_wfs.npix // 2).astype(np.float32)
373 p_centroider.weights = utilities.makegaussian(
374 p_wfs.npix, p_centroider.width, p_wfs.npix // 2 - 0.5,
375 p_wfs.npix // 2 - 0.5).astype(np.float32)
378 def init_controller(context, i: int, p_controller: conf.Param_controller, p_wfss: list,
379 p_geom: conf.Param_geom, p_dms: list, p_atmos: conf.Param_atmos,
380 ittime: float, p_tel: conf.Param_tel, rtc: Rtc, dms: Dms,
381 wfs: Sensors, tel: Telescope, atmos: Atmos,
382 p_centroiders: List[conf.Param_centroider], do_refslp=
False,
383 dataBase={}, use_DB=
False):
384 """ Initialize the controller part of rtc
387 context: (carmaWrap_context): context
389 i : (int) : controller index
391 p_controller: (Param_controller) : controller settings
393 p_wfss: (list of Param_wfs) : wfs settings
395 p_geom: (Param_geom) : geom settings
397 p_dms: (list of Param_dms) : dms settings
399 p_atmos: (Param_atmos) : atmos settings
401 ittime: (float) : iteration time [s]
403 p_tel: (Param_tel) : telescope settings
405 rtc: (Rtc) : Rtc objet
407 dms: (Dms) : Dms object
409 wfs: (Sensors) : Sensors object
411 tel: (Telescope) : Telescope object
413 atmos: (Atmos) : Atmos object
415 p_centroiders: (list of Param_centroider): centroiders settings
418 do_refslp: (bool): do the reference slopes at startup,
420 dataBase: (dict): database used
422 use_DB: (bool): use database or not
424 if (p_controller.type != scons.ControllerType.GEO):
425 nwfs = p_controller.nwfs
426 if (len(p_wfss) == 1):
427 nwfs = p_controller.nwfs
429 p_controller.set_nvalid(int(np.sum([p_wfss[k]._nvalid
for k
in nwfs])))
431 for c
in p_centroiders:
433 tmp = tmp + c._nslope
434 p_controller.set_nslope(int(tmp))
436 nslope = np.sum([c._nslope
for c
in p_centroiders])
437 p_controller.set_nslope(int(nslope))
440 ndms = p_controller.ndm.tolist()
441 nactu = np.sum([p_dms[j]._ntotact
for j
in ndms])
442 p_controller.set_nactu(int(nactu))
444 alt = np.array([p_dms[j].alt
for j
in p_controller.ndm], dtype=np.float32)
446 list_dmseen = [p_dms[j].type
for j
in p_controller.ndm]
447 if (p_controller.type == scons.ControllerType.GEO):
448 Nphi = np.where(p_geom._spupil)[0].size
456 if(p_controller.nmodes
is not None):
457 nmodes = p_controller.nmodes
459 if (p_controller.type == scons.ControllerType.GENERIC_LINEAR):
461 nmodes = p_controller.nmodes
464 rtc.add_controller(context, p_controller.type, context.active_device,p_controller.delay,
465 p_controller.nslope, p_controller.nactu, p_controller.nslope_buffer,
466 p_controller.nstates, p_controller.nstate_buffer, nmodes,
467 p_controller.n_iir_in, p_controller.n_iir_out,
468 p_controller.polc, p_controller.modal, dms, p_controller.ndm,
469 p_controller.ndm.size, p_controller.nwfs, p_controller.nwfs.size, Nphi,
False)
471 print(
"CONTROLLER ADDED")
472 if (p_wfss
is not None and do_refslp):
473 rtc.do_centroids_ref(i)
475 if (p_controller.type == scons.ControllerType.GEO):
478 if (p_controller.type == scons.ControllerType.LS):
480 p_tel, rtc, dms, wfs, tel, atmos, dataBase=dataBase,
483 if (p_controller.type == scons.ControllerType.CURED):
486 if (p_controller.type == scons.ControllerType.MV):
490 elif (p_controller.type == scons.ControllerType.GENERIC):
493 p_controller._imat = imats.imat_geom(wfs, dms, p_wfss, p_dms, p_controller,
496 print(
"p_controller._imat not set")
500 p_controller: conf.Param_controller, p_dms: list, roket=
False):
501 """ Initialize geometric controller
504 i: (int): controller index
506 rtc: (Rtc): rtc object
508 dms: (Dms): Dms object
510 p_geom: (Param_geom): geometry settings
512 p_controller: (Param_controller): controller settings
514 p_dms: (list of Param_dms): dms settings
517 roket: (bool): Flag to initialize ROKET
519 indx_pup = np.where(p_geom._spupil.flatten(
'F'))[0].astype(np.int32)
520 indx_mpup = np.where(p_geom._mpupil.flatten(
'F'))[0].astype(np.int32)
522 indx_dm = np.zeros((p_controller.ndm.size * indx_pup.size), dtype=np.int32)
523 for dmn
in range(p_controller.ndm.size):
524 tmp_s = (p_geom._ipupil.shape[0] - (p_dms[dmn]._n2 - p_dms[dmn]._n1 + 1)) // 2
525 tmp_e0 = p_geom._ipupil.shape[0] - tmp_s
526 tmp_e1 = p_geom._ipupil.shape[1] - tmp_s
527 pup_dm = p_geom._ipupil[tmp_s:tmp_e0, tmp_s:tmp_e1]
528 indx_dm[cpt:cpt + np.where(pup_dm)[0].size] = np.where(pup_dm.flatten(
'F'))[0]
529 cpt += np.where(pup_dm)[0].size
531 unitpervolt = np.array([p_dms[j].unitpervolt
532 for j
in range(len(p_dms))], dtype=np.float32)
534 rtc.d_control[i].init_proj_sparse(dms, indx_dm, unitpervolt, indx_pup, indx_mpup,
539 p_geom: conf.Param_geom, p_dms: list, p_atmos: conf.Param_atmos,
540 ittime: float, p_tel: conf.Param_tel, rtc: Rtc, dms: Dms,
541 wfs: Sensors, tel: Telescope, atmos: Atmos, dataBase: dict = {},
542 use_DB: bool =
False):
543 """ Initialize the least square controller
546 i : (int) : controller index
548 p_controller: (Param_controller) : controller settings
550 p_wfss: (list of Param_wfs) : wfs settings
552 p_geom: (Param_geom) : geom settings
554 p_dms: (list of Param_dms) : dms settings
556 p_atmos: (Param_atmos) : atmos settings
558 ittime: (float) : iteration time [s]
560 p_tel: (Param_tel) : telescope settings
562 rtc: (Rtc) : Rtc objet
564 dms: (Dms) : Dms object
566 wfs: (Sensors) : Sensors object
568 tel: (Telescope) : Telescope object
570 atmos: (Atmos) : Atmos object
573 dataBase: (dict): database used
575 use_DB: (bool): use database or not
579 if p_controller.do_kl_imat:
580 IF = basis.compute_IFsparse(dms, p_dms, p_geom).T
581 M2V, _ = basis.compute_btt(IF[:, :-2], IF[:, -2:].toarray())
582 print(
"Filtering ", p_controller.nModesFilt,
" modes based on mode ordering")
583 M2V = M2V[:, list(range(M2V.shape[1] - 2 - p_controller.nModesFilt)) + [-2, -1]]
585 if len(p_controller.klpush) == 1:
586 p_controller.klpush = p_controller.klpush[0] * np.ones(M2V.shape[1])
587 imats.imat_init(i, rtc, dms, p_dms, wfs, p_wfss, p_tel, p_controller, M2V,
588 dataBase=dataBase, use_DB=use_DB)
590 if p_controller.modopti:
591 print(
"Initializing Modal Optimization : ")
592 p_controller.nrec = int(2**np.ceil(np.log2(p_controller.nrec)))
593 if p_controller.nmodes
is None:
594 p_controller.nmodes = sum([p_dms[j]._ntotact
for j
in range(len(p_dms))])
596 IF = basis.compute_IFsparse(dms, p_dms, p_geom).T
597 M2V, _ = basis.compute_btt(IF[:, :-2], IF[:, -2:].toarray())
598 M2V = M2V[:, list(range(p_controller.nmodes - 2)) + [-2, -1]]
600 rtc.d_control[i].init_modalOpti(p_controller.nmodes, p_controller.nrec, M2V,
601 p_controller.gmin, p_controller.gmax,
602 p_controller.ngain, 1. / ittime)
603 ol_slopes = modopti.open_loopSlp(tel, atmos, wfs, rtc, p_controller.nrec, i,
605 rtc.d_control[i].loadopen_loopSlp(ol_slopes)
606 rtc.d_control[i].modalControlOptimization()
608 cmats.cmat_init(i, rtc, p_controller, p_wfss, p_atmos, p_tel, p_dms,
609 nmodes=p_controller.nmodes)
611 rtc.d_control[i].set_gain(p_controller.gain)
613 sum([p_dms[j]._ntotact
for j
in range(len(p_dms))]), dtype=np.float32)
616 mgain[cc:cc + ndm._ntotact] = ndm.gain
618 rtc.d_control[i].set_modal_gains(mgain)
622 p_dms: list, p_wfss: list):
623 """ Initialize the CURED controller
626 i : (int) : controller index
628 rtc: (Rtc) : Rtc objet
630 p_controller: (Param_controller) : controller settings
632 p_dms: (list of Param_dms) : dms settings
634 p_wfss: (list of Param_wfs) : wfs settings
637 print(
"initializing cured controller")
638 if (scons.DmType.TT
in [p_dms[j].type
for j
in range(len(p_dms))]):
642 rtc.d_control[i].init_cured(p_wfss[0].nxsub, p_wfss[0]._isvalid,
643 p_controller.cured_ndivs, tt_flag)
644 rtc.d_control[i].set_gain(p_controller.gain)
648 p_geom: conf.Param_geom, p_dms: list, p_atmos: conf.Param_atmos,
649 p_tel: conf.Param_tel, rtc: Rtc, dms: Dms, wfs: Sensors,
651 """ Initialize the MV controller
654 i : (int) : controller index
656 p_controller: (Param_controller) : controller settings
658 p_wfss: (list of Param_wfs) : wfs settings
660 p_geom: (Param_geom) : geom settings
662 p_dms: (list of Param_dms) : dms settings
664 p_atmos: (Param_atmos) : atmos settings
666 p_tel: (Param_tel) : telescope settings
668 rtc: (Rtc) : Rtc objet
670 dms: (Dms) : Dms object
672 wfs: (Sensors) : Sensors object
674 atmos: (Atmos) : Atmos object
676 p_controller._imat = imats.imat_geom(wfs, dms, p_wfss, p_dms, p_controller)
678 rtc.d_control[i].set_imat(p_controller._imat)
679 rtc.d_control[i].set_gain(p_controller.gain)
680 size = sum([p_dms[j]._ntotact
for j
in range(len(p_dms))])
681 mgain = np.ones(size, dtype=np.float32)
682 rtc.d_control[i].set_modal_gains(mgain)
683 tomo.do_tomo_matrices(i, rtc, p_wfss, dms, atmos, wfs, p_controller, p_geom, p_dms,
685 cmats.cmat_init(i, rtc, p_controller, p_wfss, p_atmos, p_tel, p_dms)
690 """ Initialize the generic controller
693 i: (int): controller index
695 p_controller: (Param_controller): controller settings
697 p_dms: (list of Param_dm): dms settings
699 rtc: (Rtc): Rtc object
701 size = sum([p_dms[j]._ntotact
for j
in range(len(p_dms))])
702 decayFactor = np.ones(size, dtype=np.float32)
703 mgain = np.ones(size, dtype=np.float32) * p_controller.gain
704 matE = np.identity(size, dtype=np.float32)
705 cmat = np.zeros((size, p_controller.nslope), dtype=np.float32)
707 if p_controller.command_law
is not None:
708 rtc.d_control[i].set_commandlaw(p_controller.command_law)
710 rtc.d_control[i].set_decayFactor(decayFactor)
711 rtc.d_control[i].set_modal_gains(mgain)
712 rtc.d_control[i].set_cmat(cmat)
713 rtc.d_control[i].set_matE(matE)
716 """ Configures the generic controller based on set parameters.
719 i: (int): controller index
721 p_controller: (Param_controller): controller settings
723 p_dms: (list of Param_dm): dms settings
725 rtc: (Rtc): Rtc object
727 if not p_controller.get_modal()
or p_controller.get_nmodes()
is None:
728 p_controller.set_nmodes(p_controller.get_nactu())
729 if p_controller.get_nstate_buffer() == 0:
730 p_controller.set_nstates(p_controller.get_nmodes())
Python package for AO operations on COMPASS simulation.
Parameter classes for COMPASS.
Numerical constants for shesha and config enumerations for safe-typing.
def init_centroider(context, int nwfs, conf.Param_wfs p_wfs, conf.Param_centroider p_centroider, conf.Param_tel p_tel, conf.Param_atmos p_atmos, Sensors wfs, Rtc rtc)
Initialize a centroider object in Rtc.
def init_controller_generic(int i, conf.Param_controller p_controller, list p_dms, Rtc rtc)
Initialize the generic controller.
Rtc rtc_standalone(carmaWrap_context context, int nwfs, list nvalid, int nactu, list centroider_type, list delay, list offset, list scale, bool brahma=False, bool fp16=False, bool cacao=False)
Initialize all the SutraRtc objects : centroiders and controllers.
def configure_generic_linear(conf.Param_controller p_controller)
Configures the generic controller based on set parameters.
def init_controller(context, int i, conf.Param_controller p_controller, list p_wfss, conf.Param_geom p_geom, list p_dms, conf.Param_atmos p_atmos, float ittime, conf.Param_tel p_tel, Rtc rtc, Dms dms, Sensors wfs, Telescope tel, Atmos atmos, List[conf.Param_centroider] p_centroiders, do_refslp=False, dataBase={}, use_DB=False)
Initialize the controller part of rtc.
def init_controller_mv(int i, conf.Param_controller p_controller, list p_wfss, conf.Param_geom p_geom, list p_dms, conf.Param_atmos p_atmos, conf.Param_tel p_tel, Rtc rtc, Dms dms, Sensors wfs, Atmos atmos)
Initialize the MV controller.
def init_controller_cured(int i, Rtc rtc, conf.Param_controller p_controller, list p_dms, list p_wfss)
Initialize the CURED controller.
def init_controller_ls(int i, conf.Param_controller p_controller, list p_wfss, conf.Param_geom p_geom, list p_dms, conf.Param_atmos p_atmos, float ittime, conf.Param_tel p_tel, Rtc rtc, Dms dms, Sensors wfs, Telescope tel, Atmos atmos, dict dataBase={}, bool use_DB=False)
Initialize the least square controller.
def init_controller_geo(int i, Rtc rtc, Dms dms, conf.Param_geom p_geom, conf.Param_controller p_controller, list p_dms, roket=False)
Initialize geometric controller.
def rtc_init(carmaWrap_context context, Telescope tel, Sensors wfs, Dms dms, Atmos atmos, list p_wfss, conf.Param_tel p_tel, conf.Param_geom p_geom, conf.Param_atmos p_atmos, float ittime, p_centroiders=None, p_controllers=None, p_dms=None, do_refslp=False, brahma=False, cacao=False, tar=None, dataBase={}, use_DB=False)
Initialize all the SutraRtc objects : centroiders and controllers.
def comp_weights(conf.Param_centroider p_centroider, conf.Param_wfs p_wfs, int npix)
Compute the weights used by centroider wcog and corr.
Python package for COMPASS simulation initialization.