-
Notifications
You must be signed in to change notification settings - Fork 7
/
api_testing.py
52 lines (43 loc) · 1.1 KB
/
api_testing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/python3
# ----------------------------------------------------
# lumascope_api testing. Not intended for customer
# ----------------------------------------------------
# libraries
# ----------------------------------------------------
import lumascope_api
import time
from PIL import Image
scope = lumascope_api.Lumascope()
# home microscope
scope.xyhome()
scope.set_frame_size(1900,1900)
for t in range(10):
time.sleep(1) # cannot send it new commands to move while its homing
print(10-t)
# # Testing 'CAMERA FUNCTIONS'
# # ----------------------------------------------------
# scope.get_image()
# scope.save_live_image()
# Testing 'INTEGRATED SCOPE FUNCTIONS'
# ----------------------------------------------------
# example step values
x = 59.95*1000
y = 37.48*1000
z = 7253.43
af = 1
ch = 4
fc = 0
ill = 10
gain = 1
auto_gain = 0
exp = 30
step = [x, y, z, af, ch, fc, ill, gain, auto_gain, exp]
# verified functional
scope.goto_step(step)
scope.led_on(3, 1)
time.sleep(5)
# verified functional
AF_min = 0.5
AF_max = 6.0
AF_range = 15.0
scope.autofocus(AF_min, AF_max, AF_range)