コード例 #1
0
ファイル: test_all.py プロジェクト: lwcworld/pymap3d
 def test_haversine(self):
     try:
         assert_allclose(anglesep(35, 23, 84, 20), ha)
     except ImportError:
         pass
     #%% compare with astropy
     assert_allclose(anglesep_meeus(35, 23, 84, 20), ha)
コード例 #2
0
def main():
    p = ArgumentParser(description="angular distance between two sky points")
    p.add_argument("r0", help="right ascension: first point [deg]", type=float)
    p.add_argument("d0", help="declination: first point [deg]", type=float)
    p.add_argument("r1", help="right ascension: 2nd point [deg]", type=float)
    p.add_argument("d1", help="declination: 2nd point [degrees]", type=float)
    a = p.parse_args()

    dist_deg = anglesep_meeus(a.r0, a.d0, a.r1, a.d1)
    dist_deg_astropy = anglesep(a.r0, a.d0, a.r1, a.d1)

    print(f"{dist_deg:.6f} deg sep")

    assert dist_deg == approx(dist_deg_astropy)
コード例 #3
0
def main():
    p = ArgumentParser(description="angular distance between two sky points")
    p.add_argument('r0', help='right ascension: first point [deg]', type=float)
    p.add_argument('d0', help='declination: first point [deg]', type=float)
    p.add_argument('r1', help='right ascension: 2nd point [deg]', type=float)
    p.add_argument('d1', help='declination: 2nd point [degrees]', type=float)
    a = p.parse_args()

    dist_deg = anglesep_meeus(a.r0, a.d0, a.r1, a.d1)
    dist_deg_astropy = anglesep(a.r0, a.d0, a.r1, a.d1)

    print('{:.6f} deg sep'.format(dist_deg))

    assert dist_deg == approx(dist_deg_astropy)
コード例 #4
0
def test_anglesep_meeus():
    # %% compare with astropy
    assert pmh.anglesep_meeus(35, 23, 84, 20) == approx(ha)
コード例 #5
0
ファイル: test_astropy.py プロジェクト: scienceopen/pymap3d
def test_anglesep_meeus():
    # %% compare with astropy
    assert pmh.anglesep_meeus(35, 23, 84, 20) == approx(ha)