Esempio n. 1
0
    def __calc_equatorialCoordinates(self): 
        ''' calculates position in equatorial coords from ecliptic '''
        
        import math
        Jcty = self._TSMgr.time_get_julianCenturiesJ2000()
        
        Lam_deg = self._moonCoordinates["ecl_Lon"] # Lambda
        Bet_deg = self._moonCoordinates["ecl_Lat"] # Beta
        Eps_deg = MH.eps_deg(Jcty)                 # Epsilon
        
        sinLam = MH.sin_deg(Lam_deg)
        cosLam = MH.cos_deg(Lam_deg)        
        sinBet = MH.sin_deg(Bet_deg)
        cosBet = MH.cos_deg(Bet_deg)
        sinEps = MH.sin_deg(Eps_deg)
        cosEps = MH.cos_deg(Eps_deg)
        
        # [o. Montenbruck] "Grundlagen der Ephemeridenrechnung" S.14
#        cos(del)*cos(alp) = cos(bet)*cos(lam)
#        cos(del)*sin(alp) = cos(eps)*cos(bet)*sin(lam) - sin(eps)*sin(bet)
#        sin(del)          = sin(eps)*cos(bet)*sin(lam) + cos(eps)*sin(bet)
        
        Del_rad = math.asin( sinEps*cosBet*sinLam + cosEps*sinBet )
        Del_deg = math.degrees(Del_rad)
        cosDel = math.cos(Del_rad)
        
        cosAlp = (cosBet*cosLam) / cosDel
        sinAlp = (cosEps*cosBet*sinLam - sinEps*sinBet) / cosDel
        
        Alp_deg = MH.atan2_deg(sinAlp,cosAlp)%360
        
        self._moonCoordinates["equa_Lon"] = Alp_deg # Alpha / RA
        self._moonCoordinates["equa_Lat"] = Del_deg # Delta / DE
Esempio n. 2
0
    def __init__(self, TSMgrObj: TSMgr.TimeSpaceMgr, planet: str):
        ''' Create a planet by its name,
            with reference to a TimeSpaceMgr object
            (preferably one for all planets). '''
        #print("PLANET: "+str(planet))

        # default values
        self._successPlanet = False
        self._planetName = None
        self._TSMgr = None

        if (planet.lower() in Planetlist.Planetlist
                and planet.lower() != "earth"):
            #wenn planet sich in der liste bekannter planeten befindet

            self._planetName = planet.lower()
            self._TSMgr = TSMgrObj  # reference to the global TSMgr

            Jcty = self._TSMgr.time_get_julianCenturiesJ2000()
            self._keplerPlanet = Planetlist.getCurrentKeplerElem(
                self._planetName, Jcty)  #get kepler elements
            self._keplerEarth = Planetlist.getCurrentKeplerElem(
                "earth", Jcty)  #get kepler elements

            # astronomical almanach 2018
            # schiefe der eklitptic epsilon = epsJ2000 + epsDot * T
            # T = julian centuries since J2000
            # epsJ2000 = 84381.406 arcsec
            # epsDot =  -46.836769 arcsec per julian century
            #            self._eps = (84381.406 -
            #                         46.836769*self._TSMgr.time_get_julianCenturiesJ2000()
            #                         )/3600
            self._eps = MH.eps_deg(Jcty)

            # astronomic unit in km
            self._AU = 149597870.7

            self._successPlanet = True