Deformable Mirror¶
Initialize a Deformable Mirror (DM) with zonal or modal influence functions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
telescope
|
Telescope
|
Telescope associated with this DM. |
required |
nActs
|
float
|
Number of actuators in the horizontal axis of the pupil. |
required |
mechCoupling
|
float
|
Coupling factor between actuators, by default 0.60. |
0.6
|
coordinates
|
ndarray
|
Custom actuator coordinates. |
None
|
pitch
|
float
|
Actuator pitch in meters. |
None
|
modes
|
ndarray
|
Influence functions or modal basis. |
None
|
misReg
|
MisRegistration
|
Misregistration object for geometrical offsets. |
None
|
typeDM
|
str
|
Type of the DM: {cartesian, radial, custom}. By default, cartesian. If 'custom', the |
'cartesian'
|
floating_precision
|
int
|
Use 32 or 64-bit floats, by default 64. |
64
|
altitude
|
float
|
Conjugation altitude of the DM in meters. |
None
|
flip
|
bool
|
Flip the influence functions vertically. |
False
|
flip_lr
|
bool
|
Flip the influence functions left-right. |
False
|
sign
|
int
|
Sign of actuation. |
1
|
valid_act_thresh_outer
|
float
|
Threshold for validating actuators outside pupil. |
None
|
logger
|
Logger
|
Logger instance. |
None
|
**kwargs
|
dict
|
Additional keyword arguments. validActThreshpercentage : float, optional Parameter to select a percentage of the actuator pitch to consider it valid o not. maxStrokePtV : float, optional Maximum mechanical stroke peak-to-valley in [m]. By default 100e-6 [m]. dynamicModel : str, optional Path to the h5 file containing the state-space model of the Deformable Mirror. projector : np.ndarray, optional Projector matrix used only when typeDM is 'custom'. Transforms the input coefficients into the custom modal basis. |
{}
|
Source code in SAOS/DeformableMirror.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
misReg
instance-attribute
¶
validActThreshpercentage
instance-attribute
¶
projector
instance-attribute
¶
generate_cartesian_dm ¶
Generates a distribution of cartesian points and a logic mask filtering the points that are within the limits of the external pupil diameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nActs
|
int
|
Number of actuators in the square side |
required |
Returns:
| Name | Type | Description |
|---|---|---|
coordinates |
ndarray
|
X and Y coordinates aranged as [nActs**2,2] |
validAct |
ndarray
|
Logic mask of valid actuators |
nValidAct |
int
|
Number of valid actuators |
Source code in SAOS/DeformableMirror.py
generate_radial_dm ¶
Generate a distribution of radial actuator points approximated by a hexagonal grid, with a logic mask filtering the points within the external pupil diameter.
Returns:
| Name | Type | Description |
|---|---|---|
coordinates |
ndarray
|
X and Y coordinates arranged as [nActs, 2]. |
validAct |
ndarray
|
Boolean mask of valid actuators. |
nValidAct |
int
|
Number of valid actuators. |
Source code in SAOS/DeformableMirror.py
generate_custom_dm ¶
Generate a custom distribution of actuator points based on provided coordinates, with a logic mask filtering the points within the external pupil diameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
custom_coordinates
|
ndarray
|
X and Y coordinates arranged as [N, 2]. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
coordinates |
ndarray
|
X and Y coordinates arranged as [N, 2]. |
validAct |
ndarray
|
Boolean mask of valid actuators. |
nValidAct |
int
|
Number of valid actuators. |
Source code in SAOS/DeformableMirror.py
precomputeGaussianRBFInterpolant ¶
Generates a distribution of radial points approximated by hexagons, and a logic mask filtering the points that are within the limits of the external pupil diameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_points
|
ndarray
|
Coordinates of the mirror actuators |
required |
output_points
|
ndarray
|
Coordinates of the high resolution output grid |
required |
epsilon
|
float
|
Radial scaling factor for the Gaussian fitting |
required |
Returns:
| Name | Type | Description |
|---|---|---|
L |
Tensor
|
Triangular Cholesky descomposition matrix |
phi_eval |
Tensor
|
Inteprolator based on output - input Euclidean distance |
Source code in SAOS/DeformableMirror.py
buildLayer ¶
Construct and configure the DM layer at a given conjugation altitude.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
telescope
|
Telescope
|
Telescope providing aperture and resolution information. |
required |
altitude
|
float
|
Altitude in meters to conjugate the DM layer. |
required |
Returns:
| Type | Description |
|---|---|
dmLayerClass
|
Configured DM layer with geometric and aperture metadata. |
Source code in SAOS/DeformableMirror.py
get_dm_pupil ¶
Compute pupil mask seen by a source at the DM altitude.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src
|
Source
|
Source object with angular position. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Binary square mask (1s where the source is affected). |
Source code in SAOS/DeformableMirror.py
get_dm_opd ¶
Compute the Optical Path Difference (OPD) and phase from the DM for a given source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Source
|
Source object defining wavelength and position. |
required |
Returns:
| Type | Description |
|---|---|
tuple of np.ndarray
|
OPD in meters and phase in radians. |
Source code in SAOS/DeformableMirror.py
saturateShape ¶
Saturate the command of the mirror.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmd
|
ndarray
|
Command required from the mirror. |
required |
Returns:
| Type | Description |
|---|---|
cmd_saturated
|
Command executed by the mirror. |
Source code in SAOS/DeformableMirror.py
load_dynamic_model ¶
Load the state-space model of the deformable mirror from an HDF5 file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path to the H5 file containing the discrete state-space matrices. |
required |
samplingTime
|
float
|
Sampling time used to discretize the model [s]. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
Tensor
|
Discrete state-transition matrix. |
B |
Tensor
|
Discrete input-state matrix. |
C |
Tensor
|
Discrete state-output matrix. |
D |
Tensor
|
Discrete feedthrough matrix. |
Source code in SAOS/DeformableMirror.py
applyDynamics ¶
Apply a state-space to the command of the mirror to obtain the temporal response of the mirror
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmd
|
Tensor
|
Command required from the mirror. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dyn_cmd |
Tensor
|
Temporal command executed by the mirror. |
Source code in SAOS/DeformableMirror.py
updateDMShape ¶
Update the OPD map from the current coefficients or 2D grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
val
|
ndarray
|
Either a coefficient vector or a 2D shape map. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if update was successful. |
Source code in SAOS/DeformableMirror.py
updateMisreg ¶
Update the mis-registration params by the temporal factor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
elapsedTime
|
float
|
Time elapsed in seconds. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if updated successfully. |
Source code in SAOS/DeformableMirror.py
print_properties ¶
Print a summary of the DM configuration.
Returns:
| Type | Description |
|---|---|
None
|
|