forked from saltastro/timDIMM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguide_gto900.py
executable file
·61 lines (50 loc) · 1.18 KB
/
guide_gto900.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
#!/usr/bin/env python
import os
import time
import numpy as np
from pygto900 import GTO900
#set up the telescope
def guide_gto900(tol=100):
"""Script for guiding the GTO900 based on the output from measure_seeing"""
#set up the telescope
g = GTO900()
side = g.pier()
side = side.strip().lower()
#set up the data
data = np.loadtxt('init_cen_all')
minx=min(1000.0, data[0,0], data[1,0])
maxx=max(0.0, data[0,0], data[1,0])
miny=min(1000.0, data[0,1], data[1,1])
maxy=max(0.0, data[0,1], data[1,1])
print side
print minx, maxx, miny, maxy
g.set_center_rate(2)
if maxx > 320-tol:
print "Move South."
g.move('s')
if minx < tol:
print "Move North."
g.move('n')
if miny < tol:
if side == 'w':
print "Move West."
g.move('w')
else:
print "Move East."
g.move('e')
if maxy > 240-tol:
if side == 'w':
print "Move East."
g.move('e')
else:
print "Move West."
g.move('w')
time.sleep(1)
g.haltall()
time.sleep(1)
g.clear()
g.clear()
g.clear()
g.close()
if __name__=='__main__':
guide_gto900()