COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
sutraWrap.Source Class Reference
Collaboration diagram for sutraWrap.Source:

Public Member Functions

str __str__ (self)
 
int add_layer (self, str context, int type, float xoff, float yoff)
 Add a phase screen "dm" or "atmos" as layers to consider for raytracing. More...
 
int comp_image (self, int puponly=0, bool comp_le=True)
 Compute short and long exposure images. More...
 
int comp_strehl (self, bool do_fit=True)
 Compute Strehl ratio. More...
 
int init_strehlmeter (self)
 Initialize Strehl ratio computation. More...
 
int raytrace (self, bool rst=False)
 Raytrace through ncpa layers. More...
 
int raytrace (self, Telescope tel, bool rst=False)
 
int raytrace (self, Atmos atmos, bool do_async=False)
 
int raytrace (self, Dms dms, bool rst=False, bool do_phase_var=True, bool do_async=False)
 
int raytrace (self, Telescope dms, Atmos atm, Dms tel, bool do_phase_var=True, bool do_async=False)
 
int remove_layer (self, str type, int idx)
 Remove a phase screen for raytracing. More...
 
int reset_phase (self)
 Reset the phase screen. More...
 
int reset_strehlmeter (self)
 Reset Strehl ratio. More...
 
None set_ncpa (self, numpy.ndarray[numpy.float32] data)
 Set the NCPA phase. More...
 
None set_phase (self, numpy.ndarray[numpy.float32] data)
 Set the target screen phase. More...
 

Properties

 G = property
 Magnifying factor for WFS misalignment. More...
 
 block_size = property
 Optimum block size of device. More...
 
 d_amplipup = property
 Complex amplitude in the pupil plane. More...
 
 d_image_le = property
 Long exposure image of the source. More...
 
 d_image_se = property
 Short exposure image of the source. More...
 
 d_lgs = property
 LGS structure of WFS. More...
 
 d_ncpa_phase = property
 NCPA phase. More...
 
 d_phase = property
 Phase screen of the source. More...
 
 d_phasepts = property
 Phase on the valid pixels of the pupil plane. More...
 
 d_pupil = property
 Pupil mask. More...
 
 d_wherephase = property
 Indices of the valid pixels of the pupil. More...
 
 device = property
 GPU device index. More...
 
 dx = property
 X axis WFS misalignment [pixels]. More...
 
 dy = property
 Y axis WFS misalignment [pixels]. More...
 
 lambda_um = property
 Wavelength of the source in µm. More...
 
 lgs = property
 Boolean for LGS. More...
 
 mag = property
 Magnitude of the source. More...
 
 npts = property
 Number of points in the pupil. More...
 
 phase_telemetry = property
 TODO docstring. More...
 
 phase_var = property
 Short exposure variance in the pupil [µm²]. More...
 
 phase_var_avg = property
 Long exposure variance in the pupil [µm²]. More...
 
 phase_var_count = property
 Counter fo long exposure variance computation. More...
 
 posx = property
 X position of the source. More...
 
 posy = property
 Y position of the source. More...
 
 ref_strehl = property
 reference for Strehl computation (Airy) More...
 
 scale = property
 Phase scale factor (2*pi/lambda) More...
 
 strehl_counter = property
 Counter for LE Strehl computation. More...
 
 strehl_le = property
 Long exposure Strehl ratio. More...
 
 strehl_se = property
 Short exposure Strehl ratio. More...
 
 thetaML = property
 Pupil rotation angle for WFS misalignment. More...
 
 type = property
 Type of source (Target or WFS GS) More...
 
 xoff = property
 X offset for raytracing. More...
 
 yoff = property
 Y offset for raytracing. More...
 
 zp = property
 Flux at magnitude 0. More...
 

Detailed Description

Definition at line 8053 of file sutraWrap.py.

Member Function Documentation

◆ __str__()

str sutraWrap.Source.__str__ (   self)

Definition at line 8054 of file sutraWrap.py.

◆ add_layer()

int sutraWrap.Source.add_layer (   self,
str  context,
int  type,
float  xoff,
float  yoff 
)

Add a phase screen "dm" or "atmos" as layers to consider for raytracing.

Parameters
context(CarmaContext) : carma or carmaWrap context
type(str) : "atmos" or "dm"
xoff(float) : x-offset for raytracing
yoff(float) : y-offset for raytracing

Definition at line 8068 of file sutraWrap.py.

◆ comp_image()

int sutraWrap.Source.comp_image (   self,
int   puponly = 0,
bool   comp_le = True 
)

Compute short and long exposure images.

Parameters
puponly(int) : Airy computation
comp_le(bool) : Flag for computing LE image

Definition at line 8078 of file sutraWrap.py.

◆ comp_strehl()

int sutraWrap.Source.comp_strehl (   self,
bool   do_fit = True 
)

Compute Strehl ratio.

Definition at line 8082 of file sutraWrap.py.

◆ init_strehlmeter()

int sutraWrap.Source.init_strehlmeter (   self)

Initialize Strehl ratio computation.

Definition at line 8086 of file sutraWrap.py.

◆ raytrace() [1/5]

int sutraWrap.Source.raytrace (   self,
Atmos  atmos,
bool   do_async = False 
)

Definition at line 8144 of file sutraWrap.py.

Here is the call graph for this function:

◆ raytrace() [2/5]

int sutraWrap.Source.raytrace (   self,
bool   rst = False 
)

Raytrace through ncpa layers.

Parameters
rst(bool): reset screen phase before raytracing
    Raytrace through telescope aberrations
Parameters
tel(SutraTelescope): SutraTelescope object
rst(bool): reset screen phase before raytracing
    Raytrace through turbulent layers. Calling this function will automatically reset the screen phase before raytracing.
Parameters
atmos(SutraAtmos): SutraAtmos object
do_async(bool): asynchronous mode
    Raytrace through DMs
Parameters
dms(SutraDms): SutraDms object
rst(bool): reset phase screen before raytracing
do_phase_var(bool): compute the residual phase variance
do_async(bool): asynchronous mode
    Raytrace through all layers (turbu, dms, telescope, ncpa)
Parameters
tel(sutra_tel): SutraTelescope object
atm(SutraAtmos): SutraAtmos object
dms(SutraDms): SutraDms object
do_phase_var(bool): compute the residual phase variance
do_async(bool): asynchronous mode

Definition at line 8140 of file sutraWrap.py.

Here is the caller graph for this function:

◆ raytrace() [3/5]

int sutraWrap.Source.raytrace (   self,
Dms  dms,
bool   rst = False,
bool   do_phase_var = True,
bool   do_async = False 
)

Definition at line 8146 of file sutraWrap.py.

Here is the call graph for this function:

◆ raytrace() [4/5]

int sutraWrap.Source.raytrace (   self,
Telescope  dms,
Atmos  atm,
Dms  tel,
bool   do_phase_var = True,
bool   do_async = False 
)

Definition at line 8148 of file sutraWrap.py.

Here is the call graph for this function:

◆ raytrace() [5/5]

int sutraWrap.Source.raytrace (   self,
Telescope  tel,
bool   rst = False 
)

Definition at line 8142 of file sutraWrap.py.

Here is the call graph for this function:

◆ remove_layer()

int sutraWrap.Source.remove_layer (   self,
str  type,
int  idx 
)

Remove a phase screen for raytracing.

Parameters
type(str) : "atmos" or "dm"
idx(int) : index of the DM or turbulent layer to remove

Definition at line 8158 of file sutraWrap.py.

◆ reset_phase()

int sutraWrap.Source.reset_phase (   self)

Reset the phase screen.

Definition at line 8162 of file sutraWrap.py.

◆ reset_strehlmeter()

int sutraWrap.Source.reset_strehlmeter (   self)

Reset Strehl ratio.

Definition at line 8166 of file sutraWrap.py.

◆ set_ncpa()

None sutraWrap.Source.set_ncpa (   self,
numpy.ndarray[numpy.float32]  data 
)

Set the NCPA phase.

Parameters
data(np.array(ndim=2,dtype=np.float32)): NCPA phase to set

Definition at line 8174 of file sutraWrap.py.

◆ set_phase()

None sutraWrap.Source.set_phase (   self,
numpy.ndarray[numpy.float32]  data 
)

Set the target screen phase.

Parameters
data(np.array(ndim=2,dtype=np.float32)): target phase to set

Definition at line 8181 of file sutraWrap.py.

Property Documentation

◆ block_size

sutraWrap.Source.block_size = property
static

Optimum block size of device.

   @n type of :  int

Definition at line 8197 of file sutraWrap.py.

◆ d_amplipup

sutraWrap.Source.d_amplipup = property
static

Complex amplitude in the pupil plane.

   @n type of :  carmaWrap.obj_float_complex

Definition at line 8206 of file sutraWrap.py.

◆ d_image_le

sutraWrap.Source.d_image_le = property
static

Long exposure image of the source.

   @n type of :  carmaWrap.obj_float

Definition at line 8215 of file sutraWrap.py.

◆ d_image_se

sutraWrap.Source.d_image_se = property
static

Short exposure image of the source.

   @n type of :  carmaWrap.obj_float

Definition at line 8224 of file sutraWrap.py.

◆ d_lgs

sutraWrap.Source.d_lgs = property
static

LGS structure of WFS.

   @n type of :  SutraLGS

Definition at line 8233 of file sutraWrap.py.

◆ d_ncpa_phase

sutraWrap.Source.d_ncpa_phase = property
static

NCPA phase.

   @n type of :  carmaWrap.obj_float

Definition at line 8242 of file sutraWrap.py.

◆ d_phase

sutraWrap.Source.d_phase = property
static

Phase screen of the source.

   @n type of :  carmaWrap.obj_float

Definition at line 8251 of file sutraWrap.py.

◆ d_phasepts

sutraWrap.Source.d_phasepts = property
static

Phase on the valid pixels of the pupil plane.

   @n type of :  carmaWrap.obj_float

Definition at line 8260 of file sutraWrap.py.

◆ d_pupil

sutraWrap.Source.d_pupil = property
static

Pupil mask.

   @n type of :  carmaWrap.obj_float

Definition at line 8269 of file sutraWrap.py.

◆ d_wherephase

sutraWrap.Source.d_wherephase = property
static

Indices of the valid pixels of the pupil.

   @n type of :  carmaWrap.obj_int

Definition at line 8278 of file sutraWrap.py.

◆ device

sutraWrap.Source.device = property
static

GPU device index.

   @n type of :  int

Definition at line 8287 of file sutraWrap.py.

◆ dx

sutraWrap.Source.dx = property
static

X axis WFS misalignment [pixels].

   @n type of :  float

Definition at line 8296 of file sutraWrap.py.

◆ dy

sutraWrap.Source.dy = property
static

Y axis WFS misalignment [pixels].

   @n type of :  float

Definition at line 8305 of file sutraWrap.py.

◆ G

sutraWrap.Source.G = property
static

Magnifying factor for WFS misalignment.

   @n type of :  float

Definition at line 8188 of file sutraWrap.py.

◆ lambda_um

sutraWrap.Source.lambda_um = property
static

Wavelength of the source in µm.

   @n type of :  float

Definition at line 8314 of file sutraWrap.py.

◆ lgs

sutraWrap.Source.lgs = property
static

Boolean for LGS.

   @n type of :  bool

Definition at line 8323 of file sutraWrap.py.

◆ mag

sutraWrap.Source.mag = property
static

Magnitude of the source.

   @n type of :  float

Definition at line 8332 of file sutraWrap.py.

◆ npts

sutraWrap.Source.npts = property
static

Number of points in the pupil.

   @n type of :  int

Definition at line 8341 of file sutraWrap.py.

◆ phase_telemetry

sutraWrap.Source.phase_telemetry = property
static

TODO docstring.

   @n type of :  carmaWrap.host_obj_float

Definition at line 8350 of file sutraWrap.py.

◆ phase_var

sutraWrap.Source.phase_var = property
static

Short exposure variance in the pupil [µm²].

   @n type of :  float

Definition at line 8359 of file sutraWrap.py.

◆ phase_var_avg

sutraWrap.Source.phase_var_avg = property
static

Long exposure variance in the pupil [µm²].

   @n type of :  float

Definition at line 8368 of file sutraWrap.py.

◆ phase_var_count

sutraWrap.Source.phase_var_count = property
static

Counter fo long exposure variance computation.

   @n type of :  int

Definition at line 8377 of file sutraWrap.py.

◆ posx

sutraWrap.Source.posx = property
static

X position of the source.

   @n type of :  float

Definition at line 8386 of file sutraWrap.py.

◆ posy

sutraWrap.Source.posy = property
static

Y position of the source.

   @n type of :  float

Definition at line 8395 of file sutraWrap.py.

◆ ref_strehl

sutraWrap.Source.ref_strehl = property
static

reference for Strehl computation (Airy)

   @n type of :  float

Definition at line 8404 of file sutraWrap.py.

◆ scale

sutraWrap.Source.scale = property
static

Phase scale factor (2*pi/lambda)

   @n type of :  float

Definition at line 8413 of file sutraWrap.py.

◆ strehl_counter

sutraWrap.Source.strehl_counter = property
static

Counter for LE Strehl computation.

   @n type of :  int

Definition at line 8422 of file sutraWrap.py.

◆ strehl_le

sutraWrap.Source.strehl_le = property
static

Long exposure Strehl ratio.

   @n type of :  float

Definition at line 8431 of file sutraWrap.py.

◆ strehl_se

sutraWrap.Source.strehl_se = property
static

Short exposure Strehl ratio.

   @n type of :  float

Definition at line 8440 of file sutraWrap.py.

◆ thetaML

sutraWrap.Source.thetaML = property
static

Pupil rotation angle for WFS misalignment.

   @n type of :  float

Definition at line 8449 of file sutraWrap.py.

◆ type

sutraWrap.Source.type = property
static

Type of source (Target or WFS GS)

   @n type of :  str

Definition at line 8458 of file sutraWrap.py.

◆ xoff

sutraWrap.Source.xoff = property
static

X offset for raytracing.

   @n type of :  typing.Dict[typing.Tuple[str, int], float]

Definition at line 8467 of file sutraWrap.py.

◆ yoff

sutraWrap.Source.yoff = property
static

Y offset for raytracing.

   @n type of :  typing.Dict[typing.Tuple[str, int], float]

Definition at line 8476 of file sutraWrap.py.

◆ zp

sutraWrap.Source.zp = property
static

Flux at magnitude 0.

   @n type of :  float

Definition at line 8485 of file sutraWrap.py.


The documentation for this class was generated from the following file: