-
Notifications
You must be signed in to change notification settings - Fork 1
/
GetLiveImage.py
37 lines (32 loc) · 1.01 KB
/
GetLiveImage.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
import qhyccd
import time
import numpy as np
from time import strftime,localtime
qc = qhyccd.qhyccd()
def live():
qc.BeginLive()
while(True):
#time.sleep(0.001)
img = qc.GetLiveFrame()
server.send_img( img )
#print( time.monotonic() )
qc.StopLive()
def seq_capture_0924(intervalS, durationMin, name):
print("Begin Sequence Capture, interval:", intervalS, "s duration:", durationMin, "min")
qc.SetExposure(100)
qc.SetGain(1)
qc.SetROI(400, 0, 3522, 3522)
counter = 0
total_cycle = int(durationMin * 60 // intervalS)
t_start = time.monotonic()
state = 0
qc.BeginLive()
print("Star capture at", strftime("%Y-%m-%d %H:%M:%S", localtime()) )
for t in range(total_cycle + 4):
t_start = time.monotonic()
img = qc.GetLiveFrame()
print("*", end="")
while(time.monotonic() - t_start < intervalS):
time.sleep(0.001)
print()
print("Stop capture at", strftime("%Y-%m-%d %H:%M:%S", localtime()) )