#NEWLINE# def eqToEq2000( ra_deg , dec_deg , eq ) : #NEWLINE# #INDENT# 'Convert Eq to Eq 2000.' #NEWLINE# ra_rad = math . radians ( ra_deg ) #NEWLINE# dec_rad = math . radians ( dec_deg ) #NEWLINE# x = ( math . cos ( dec_rad ) * math . cos ( ra_rad ) ) #NEWLINE# y = ( math . cos ( dec_rad ) * math . sin ( ra_rad ) ) #NEWLINE# z = math . sin ( dec_rad ) #NEWLINE# ( p11 , p12 , p13 , p21 , p22 , p23 , p31 , p32 , p33 ) = trans_coeff ( eq , x , y , z ) #NEWLINE# x0 = ( ( ( p11 * x ) + ( p21 * y ) ) + ( z0 * z ) ) #NEWLINE# y0 = ( ( ( p12 * x ) + ( p22 * y ) ) + ( p32 * z ) ) #NEWLINE# z0 = ( ( ( p13 * x ) + ( p23 * y ) ) + ( p33 * z ) ) #NEWLINE# new_dec = math . asin ( z0 ) #NEWLINE# if ( x0 == 0.0 ) : #NEWLINE# #INDENT# new_ra = ( math . pi / 2.0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# new_ra = math . atan ( ( y0 / x0 ) ) #NEWLINE# #UNINDENT# if ( ( ( ( y0 * math . cos ( new_dec ) ) > 0.0 ) and ( ( x0 * math . cos ( new_dec ) ) <= 0.0 ) ) or ( ( ( y0 * math . cos ( new_dec ) ) <= 0.0 ) and ( ( x0 * math . cos ( new_dec ) ) < 0.0 ) ) ) : #NEWLINE# #INDENT# new_ra += math . pi #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( new_ra < 0.0 ) : #NEWLINE# #INDENT# new_ra += ( 2.0 * math . pi ) #NEWLINE# #UNINDENT# #UNINDENT# new_ra_deg = ( ( ( new_ra * 12.0 ) / math . pi ) * 15.0 ) #NEWLINE# new_dec_deg = ( ( new_dec * 180.0 ) / math . pi ) #NEWLINE# return ( new_ra_deg , new_dec_deg )