chime-experiment / ch_util

CHIME utilities
https://chime-experiment.github.io/ch_util
MIT License
3 stars 3 forks source link

dealing with failed skyfield data download #27

Closed ashill closed 1 year ago

ashill commented 2 years ago

Ran into an issue with a new ch_util installation (for @nmohamme). With a clean install, ch_util.ephemeris.unix_to_datetime(eph.csd_to_unix(2235)) fails because of a lack of skyfield data. I traced this down to ftp://ftp.iers.org/products/eop/rapid/standard/finals2000A.all refusing the connection. The error message

OSError: cannot download ftp://ftp.iers.org/products/eop/rapid/standard/finals2000A.all because <urlopen error ftp error: ConnectionRefusedError(111, 'Connection refused')>

was buried deep in the crash output.

Was able to force load it by stealing code from ephemeris/tests/test_ephemeris.py:


files = ["Leap_Second.dat", "finals2000A.all", "de421.bsp"]

loader = ctime.skyfield_wrapper.load
for file in files:
    if not os.path.exists(loader.path_to(file)):
        loader.download(mirror_url + file)

That's awfully obscure. Is it feasible to force ch_util to use the CHIME mirror (or revert to it if it runs into a dead link, or at least provide a useful error message that doesn't require someone with at least a vague understanding of skyfield data to sort out the issue)?

jrs65 commented 2 years ago

@ashill I'm looking at fixing this one.

I could force it to use our own mirrors, but I only really wanted to have those for testing and not have the burden of keeping them up to date.

There's a few things I guess I could do, put in a reload_mirror method which loads from our own mirrors, and have the exception that's raised on failure tell people to try that, or I could maybe have it automatically run that on failure and give a warning that the products are going to be out of date.

Thoughts?

josephwkania commented 2 years ago

I've been using the NASA version finals200A.all - ftp://ftp.gdc.cddis.eosdis.nasa.gov/finals2000A.all (I found this through a skyfield issue). Could this be a useful mirror?

jrs65 commented 2 years ago

Thanks @josephwkania. I don't think I can pull from that mirror reliably without a login, so I think I'm going to stick with the CHIME one for now. I may update the version at the CHIME mirror from there though.

This is fixed in radiocosmology/caput#199