COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
sourceCompass.py
1 
37 import numpy as np
38 from typing import List
39 
40 class SourceCompass(object):
41  """ Source handler for compass simulation
42 
43  Attributes:
44  sources : (List) : List of SutraSource instances
45  """
46  def __init__(self, sources : List):
47  """ Initialize a SourceCompass component for target and wfs source related supervision
48 
49  Parameters:
50  sources : (List) : List of SutraSource instances
51  """
52  self.sources = sources
53 
54  def raytrace(self, index, *, tel=None, atm=None, dms=None, ncpa : bool=True, reset : bool = True) -> None:
55  """ Performs the raytracing operation through provided object phase screens
56  to obtain the phase screen of the SutraSource
57 
58  Parameters :
59  index : (int) : Index of the source to raytrace in self.sources list
60 
61  tel : (TelescopeCompass, optional) : TelescopeCompass instance.
62  If provided, raytrace through the telescope aberration phase in the pupil
63 
64  atm : (AtmosCompass, optional) : AtmosCompass instance.
65  If provided, raytrace through the layers phase screens
66 
67  dms : (dmsCompass, optional) : DmCompass instance.
68  If provided, raytrace through the DM shapes
69 
70  ncpa : (bool, optional) : If True (default), raytrace through NCPA phase screen of the source (default is array of 0, i.e. no impact)
71 
72  rst: (bool): reset the phase screen before raytracing. Default is True
73  """
74  if (reset):
75  self.sources[index].d_phase.reset()
76 
77  if atm is not None:
78  self.sources[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.sources[index].raytrace(tel.tel)
81  if dms is not None:
82  self.sources[index].raytrace(dms.dms)
83  if ncpa:
84  self.sources[index].raytrace()
85 
shesha.supervisor.components.sourceCompass.SourceCompass
Source handler for compass simulation.
Definition: sourceCompass.py:44
shesha.supervisor.components.sourceCompass.SourceCompass.sources
sources
Initialize a SourceCompass component for target and wfs source related supervision.
Definition: sourceCompass.py:54
shesha.supervisor.components.sourceCompass.SourceCompass.raytrace
None raytrace(self, index, *tel=None, atm=None, dms=None, bool ncpa=True, bool reset=True)
Performs the raytracing operation through provided object phase screens to obtain the phase screen of...
Definition: sourceCompass.py:75
shesha.supervisor.components.sourceCompass.SourceCompass.__init__
def __init__(self, List sources)
Definition: sourceCompass.py:53