62 """Imagine Optic Mirao 52e deformable mirror.
64 The Mirao 52e deformable mirrors only support software trigger.
68 def __init__(self, **kwargs) -> None:
69 super().__init__(**kwargs)
74 self.
_status = ctypes.pointer(ctypes.c_int(mro.OK))
77 "failed to open mirao mirror (error code %d)"
82 def n_actuators(self) -> int:
83 return mro.NB_COMMAND_VALUES
88 mirao52e SDK expects values in the [-1 1] range, so we normalize
89 them from the [0 1] range we expect in our interface.
91 patterns = (patterns * 2) - 1
94 def _do_apply_pattern(self, pattern: numpy.ndarray) ->
None:
96 command = pattern.ctypes.data_as(mro.Command)
97 if not mro.applyCommand(command, mro.FALSE, self.
_status):
100 def _raise_status(self, func: typing.Callable) ->
None:
101 error_code = self.
_status.contents.value
103 "mro_%s() failed (error code %d)" % (func.__name__, error_code)
107 if not mro.close(self.
_status):