[AstroPy] Bad time file being downloaded

Phil Evans pae9 at leicester.ac.uk
Thu Mar 31 03:23:42 EDT 2022


Just rounding this off a bit more:

If I download the file myself: (curl -u anonymous: -O --ftp-ssl 
ftp://gdc.cddis.eosdis.nasa.gov/pub/products/iers/finals2000A.all) the 
file downloads fine, but when astropy does it (saying "Downloading 
ftp://anonymous:mail%40astropy.org@gdc.cddis.eosdis.nasa.gov/pub/products/iers/finals2000A.all 
from https://datacenter.iers.org/data/9/finals2000A.all") it gets the 
"service not available" error).

I will report to astropy git as an issue - has anyone else seen this? 
Easy steps to reproduce (first moving your .astropy directory away so 
that you don't keep a cached file)

mv ~/.astropy ~/.astropy_KEEP
ipython3

from astropy.time import Time
Time.now().ut1


And I get an error.

THanks


Phil




On 29/03/2022 20:02, Eric L. N. Jensen wrote:
> Hi Phil,
>
> You should be able to edit your .astropy/config/astropy.cfg file and 
> find the iers section there to set some things, for example to set 
> auto_download to False.   Details on the iers config parameters are 
> here: 
> https://docs.astropy.org/en/stable/utils/iers.html#configuration-parameters 
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.astropy.org%2Fen%2Fstable%2Futils%2Fiers.html%23configuration-parameters&data=04%7C01%7Cpae9%40leicester.ac.uk%7Cc8399372a97244d77d3908da11b6c0b3%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C1%7C637841773861151771%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=f2%2FYT024QW83c8s%2FJRcLCgVaEqtk5PzGYn1W7VPkhjs%3D&reserved=0> 
>
>
> It looks like you can also edit the iers_auto_url parameter to point 
> to a different URL if you like.
>
> I agree that ideally astropy should recognize if it’s not getting 
> sensible output from a given download, so that could be a good issue 
> to open.  But perhaps the above will help in the short term.
>
> Hope this helps -
>
> Eric
> Eric Jensen
> Professor of Astronomy
> Chair, Natural Sciences & Engineering Division
> Swarthmore College
>
>> On Mar 29, 2022, at 12:43 PM, Evans, Phil (Dr.) 
>> <pae9 at leicester.ac.uk> wrote:
>>
>> Hi Ramiro and others,
>>
>> I tried reinstalling astropy but no luck. For now, I’ve got a 
>> semi-fix because it was working on another machine (which had 
>> obviously downloaded from a different site) so I copied my .astropy 
>> directory across, but this is ony short-term, and doesn’t deal with 
>> the underlying problem that astropy is downloading essentially a 404 
>> page and so throwing an error - that there doesn’t seem to be a way 
>> to avoid.
>>
>> Is there no way to set preferences or blacklist a given URL? I don’t 
>> know the intimate details of astropy, but it downloads sites.json, so 
>> I assume from this it selects where to get the IERS stuff from(?) So 
>> ideally I’d like to be able to say, “Don’t use that site.” Actually - 
>> more ideally, the back-end of astropy should realise when the file it 
>> has downloaded is not the expected file and switch to a different 
>> source — I guess maybe I should report this as a bug on the git repo?
>>
>> Phil
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy

-- 
-------------------------

Phil Evans,
Swift Development Scientist & Athena W-ISC Technical Lead
X-ray and Observational Astronomy Group,
University of Leicester

Tel: +44 (0)116 252 5059
Mobile: +44 (0)7780 980240 (work)
Mobile: +44 (0)7974 977723 (personal)

pae9 at leicester.ac.uk

http://www.star.le.ac.uk/~pae9
http://www.swift.ac.uk

Follow me as a Swift scientist on Twitter: @swift_phil
http://www.star.le.ac.uk/~pae9/twitter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20220331/3359abaa/attachment.html>


More information about the AstroPy mailing list