BioImager  4.9.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
hardware.py
1#!/usr/bin/env python3
2
3
19
20"""Interactive tests for hardware.
21"""
22
23import time
24
25import numpy
26
27
28def test_mirror_actuators(dm, time_interval=0.5):
29 """Iterate over all actuators of a deformable mirror.
30
31 Args:
32 dm (microscope.abc.DeformableMirror): The mirror to test.
33 time_interval (float): Number of seconds between trying each
34 actuator.
35 """
36 base_value = 0.5
37 data = numpy.full((dm.n_actuators), base_value)
38 dm.apply_pattern(data)
39
40 time.sleep(time_interval)
41 for new_value in [1.0, 0.0]:
42 for i in range(dm.n_actuators):
43 data[i] = new_value
44 dm.apply_pattern(data)
45 time.sleep(time_interval)
46 data[i] = base_value
47
48 dm.apply_pattern(data)