-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRASHG_functions.py
53 lines (46 loc) · 1.42 KB
/
RASHG_functions.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
53
from pyvcam import pvc
from pyvcam.camera import Camera
from K10CR1.k10cr1 import K10CR1
#import thorpy as apt
def InitializeInstruments():
"""
Initializes the camera and rotators to the desired names.
TODO: Figure out how to set the camera to 'quantview' mode.
Parameters
----------
Returns
-------
cam : object
Named pyvcam camera object.
A : object
Named Instrumental instrument object.
B : object
Named Instrumental instrument object.
C : object
Named Instrumental instrument object.
"""
pvc.init_pvcam() # Initialize PVCAM
try:
cam = next(Camera.detect_camera()) # Use generator to find first camera
cam.open() # Open the camera.
if cam.is_open:
print("Camera open")
except:
raise Exception("Error: camera not found")
Rotational = "K10CR1"
if Rotational == "K10CR1":
l = ["55001000", "55114554","55114654"]
L = [K10CR1(i) for i in l] # There is no serial number
for i in L:
print(f'Homing stage {i}')
i.home()
elif Rotational == "thorlabs_apt":
l = apt.list_available_devices()
L = [apt.Motor(i[1]) for i in l]
for i in L:
i.set_move_home_parameters(2, 1, 10, 0)
i.set_velocity_parameters(0, 10, 10)
i.move_home()
elif Rotational == "thorpy":
pass
return cam, *L