siteobs.py 3.17 KB
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}")