Пример #1
0
 def test_era(self):
     """Comare ERA relative to erfa.era00 test case."""
     t = Time(2400000.5, 54388.0, format='jd', location=(0, 0), scale='ut1')
     era = t.earth_rotation_angle()
     expected = 0.4022837240028158102 * u.radian
     # Without the TIO locator/polar motion, this should be close already.
     assert np.abs(era - expected) < 1e-10 * u.radian
     # And with it, one should reach full precision.
     sp = erfa.sp00(t.tt.jd1, t.tt.jd2)
     iers_table = iers.earth_orientation_table.get()
     xp, yp = [c.to_value(u.rad) for c in iers_table.pm_xy(t)]
     r = erfa.rx(-yp, erfa.ry(-xp, erfa.rz(sp, np.eye(3))))
     expected1 = expected + (np.arctan2(r[0, 1], r[0, 0]) << u.radian)
     assert np.abs(era - expected1) < 1e-12 * u.radian
     # Now try at a longitude different from 0.
     t2 = Time(2400000.5,
               54388.0,
               format='jd',
               location=(45, 0),
               scale='ut1')
     era2 = t2.earth_rotation_angle()
     r2 = erfa.rz(np.deg2rad(45), r)
     expected2 = expected + (np.arctan2(r2[0, 1], r2[0, 0]) << u.radian)
     assert np.abs(era2 - expected2) < 1e-12 * u.radian
Пример #2
0
 def test_era(self):
     # Separate since it does not use the same time.
     time_ut1 = Time(2400000.5, 54388.0, format='jd', scale='ut1')
     era = time_ut1.earth_rotation_angle('tio')
     expected = 0.4022837240028158102
     assert np.abs(era.to_value(u.radian) - expected) < 1e-12