astropy / astroplan

Observation planning package for astronomers – maintainer @bmorris3
https://astroplan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
199 stars 109 forks source link

download_IERS_A triggers IndexError #518

Closed mikewallis closed 2 years ago

mikewallis commented 2 years ago

Importing IERS bulletin A is triggering an IndexError - having looked, the URI for the table is generating an error but I can't work out how to tell it to use a different source.

>>> from astropy.utils.data import clear_download_cache
>>> clear_download_cache()
>>> from astroplan import download_IERS_A
Downloading https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat
|===================================================================| 1.3k/1.3k (100.00%)         0s
>>> download_IERS_A()
Downloading https://datacenter.iers.org/data/9/finals2000A.all
|===================================================================| 2.1k/2.1k (100.00%)         0s
Traceback (most recent call last):
  File "/usr/local/lib64/python3.6/site-packages/astropy/io/ascii/core.py", line 955, in _convert_vals
    converter_func, converter_type = col.converters[0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/astroplan/utils.py", line 146, in download_IERS_A
    iers.IERS.iers_table = iers.IERS_A.open(local_iers_a_path)
  File "/usr/local/lib64/python3.6/site-packages/astropy/utils/iers/iers.py", line 205, in open
    cls.iers_table = cls.read(**kwargs)
  File "/usr/local/lib64/python3.6/site-packages/astropy/utils/iers/iers.py", line 542, in read
    iers_a = super().read(file, format='cds', readme=readme)
  File "/usr/local/lib64/python3.6/site-packages/astropy/table/connect.py", line 52, in __call__
    out = registry.read(cls, *args, **kwargs)
  File "/usr/local/lib64/python3.6/site-packages/astropy/io/registry.py", line 523, in read
    data = reader(*args, **kwargs)
  File "/usr/local/lib64/python3.6/site-packages/astropy/io/ascii/connect.py", line 19, in io_read
    return read(filename, **kwargs)
  File "/usr/local/lib64/python3.6/site-packages/astropy/io/ascii/ui.py", line 323, in read
    dat = reader.read(table)
  File "/usr/local/lib64/python3.6/site-packages/astropy/io/ascii/cds.py", line 326, in read
    return super().read(table)
  File "/usr/local/lib64/python3.6/site-packages/astropy/io/ascii/core.py", line 1204, in read
    table = self.outputter(cols, self.meta)
  File "/usr/local/lib64/python3.6/site-packages/astropy/io/ascii/core.py", line 986, in __call__
    self._convert_vals(cols)
  File "/usr/local/lib64/python3.6/site-packages/astropy/io/ascii/core.py", line 971, in _convert_vals
    raise ValueError(f'Column {col.name} failed to convert: {last_err}')
ValueError: Column year failed to convert: invalid literal for int() with base 10: '<!'
>>>

Is this just a case of "wait until the new tables are published"? I first noticed this on March 28th, if that's helpful.

Thanks!

mikewallis commented 2 years ago

Ah, I see that the bulletin servers are unavailable. Sorry for making this an issue (so I'll close it now, as it's out of your hands). But, as a future feature request can we make alternate sources an option to download_IERS_A()?