siteobs.py
3.17 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
try:
from .home import Home
except:
from home import Home
try:
from .atmosphere import Atmosphere
except:
from atmosphere import Atmosphere
try:
from .horizon import Horizon
except:
from horizon import Horizon
try:
from .guitastrotools import GuitastroTools
except:
from guitastrotools import GuitastroTools
# ========================================================
# ========================================================
# === SITE = HOME + HORIZON + ATMOSPHERE
# ========================================================
# ========================================================
class Siteobs(Home, Horizon, Atmosphere, GuitastroTools):
""" Class to describe an Siteobs
"""
# ========================================================
# === attributs
# ========================================================
#_home = Home()
#_atmosphere = Atmosphere()
#_horizon = Horizon()
# ========================================================
# === internal methods : Generals
# ========================================================
def _init_siteobs(self, home):
""" Object initialization
"""
# --- update self.home with input parameters
if isinstance(home, Home) == True:
self.home(home.gps)
else:
self.home(home)
# --- instanciate a new home to feed atmosphere and horizon
home_local = Home(self.gps)
self.horizon(home_local)
self.atmosphere_standard(home_local)
# ========================================================
# === internal methods :
# ========================================================
# ========================================================
# === Siteobs methods
# ========================================================
# ========================================================
# === get/set methods
# ========================================================
# ========================================================
# === special methods
# ========================================================
def __init__(self, home):
""" Object initialization
"""
self._init_siteobs(home)
# #####################################################################
# #####################################################################
# #####################################################################
# Main
# #####################################################################
# #####################################################################
# #####################################################################
if __name__ == "__main__":
example = 1
print("Example = {}".format(example))
# --- Import the module guitastro
import os, sys
path = os.path.join(os.path.dirname(__file__), '..')
if path not in sys.path:
sys.path.append(path)
# --- guitastro imports
modulename = 'guitastro'
if modulename in dir():
del guitastro
if modulename not in dir():
import guitastro
# ---
if example == 1:
"""
A simple siteobs
"""
siteobs = guitastro.Siteobs("GPS 0 E 49 200")
print(f"{siteobs.gps}")