astropy: IERS_B file download failure: 404 error

Description

Hi, It seems like the URL used to download the IERS B table is down and gives a 404 error in a new virtual environment.

Expected behavior

I see some mention of adding fail-safe URLs in https://github.com/astropy/astropy-iers-data/issues/20, but not sure if there was a resolution for the IERS B tables?

How to Reproduce

# Put your Python code snippet here.
import astropy
from astropy.utils.iers import conf,IERS_A, IERS_A_URL, IERS_B, IERS_B_URL, IERS
from astropy.utils.data import download_file

print(astropy.__version__)
print(IERS_B_URL)
iers_b_file = download_file(IERS_B_URL, cache=True)

Output:

5.1
http://hpiers.obspm.fr/iers/eop/eopc04/eopc04_IAU2000.62-now

Attempting to download the IERS B table from the given URL gives the following error. HTTPError: HTTP Error 404: Not Found

Conversely if you attempt this in an old virtual environment (which has the file cached), I don’t get this error. The analogous IERS_A_URL points to a resource that is still available.

Versions

Windows-10-10.0.19045-SP0
Python 3.9.12 (tags/v3.9.12:b28265d, Mar 23 2022, 23:52:46) [MSC v.1929 64 bit (AMD64)]
astropy 5.1
Numpy 1.22.3
pyerfa 2.0.0.1
Scipy 1.8.1
Matplotlib 3.5.2

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 22 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Hmm, sounds like we can revert astropy/astropy#14384 – but perhaps keep astropy/astropy#14382 since that is the new, presumably better analysis.

In the meantime, astropy should still work if you turn off download of the defunct URL and use the file shipped with package. See https://docs.astropy.org/en/latest/utils/iers.html#working-offline

From what I see above, unless Paris Observatory brings back the old file, we actually need to change the code here to match the new file format, which is also a headache because that breaks backward compatibility. I don’t see any drop-in replacement.