shesha.supervisor

class shesha.supervisor.compassSupervisor.CompassSupervisor(config, *, cacao: bool = False)

This class implements generic supervisor to handle compass simulation

Attributes:

context : (CarmaContext) : a CarmaContext instance

config : (config) : Parameters structure

telescope : (TelescopeComponent) : a TelescopeComponent instance

atmos : (AtmosComponent) : An AtmosComponent instance

target : (targetComponent) : A TargetComponent instance

wfs : (WfsComponent) : A WfsComponent instance

dms : (DmComponent) : A DmComponent instance

rtc : (RtcComponent) : A Rtc component instance

is_init : (bool) : Flag equals to True if the supervisor has already been initialized

iter : (int) : Frame counter

cacao : (bool) : CACAO features enabled in the RTC

basis : (ModalBasis) : a ModalBasis instance (optimizer)

calibration : (Calibration) : a Calibration instance (optimizer)

export_config()

Extract and convert compass supervisor configuration parameters into 2 dictionnaries containing relevant AO parameters

Args:

root: (object), COMPASS supervisor object to be parsed

Returns : 2 dictionnaries

get_i_pupil()

Returns the so called I Pupil of COMPASS

Return np.array

get_m_pupil()

Returns the so called M Pupil of COMPASS

Return np.array

get_s_pupil()

Returns the so called S Pupil of COMPASS

Return np.array

next(*, move_atmos: bool = True, nControl: int = 0, tar_trace: Optional[Iterable[int]] = None, wfs_trace: Optional[Iterable[int]] = None, do_control: bool = True, apply_control: bool = True, compute_tar_psf: bool = True)None

Iterates the AO loop, with optional parameters.

Overload the GenericSupervisor next() method to handle the GEO controller specific raytrace order operations

Kwargs:

move_atmos: (bool): move the atmosphere for this iteration. Default is True

nControl: (int): Controller number to use. Default is 0 (single control configuration)

tar_trace: (List): list of targets to trace. None is equivalent to all (default)

wfs_trace: (List): list of WFS to trace. None is equivalent to all (default)

do_control : (bool) : Performs RTC operations if True (Default)

apply_control: (bool): if True (default), apply control on DMs

compute_tar_psf : (bool) : If True (default), computes the PSF at the end of the iteration

record_ao_circular_buffer(cb_count: int, sub_sample: int = 1, controller_index: int = 0, tar_index: int = 0, see_atmos: bool = True, cube_data_type: Optional[str] = None, cube_data_file_path: str = '', ncpa: int = 0, ncpa_wfs: Optional[numpy.ndarray] = None, ref_slopes: Optional[numpy.ndarray] = None, ditch_strehl: bool = True, projection_matrix: Optional[numpy.ndarray] = None)

Used to record a synchronized circular buffer AO loop data.

Args:

cb_count: (int) : the number of iterations to record.

sub_sample: (int) : sub sampling of the data (default=1, I.e no subsampling)

controller_index: (int) :

tar_index: (int) : target number

see_atmos: (int) : used for the next function to enable or not the Atmos

cube_data_type: (int) : if specified (“tarPhase” or “psfse”) returns the target phase or short exposure PSF data cube in the output variable

cube_data_file_path: (int) : if specified it will also save the target phase cube data (full path on the server)

ncpa: (int) : !!experimental!!!: Used only in the context of PYRWFS + NCPA compensation on the fly (with optical gain) defines how many iters the NCPA refslopes are updates with the proper optical gain. Ex: if NCPA=10 refslopes will be updates every 10 iters.

ncpa_wfs: (int) : the ncpa phase as seen from the wfs array with dims = size of Mpupil

ref_slopes: (int) : the reference slopes to use.

ditch_strehl: (int) : resets the long exposure SR computation at the beginning of the Circular buffer (default= True)

projection_matrix : (np.ndarray) : projection matrix on modal basis to compute residual coefficients

Return:

slopes: (int) : the slopes CB

volts: (int) : the volts applied to the DM(s) CB

ai: (int) : the modal coefficient of the residual phase projected on the currently used modal Basis

psf_le: (int) : Long exposure PSF over the <cb_count> iterations (I.e SR is reset at the begining of the CB if ditch_strehl=True)

sthrel_se_list: (int) : The SR short exposure evolution during CB recording

sthrel_le_list: (int) : The SR long exposure evolution during CB recording

g_ncpa_list: (int) : the gain applied to the NCPA (PYRWFS CASE) if NCPA is set to True

cube_data: (int) : the tarPhase or psfse cube data (see cube_data_type)