-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal_yard.py
More file actions
38 lines (31 loc) · 807 Bytes
/
global_yard.py
File metadata and controls
38 lines (31 loc) · 807 Bytes
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
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 18 23:52:20 2019
@author: obs
"""
import ephem
#NBNB This whole idea breaks down if we have multiple devices of any given type.
g_dev = {
'obs': None,
'ocn': None,
'enc': None,
'mnt': None,
'scr': None,
'tel': None,
'rot': None,
'foc': None,
'sel': None,
'fil': None,
'cam': None,
'day': None,
'events': None
}
_sim_inc = 0.0 # Unit is seconds
_sim_total = 0.0
def ephem_sim_now(sim_delta=0.0):
global _sim_total, _sim_inc
_sim_total += (_sim_inc + sim_delta)/86400.
if _sim_total >= 1: # Wrap a simulation around after one day.
_sim_total = 0.0
sim_time = ephem.now() + _sim_total
return sim_time