From d1421807dce1c7cb4e20a6317725aef33a5476a8 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Sun, 24 May 2020 21:20:47 +0100 Subject: [PATCH] Merge pull request #10387 from astrofrog/fix-remote Fix remote test failures related to IERS update --- astropy/utils/iers/data/eopc04_IAU2000.62-now | 22 ++++++++++--------- astropy/utils/iers/iers.py | 8 +++++-- astropy/utils/iers/tests/test_iers.py | 10 ++++++--- docs/coordinates/frames.rst | 10 ++++----- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/astropy/utils/iers/data/eopc04_IAU2000.62-now b/astropy/utils/iers/data/eopc04_IAU2000.62-now index e87d14dac552..d92a2a902b0d 100644 --- a/astropy/utils/iers/data/eopc04_IAU2000.62-now +++ b/astropy/utils/iers/data/eopc04_IAU2000.62-now @@ -21296,13 +21296,15 @@ 2020 4 7 58946 0.056183 0.409449 -0.2300159 0.0015401 -0.000006 0.000077 0.000053 0.000037 0.0000058 0.0000125 0.000060 0.000045 2020 4 8 58947 0.056906 0.409913 -0.2316246 0.0016364 -0.000029 0.000058 0.000053 0.000037 0.0000059 0.0000126 0.000061 0.000046 2020 4 9 58948 0.057714 0.411016 -0.2332083 0.0015201 -0.000060 0.000022 0.000053 0.000037 0.0000060 0.0000126 0.000062 0.000046 -2020 4 10 58949 0.058130 0.412010 -0.2346157 0.0012931 -0.000072 0.000032 0.000053 0.000036 0.0000061 0.0000127 0.000062 0.000046 -2020 4 11 58950 0.058541 0.412985 -0.2357568 0.0009873 -0.000076 0.000059 0.000053 0.000036 0.0000061 0.0000127 0.000063 0.000046 -2020 4 12 58951 0.059086 0.413987 -0.2366150 0.0007075 -0.000080 0.000086 0.000053 0.000036 0.0000062 0.0000127 0.000064 0.000046 -2020 4 13 58952 0.059769 0.415418 -0.2372106 0.0004798 -0.000084 0.000113 0.000053 0.000036 0.0000062 0.0000128 0.000064 0.000046 -2020 4 14 58953 0.060954 0.416731 -0.2375995 0.0003119 -0.000087 0.000140 0.000053 0.000037 0.0000062 0.0000128 0.000065 0.000045 -2020 4 15 58954 0.062102 0.418093 -0.2378588 0.0001710 -0.000091 0.000167 0.000053 0.000037 0.0000062 0.0000129 0.000065 0.000045 -2020 4 16 58955 0.062910 0.419662 -0.2380455 0.0001719 -0.000006 0.000081 0.000053 0.000037 0.0000063 0.0000129 0.000066 0.000046 -2020 4 17 58956 0.063856 0.421406 -0.2382558 0.0002683 0.000103 -0.000036 0.000054 0.000037 0.0000065 0.0000130 0.000067 0.000048 -2020 4 18 58957 0.064555 0.422989 -0.2385857 0.0004040 0.000102 -0.000020 0.000054 0.000037 0.0000066 0.0000131 0.000068 0.000050 -2020 4 19 58958 0.064403 0.424255 -0.2390210 0.0004911 0.000059 0.000044 0.000054 0.000037 0.0000068 0.0000131 0.000069 0.000052 +2020 4 10 58949 0.058140 0.412006 -0.2346158 0.0012941 -0.000072 0.000032 0.000053 0.000036 0.0000060 0.0000127 0.000062 0.000046 +2020 4 11 58950 0.058541 0.412979 -0.2357568 0.0009873 -0.000076 0.000059 0.000053 0.000036 0.0000060 0.0000127 0.000059 0.000044 +2020 4 12 58951 0.059085 0.413994 -0.2366150 0.0007074 -0.000080 0.000086 0.000053 0.000036 0.0000060 0.0000128 0.000059 0.000044 +2020 4 13 58952 0.059770 0.415412 -0.2372105 0.0004798 -0.000084 0.000113 0.000053 0.000036 0.0000060 0.0000128 0.000060 0.000043 +2020 4 14 58953 0.060954 0.416738 -0.2375994 0.0003119 -0.000087 0.000140 0.000053 0.000037 0.0000060 0.0000128 0.000060 0.000043 +2020 4 15 58954 0.062103 0.418086 -0.2378588 0.0001711 -0.000091 0.000167 0.000053 0.000037 0.0000059 0.0000129 0.000060 0.000043 +2020 4 16 58955 0.062909 0.419670 -0.2380457 0.0001719 -0.000006 0.000081 0.000053 0.000037 0.0000060 0.0000130 0.000061 0.000044 +2020 4 17 58956 0.063857 0.421398 -0.2382559 0.0002683 0.000103 -0.000036 0.000054 0.000037 0.0000062 0.0000130 0.000062 0.000045 +2020 4 18 58957 0.064553 0.422998 -0.2385857 0.0004040 0.000102 -0.000020 0.000054 0.000037 0.0000063 0.0000131 0.000063 0.000046 +2020 4 19 58958 0.064401 0.424247 -0.2390208 0.0004911 0.000059 0.000044 0.000054 0.000037 0.0000064 0.0000132 0.000063 0.000048 +2020 4 20 58959 0.063799 0.425124 -0.2394996 0.0004886 0.000017 0.000109 0.000055 0.000037 0.0000066 0.0000132 0.000064 0.000050 +2020 4 21 58960 0.063206 0.425887 -0.2399977 0.0004849 -0.000025 0.000173 0.000055 0.000038 0.0000067 0.0000133 0.000065 0.000051 diff --git a/astropy/utils/iers/iers.py b/astropy/utils/iers/iers.py index 751f0dc88b67..0025035b2b17 100644 --- a/astropy/utils/iers/iers.py +++ b/astropy/utils/iers/iers.py @@ -619,8 +619,12 @@ def read(cls, file=None, readme=None, data_start=14): if readme is None: readme = IERS_B_README - return super().read(file, format='cds', readme=readme, - data_start=data_start) + table = super().read(file, format='cds', readme=readme, + data_start=data_start) + + table.meta['data_path'] = file + table.meta['readme_path'] = readme + return table def ut1_utc_source(self, i): """Set UT1-UTC source flag for entries in IERS table""" diff --git a/astropy/utils/iers/tests/test_iers.py b/astropy/utils/iers/tests/test_iers.py index eedf1d0f111f..2ccda7e8fb47 100644 --- a/astropy/utils/iers/tests/test_iers.py +++ b/astropy/utils/iers/tests/test_iers.py @@ -266,14 +266,14 @@ def test_simple(self): # Look at times before and after the test file begins. 0.1292905 is # the IERS-B value from MJD=57359. The value in # finals2000A-2016-02-30-test has been replaced at this point. - assert np.allclose(dat.ut1_utc(Time(50000, format='mjd').jd).value, 0.1292905) + assert np.allclose(dat.ut1_utc(Time(50000, format='mjd').jd).value, 0.1293286) assert np.allclose(dat.ut1_utc(Time(60000, format='mjd').jd).value, -0.2246227) # Now pretend we are accessing at time 60 days after start of predictive data. # There will be a warning when downloading the file doesn't give new data # and an exception when extrapolating into the future with insufficient data. dat._time_now = Time(predictive_mjd, format='mjd') + 60 * u.d - assert np.allclose(dat.ut1_utc(Time(50000, format='mjd').jd).value, 0.1292905) + assert np.allclose(dat.ut1_utc(Time(50000, format='mjd').jd).value, 0.1293286) with catch_warnings(iers.IERSStaleWarning) as warns: with pytest.raises(ValueError) as err: dat.ut1_utc(Time(60000, format='mjd').jd) @@ -301,7 +301,7 @@ def test_simple(self): with iers.conf.set_temp('iers_auto_url', self.iers_a_url_2): # Look at times before and after the test file begins. This forces a new download. - assert np.allclose(dat.ut1_utc(Time(50000, format='mjd').jd).value, 0.1292905) + assert np.allclose(dat.ut1_utc(Time(50000, format='mjd').jd).value, 0.1293286) assert np.allclose(dat.ut1_utc(Time(60000, format='mjd').jd).value, -0.3) # Now the time range should be different. @@ -317,6 +317,10 @@ def test_IERS_B_parameters_loading_into_IERS_Auto(): ok_A = A["MJD"] <= B["MJD"][-1] assert not np.all(ok_A), "IERS B covers all of IERS A: should not happen" + # We only overwrite IERS_B values in the IERS_A table that were already + # there in the first place. Better take that into account. + ok_A &= np.isfinite(A["UT1_UTC_B"]) + i_B = np.searchsorted(B["MJD"], A["MJD"][ok_A]) assert np.all(np.diff(i_B) == 1), "Valid region not contiguous" diff --git a/docs/coordinates/frames.rst b/docs/coordinates/frames.rst index 9b2c052a08bd..4d879aa11d87 100644 --- a/docs/coordinates/frames.rst +++ b/docs/coordinates/frames.rst @@ -240,11 +240,11 @@ set of coordinates, you will need to make sure that the shapes allow this:: + '2012-06-21T00:00:00.000']], location=(3980608.90246817, -102.47522911, 4966861.27310068) m, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0.0, obswl=1.0 micron): (az, alt) in deg + [[( 93.09845185, 89.21613128), (126.85789663, 25.4660055 ), + ( 51.37993234, 37.18532527)], + [(307.71713698, 37.99437658), (231.3740787 , 26.36768329), + ( 85.4218724 , 89.69297998)]]> .. Note:: Frames without data have a ``shape`` that is determined by their frame