These downloads can occasionally fail. I would like to have local copies instead where my team can take responsibility for periodically updating them.
I can run my program such that all the files are downloaded.
But I have two challenges. First how do I locate the full set of downloaded files and second how do I tell astropy to use local copies?
The specific file you call out is the IERS-A table, and there is a recommended workflow:
Set a configuration parameter that disables the downloading of updated IERS-A tables (see IERS data access (astropy.utils.iers) — Astropy v7.0.0), which will tell astropy to always use the IERS-A table from the corresponding astropy-iers-data package
Update the astropy-iers-data package as appropriate so that the updated IERS-A table is available locally
I believe this workflow also works for the leap-second file.
@ayshih I tried this approach and my astropy-iers-data package is now up to date, but it’s not clear that astropy is actually using it.
If I disable downloads I get the error
WARNING: IERSStaleWarning: leap-second file is expired. [astropy.utils.iers.iers] WARNING: Tried to get polar motions for times after IERS data is valid. Defaulting to polar motion from the 50-yr mean for those. This may affect precision at the arcsec level. Please check your astropy.utils.iers.conf.iers_auto_url and point it to a newer version if necessary. [astropy.coordinates.builtin_frames.utils] WARNING: (some) times are outside of range covered by IERS table. Cannot convert with full accuracy. To allow conversion with degraded accuracy set astropy.utils.iers.conf.iers_degraded_accuracy to "warn" or "silent". For more information about setting this configuration parameter or controlling its value globally, see the Astropy configuration system documentation https://docs.astropy.org/en/stable/config/index.html. Assuming UT1-UTC=0 for coordinate transformations. [astropy.coordinates.builtin_frames.utils]
But if I leave downloads on this error doesn’t occur.
Also running find
Hmm, what version of astropy are you using? Since you are apparently running Python 3.8, you are probably using a version of astropy this is at least two years old (astropy 5.2.x or earlier), which means it predates the use of astropy-iers-data (which started with astropy 6.0). I would highly recommend that you update to a much more recent release of astropy, preferably 7.0, not only for the use of astropy-iers-data, but also because there have been various improvements to how the IERS tables are handled when auto_download=False.