COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
modopti.py
1 
37 
38 import numpy as np
39 from shesha.sutra_wrap import Sensors, Telescope, Rtc_FFF as Rtc, Atmos
40 
41 
42 def open_loopSlp(tel: Telescope, atmos: Atmos, wfs: Sensors, rtc: Rtc, nrec: int,
43  ncontrol: int, p_wfss: list):
44  """ Return a set of recorded open-loop slopes, usefull for initialize modal control optimization
45 
46  :parameters:
47 
48  tel: (Telescope) : Telescope object
49 
50  atmos: (Atmos) : Atmos object
51 
52  wfs: (Sensors) : Sensors object
53 
54  rtc: (Rtc) : Rtc object
55 
56  nrec: (int) : number of samples to record
57 
58  ncontrol: (int) : controller's index
59 
60  p_wfss: (list of Param_wfs) : wfs settings
61  """
62  # TEST IT
63  ol_slopes = np.zeros((sum([2 * p_wfss[i]._nvalid
64  for i in range(len(p_wfss))]), nrec), dtype=np.float32)
65 
66  print("Recording " + str(nrec) + " open-loop slopes...")
67  for i in range(nrec):
68  atmos.move_atmos()
69 
70  if (p_wfss is not None and wfs is not None):
71  for j in range(len(p_wfss)):
72  wfs.d_wfs[j].d_gs.raytrace(atmos)
73  wfs.d_wfs[j].d_gs.raytrace(tel)
74  wfs.d_wfs[j].comp_image()
75  rtc.d_centro[j].get_cog()
76  ol_slopes[j * p_wfss[j]._nvalid * 2:(j + 1) * p_wfss[j]._nvalid *
77  2, i] = np.array(wfs.d_wfs[j].d_slopes)
78  print("Done")
79  return ol_slopes
shesha.sutra_wrap
Definition: sutra_wrap.py:1
shesha.ao.modopti.open_loopSlp
def open_loopSlp(Telescope tel, Atmos atmos, Sensors wfs, Rtc rtc, int nrec, int ncontrol, list p_wfss)
Return a set of recorded open-loop slopes, usefull for initialize modal control optimization.
Definition: modopti.py:60