示例#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
示例#2
0
    def _calc_topoc_equator_spherical(self):
        ''' computes [Position Angles] and [Angular Velocities] 
            ([Right Ascencion] and [Declination]) 
            in [TOPOcentric Equatorial Coordinate System] of the Sat
            relavtive to the telescope.
            (Center = [surface position],
            References: [Earth axis] / [Equatorial plane] and
                the direction to the [Vernal equinox].) '''

        # Berechnung is aehnlich zu GEOzentrisch spherical,
        #   JEDOCH ist (x,y,z) der vektor vom telescop zum satelliten
        #   und fuer (x',y',z') muss x',y' vom teleskop berechnet werden

        # -------------
        # get cartesian corrdinates
        xp, yp, zp = self._topocentr_equator["cartesian"]["vel"]
        x, y, z = self._topocentr_equator["cartesian"]["pos"]
        r = math_helper.vector_abs((x, y, z))

        # -------------
        # calc spherical coordinates

        # -------------
        # ANGULAR POSITION

        Ra = math_helper.atan2_deg(y, x)
        De = math_helper.asin_deg(z / r)

        self._topocentr_equator["spherical"]["pos"]["Ra"] = Ra
        self._topocentr_equator["spherical"]["pos"]["De"] = De
        self._topocentr_equator["spherical"]["pos"]["R"] = r

        # -------------
        # ANGULAR VELOCITY

        # x,y,z = f(t)
        # r = f(t) = sqrt(x^2+y^2+z^2)

        # Ra = atan(y/x)
        # d( atan(y(t)/x(t)) )/dt = (x*y' - y*x')/(x^2+y^2)   in rad/s
        Ra_dot = math.degrees((x * yp - y * xp) / (x**2 + y**2))

        # De = asin(z/r)
        # d( asin(z(t)/r(t)) )/dt =
        #       z' - z/(r^2) * (x*x'+y*y'+z*z')
        #   = ------------------------------    in rad/s
        #           sqrt(r^2 - z^2)
        De_dot = math.degrees((zp - z / (r**2) * (x * xp + y * yp + z * zp)) /
                              math.sqrt(r**2 - z**2))

        self._topocentr_equator["spherical"]["vel"]["Ra"] = Ra_dot
        self._topocentr_equator["spherical"]["vel"]["De"] = De_dot