COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
sourceCompass.py
1 
37 from typing import List
38 
39 class SourceCompass(object):
40  """ Source handler for compass simulation
41 
42  Attributes:
43  sources : (List) : List of SutraSource instances
44  """
45  def __init__(self, sources : List):
46  """ Initialize a SourceCompass component for target and wfs source related supervision
47 
48  Args:
49  sources : (List) : List of SutraSource instances
50  """
51  self.sourcessources = sources
52 
53  def raytrace(self, index, *, tel=None, atm=None, dms=None, ncpa : bool=True, reset : bool = True, comp_avg_var : bool = True) -> None:
54  """ Performs the raytracing operation through provided object phase screens
55  to obtain the phase screen of the SutraSource
56 
57  Args:
58  index : (int) : Index of the source to raytrace in self.sources list
59 
60  Kwargs:
61  tel : (TelescopeCompass) : TelescopeCompass instance.
62  If provided, raytrace through the telescope aberration phase in the pupil
63 
64  atm : (AtmosCompass) : AtmosCompass instance.
65  If provided, raytrace through the layers phase screens
66 
67  dms : (dmsCompass) : DmCompass instance.
68  If provided, raytrace through the DM shapes
69 
70  ncpa : (bool) : If True (default), raytrace through NCPA phase screen of the source (default is array of 0, i.e. no impact)
71 
72  reset: (bool): reset the phase screen before raytracing. Default is True
73  """
74  if (reset):
75  self.sourcessources[index].d_phase.reset()
76 
77  if atm is not None:
78  self.sourcessources[index].raytrace(atm._atmos) # Must be done first because of automatic reset of the phase screen when call
79  if tel is not None:
80  self.sourcessources[index].raytrace(tel._tel)
81  if ncpa:
82  self.sourcessources[index].raytrace()
83  if dms is not None:
84  self.sourcessources[index].raytrace(dms._dms, do_phase_var=comp_avg_var)
Source handler for compass simulation.
None raytrace(self, index, *tel=None, atm=None, dms=None, bool ncpa=True, bool reset=True, bool comp_avg_var=True)
Performs the raytracing operation through provided object phase screens to obtain the phase screen of...
sources
(List) : List of SutraSource instances