-
Notifications
You must be signed in to change notification settings - Fork 0
/
andor_camera.py
77 lines (43 loc) · 1.84 KB
/
andor_camera.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import numpy as np
from andor_camera_dll import AndorCameraDll
import time
class AndorCamera():
def __init__(self):
self.camera = AndorCameraDll()
def getCameraTemp(self):
temp, status = self.camera.getTemperature()
return temp, status
def setPreAmpGain(self, index):
self.camera.setPreAmpGain(index)
def setEMGainMode(self, mode):
self.camera.setEMGainMode(mode)
def setEMCCDGain(self, gain):
self.camera.setEMCCDGain(gain)
def setAcquisitionMode(self, mode):
self.camera.setAcquisitionMode(mode)
def setReadMode(self, mode):
self.camera.setReadMode(mode)
def setTriggerMode(self, mode):
self.camera.setTriggerMode(mode)
def setImage(self, hbin, vbin, hstart, hend, vstart, vend):
self.camera.setImage(hbin, vbin, hstart, hend, vstart, vend)
def coolCamera(self, temp):
self.camera.setCoolerMode(1)
self.camera.coolerOn()
self.camera.setTemperature(temp)
def getImage(self):
self.camera.startAcquisition()
self.camera.waitForAcquisition()
image = self.camera.getAcquiredData()
return image
def setShutter(self, typ, mode, closingtime, openingtime):
self.camera.setShutter(typ, mode, closingtime, openingtime)
time.sleep(0.1) # pause to allow shutter to open
def setExposureTime(self, exp_time): # in sec
self.camera.setExposureTime(exp_time)
def coolerOff(self):
self.camera.coolerOff()
def shutDown(self):
self.camera.shutDown()
def abortAcquisition(self):
self.camera.abortAcquisition()