Skip to content

Problem with IERS Bulletin table #356

Closed

Description

@martinjohndyer

When doing the usual update with download_IERS_A it now throws a load of errors every time we import astroplan. Presumably something's wrong with the table it downloaded.

This is a real problem, given it breaks every script that imports astroplan (and by extension our whole TCS).

>>> import astroplan
Traceback (most recent call last):
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/io/ascii/core.py", line 957, 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 "/home/martin/.local/lib/python3.5/site-packages/astroplan/__init__.py", line 31, in <module>
    get_IERS_A_or_workaround()
  File "/home/martin/.local/lib/python3.5/site-packages/astroplan/utils.py", line 58, in get_IERS_A_or_workaround
    iers.IERS.iers_table = _get_IERS_A_table()
  File "/home/martin/.local/lib/python3.5/site-packages/astroplan/utils.py", line 92, in _get_IERS_A_table
    table = iers.IERS_Auto.open()
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/utils/iers/iers.py", line 583, in open
    cls.iers_table = cls.read(file=filename)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/utils/iers/iers.py", line 452, in read
    iers_a = Table.read(file, format='cds', readme=readme)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/table/table.py", line 2519, in read
    out = io_registry.read(cls, *args, **kwargs)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/io/registry.py", line 531, in read
    data = reader(*args, **kwargs)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/io/ascii/connect.py", line 39, in io_read
    return read(filename, format=format, **kwargs)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/io/ascii/ui.py", line 353, in read
    dat = reader.read(table)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/io/ascii/cds.py", line 322, in read
    return super(Cds, self).read(table)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/io/ascii/core.py", line 1202, in read
    table = self.outputter(cols, self.meta)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/io/ascii/core.py", line 988, in __call__
    self._convert_vals(cols)
  File "/home/martin/.local/lib/python3.5/site-packages/astropy/io/ascii/core.py", line 973, in _convert_vals
    raise ValueError('Column {} failed to convert: {}'.format(col.name, last_err))
ValueError: Column dX_2000A_A failed to convert: could not convert string to float: '9 521 586'

Activity

  1. bmorris3 commented on Apr 5, 2018

    @bmorris3
    Contributor

    Perhaps some insight can be gained from astropy/astropy#5059. What happens if you download the table from a different mirror?

    from astropy.utils import iers
    iers.IERS_A_URL = 'http://toshi.nofs.navy.mil/ser7/finals2000A.all'
    import astroplan
  2. martinjohndyer commented on Apr 5, 2018

    @martinjohndyer
    MemberAuthor
  3. martinjohndyer commented on Apr 5, 2018

    @martinjohndyer
    MemberAuthor

    Does the function keep backups of the old tables? If there's a problem it would be useful to be able to revert and just deal with the loss of accuracy.

  4. martinjohndyer commented on Apr 5, 2018

    @martinjohndyer
    MemberAuthor

    Looks like it might be something wrong with the table format, the number it reports an error on is the first not on a new line. Presumably because it's expecting the 'P' string.

  5. martinjohndyer commented on Apr 5, 2018

    @martinjohndyer
    MemberAuthor

    I can conform editing the file in the cache to add newlines fixed the problem. I know it's not expected to be an issue, but maybe a validity check on the table would be a good idea before just breaking everything.

  6. bmorris3 commented on Apr 7, 2018

    @bmorris3
    Contributor

    @martinjohndyer – any chance this has resolved with newer table updates?

  7. martinjohndyer commented on Apr 9, 2018

    @martinjohndyer
    MemberAuthor

    @bmorris3 Yes it seems to be. Obviously just a problem with the table at the other end, though maybe astropy/astroplan should have some validation function to make the errors a little more obvious what's wrong.

  8. bmorris3 commented on Apr 9, 2018

    @bmorris3
    Contributor

    @eteq / @bsipocz – is there any precedent for doing this elsewhere in astropy?

  9. elendil-software commented on Apr 26, 2018

    @elendil-software

    Hi

    I have the same problem. But I don't understand what to do to solve it.

    Regards

  10. lpsinger commented on Jul 11, 2019

    @lpsinger
    Contributor

    Why does astroplan keep a copy of the IERS data that is separate from the one managed by astropy.utils.iers?

  11. wtgee commented on Aug 18, 2019

    @wtgee
    Contributor

    Why does astroplan keep a copy of the IERS data that is separate from the one managed by astropy.utils.iers?

    @bmorris3 we're still struggling with this IERS table so I want to dedicate some time to trying to fix it. Following up on @lpsinger's comment, if we use an alternate url for download it still doesn't seem to place it in the cache properly. That is, I can do

    from astropy.utils import iers
    iers.IERS_A_URL = '<custom_url>'
    from astroplan import download_IERS_A
    download_IERS_A()
    

    and it will work fine, but if I then import any other module that uses astroplan I will still get a warning about it being out of date. I've looked at the source a little bit but there is some trickery going on with it trying to override things and I haven't had the time to fully dig through it. Any thoughts would be appreciated!

  12. bmorris3 commented on Aug 20, 2019

    @bmorris3
    Contributor

    @wtgee I'm currently at the Extreme Solar Systems conference and will be able respond in detail to your question next week. Sorry for my delay 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions