This optimizer class handles all the modal basis and DM Influence functions related operations.
More...
|
| def | __init__ (self, config, tel, atmos, dms, target, rtc, wfs) |
| |
| def | apply_volts_and_get_slopes (self, int controller_index, *bool noise=False, bool turbu=False, bool reset=True) |
| | Apply voltages, raytrace, compute WFS image, compute slopes and returns it. More...
|
| |
| np.ndarray | do_imat_modal (self, int controller_index, np.ndarray ampli, np.ndarray modal_basis, *bool noise=False, int nmodes_max=0, bool with_turbu=False, bool push_pull=False) |
| | Computes an interaction matrix from provided modal basis. More...
|
| |
| np.ndarray | do_imat_phase (self, int controller_index, np.ndarray cube_phase, *bool noise=False, int nmodes_max=0, bool with_turbu=False, bool push_pull=False, int wfs_index=0) |
| | Computes an interaction matrix with the provided cube phase. More...
|
| |
| np.ndarray | compute_modal_residuals (self, np.ndarray projection_matrix, *np.ndarray selected_actus=None) |
| | Computes the modal residual coefficients of the residual phase. More...
|
| |
This optimizer class handles all the modal basis and DM Influence functions related operations.
Definition at line 44 of file calibration.py.
◆ __init__()
| def shesha.supervisor.optimizers.calibration.Calibration.__init__ |
( |
|
self, |
|
|
|
config, |
|
|
|
tel, |
|
|
|
atmos, |
|
|
|
dms, |
|
|
|
target, |
|
|
|
rtc, |
|
|
|
wfs |
|
) |
| |
Definition at line 95 of file calibration.py.
96 reset : (bool, optional) : Flag to reset previous phase screen before raytracing.
99 self.rtc.apply_control(controller_index)
100 for w in range(len(self.config.p_wfss)):
102 self.wfs.raytrace(w, tel=self.tel, atm=self.atmos, dms=self.dms)
◆ apply_volts_and_get_slopes()
| def shesha.supervisor.optimizers.calibration.Calibration.apply_volts_and_get_slopes |
( |
|
self, |
|
|
int |
controller_index, |
|
|
*bool |
noise = False, |
|
|
bool |
turbu = False, |
|
|
bool |
reset = True |
|
) |
| |
Apply voltages, raytrace, compute WFS image, compute slopes and returns it.
- Parameters
- controller_index (int) : Controller index
- noise (bool, optional) : Flag to enable noise for WFS image compuation. Default is False
- turbu (bool, optional) : Flag to enable atmosphere for WFS phase screen raytracing. Default is False
- reset (bool, optional) : Flag to reset previous phase screen before raytracing. Default is True
Definition at line 117 of file calibration.py.
117 modal_basis : (np.ndarray) : modal basis matrix
119 noise : (bool, optional) : Flag to enable noise
for WFS image compuation. Default
is False
121 nmodes_max : (int, optional) : Default
is 0. TODO : description
123 with_turbu : (bool, optional) : Flag to enable atmosphere
for WFS phase screen raytracing.
126 push_pull : (bool, optional) : If
True, imat
is computed
as an average of push
and pull ampli
◆ compute_modal_residuals()
| np.ndarray shesha.supervisor.optimizers.calibration.Calibration.compute_modal_residuals |
( |
|
self, |
|
|
np.ndarray |
projection_matrix, |
|
|
*np.ndarray |
selected_actus = None |
|
) |
| |
Computes the modal residual coefficients of the residual phase.
/!\ It supposed that roket is enabled, and the associated GEO controller is index 1.
Uses the projection matrix computed from compute_modes_to_volts_basis (modalBasis module)
- Parameters
- projection_matrix (np.ndarray) : Modal projection matrix
- selected_actus (np.ndarray) : TODO : description
- Return
- ai (np.ndarray) : Modal coefficients
Definition at line 244 of file calibration.py.
◆ do_imat_modal()
| np.ndarray shesha.supervisor.optimizers.calibration.Calibration.do_imat_modal |
( |
|
self, |
|
|
int |
controller_index, |
|
|
np.ndarray |
ampli, |
|
|
np.ndarray |
modal_basis, |
|
|
*bool |
noise = False, |
|
|
int |
nmodes_max = 0, |
|
|
bool |
with_turbu = False, |
|
|
bool |
push_pull = False |
|
) |
| |
Computes an interaction matrix from provided modal basis.
- Parameters
- controller_index (int) : Controller index
- ampli (np.ndarray) : amplitude to apply on each mode
- modal_basis (np.ndarray) : modal basis matrix
- noise (bool, optional) : Flag to enable noise for WFS image compuation. Default is False
- nmodes_max (int, optional) : Default is 0. TODO : description
- with_turbu (bool, optional) : Flag to enable atmosphere for WFS phase screen raytracing. Default is False
- push_pull (bool, optional) : If True, imat is computed as an average of push and pull ampli on each mode
- Return
- modal_imat (np.ndarray) : Modal interaction matrix
Definition at line 150 of file calibration.py.
150 modal_imat[:, m] = (devpos - devmin) / (2. * ampli[m])
153 self.rtc.set_perturbation_voltage(controller_index,
"imat_modal", v)
154 modal_imat[:, m] = self.apply_volts_and_get_slopes(controller_index, noise=noise) / ampli[m]
155 self.rtc.remove_perturbation_voltage(controller_index,
"imat_modal")
156 if ((push_pull
is True)
or (with_turbu
is True)):
157 self.rtc.close_loop(controller_index)
160 def do_imat_phase(self, controller_index: int, cube_phase: np.ndarray, *, noise : bool=
False,
161 nmodes_max : int=0, with_turbu : bool=
False, push_pull : bool=
False, wfs_index : int=0) -> np.ndarray:
162 """ Computes an interaction matrix with the provided cube phase
165 controller_index : (int) : Controller index
167 cube_phase : (np.ndarray) : Cube of phase to insert as NCPA
169 noise : (bool, optional) : Flag to enable noise for WFS image compuation. Default is False
171 nmodes_max : (int, optional) : Default is 0. TODO : description
173 with_turbu : (bool, optional) : Flag to enable atmosphere for WFS phase screen raytracing.
176 push_pull : (bool, optional) : If True, imat is computed as an average of push and pull ampli
179 wfs_index : (int, optional) : WFS index. Default is 0
◆ do_imat_phase()
| np.ndarray shesha.supervisor.optimizers.calibration.Calibration.do_imat_phase |
( |
|
self, |
|
|
int |
controller_index, |
|
|
np.ndarray |
cube_phase, |
|
|
*bool |
noise = False, |
|
|
int |
nmodes_max = 0, |
|
|
bool |
with_turbu = False, |
|
|
bool |
push_pull = False, |
|
|
int |
wfs_index = 0 |
|
) |
| |
Computes an interaction matrix with the provided cube phase.
- Parameters
- controller_index (int) : Controller index
- cube_phase (np.ndarray) : Cube of phase to insert as NCPA
- noise (bool, optional) : Flag to enable noise for WFS image compuation. Default is False
- nmodes_max (int, optional) : Default is 0. TODO : description
- with_turbu (bool, optional) : Flag to enable atmosphere for WFS phase screen raytracing. Default is False
- push_pull (bool, optional) : If True, imat is computed as an average of push and pull ampli on each mode
- wfs_index (int, optional) : WFS index. Default is 0
- Return
- phase_imat (np.ndarray) : Phase interaction matrix
Definition at line 202 of file calibration.py.
202 _ = self.apply_volts_and_get_slopes(controller_index, turbu=with_turbu,
207 def compute_modal_residuals(self, projection_matrix : np.ndarray,
208 *, selected_actus : np.ndarray=
None) -> np.ndarray:
209 """ Computes the modal residual coefficients of the residual phase.
211 /!\ It supposed that roket is enabled, and the associated GEO controller is index 1.
213 Uses the projection matrix computed from compute_modes_to_volts_basis (modalBasis module)
216 projection_matrix : (np.ndarray) : Modal projection matrix
218 selected_actus : (np.ndarray) : TODO : description
221 ai : (np.ndarray) : Modal coefficients
224 self.rtc.do_control(1, sources=self.target.sources)
227 v = self.rtc.get_command(1)
228 if (selected_actus
is None):
229 ai = projection_matrix.dot(v) * 1000.
◆ atmos
| shesha.supervisor.optimizers.calibration.Calibration.atmos |
(AtmosScompass) : AtmosCompass instance
Definition at line 98 of file calibration.py.
◆ config
| shesha.supervisor.optimizers.calibration.Calibration.config |
(config) : Configuration parameters module
Definition at line 96 of file calibration.py.
◆ dms
| shesha.supervisor.optimizers.calibration.Calibration.dms |
◆ rtc
| shesha.supervisor.optimizers.calibration.Calibration.rtc |
◆ target
| shesha.supervisor.optimizers.calibration.Calibration.target |
(TargetCompass) : TargetCompass instance
Definition at line 100 of file calibration.py.
◆ tel
| shesha.supervisor.optimizers.calibration.Calibration.tel |
(TelescopeCompass) : TelescopeCompass instance
Definition at line 97 of file calibration.py.
◆ wfs
| shesha.supervisor.optimizers.calibration.Calibration.wfs |
Instantiate a ModalBasis object.
(WfsCompass) : WfsCompass instance
- Parameters
- config (config) : Configuration parameters module
- tel (TelescopeCompass) : TelescopeCompass instance
- atmos (AtmosScompass) : AtmosCompass instance
- dms (DmCompass) : DmCompass instance
- target (TargetCompass) : TargetCompass instance
- rtc (RtcCompass) : RtcCompass instance
- wfs (WfsCompass) : WfsCompass instance
Definition at line 102 of file calibration.py.
The documentation for this class was generated from the following file: