-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPosition Recenterer.py
38 lines (26 loc) · 1.01 KB
/
Position Recenterer.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
import win32com.client
def connect_to_mount(progid):
telescope = win32com.client.Dispatch(progid)
telescope.Connected = True
if telescope.Connected:
print(f"Connected to {telescope.Name}")
return telescope
def slew_to(telescope, ra, dec):
telescope.TargetRightAscension = ra
telescope.TargetDeclination = dec
telescope.SlewToTarget()
def get_current_position(telescope):
current_ra = telescope.RightAscension
current_dec = telescope.Declination
return current_ra, current_dec
def get_slew_speed(telescope):
# SlewSettleTime is used here as an example. It may be different depending on the driver.
slew_speed = telescope.SlewSettleTime
return slew_speed
# Usage example
scope = connect_to_mount("EQMOD.Telescope")
slew_to(scope, 0, 0) # RA and Dec need to be set correctly
current_ra, current_dec = get_current_position(scope)
print(f"Current Position - RA: {current_ra}, Dec: {current_dec}")
slew_speed = get_slew_speed(scope)
print(f"Slew Speed: {slew_speed}")