def test_position_angle_from_boston(ts):
    t = ts.utc(2053, 10, 9)
    eph = api.load_file(_data_path('jup310-2053-10-08.bsp'))
    boston = eph['earth'] + Topos(longitude_degrees=(-71, 3, 24.8),
                                  latitude_degrees=(42, 21, 24.1))

    b = boston.at(t)
    j = b.observe(eph['jupiter'])  #.apparent()
    i = b.observe(eph['io'])  #.apparent()

    a = position_angle_of(j.radec(epoch='date'), i.radec(epoch='date'))

    assert abs(a.degrees - 293.671) < 0.002

    print(a)
    a = position_angle_of(j.ecliptic_latlon(epoch='date'),
                          i.ecliptic_latlon(epoch='date'))
    print(a)
def test_position_angle():
    a = Angle(degrees=0), Angle(degrees=0)
    b = Angle(degrees=1), Angle(degrees=1)
    assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
Example #3
0
def pa(c_ra, c_dec, a_ra, a_dec):
    c_ra = Angle(hours=c_ra / 15)
    c_dec = Angle(degrees=c_dec)
    a_ra = Angle(hours=a_ra / 15)
    a_dec = Angle(degrees=a_dec)
    return position_angle_of((c_dec, c_ra), (a_dec, a_ra)).degrees