ancklo / ChaosMagPy

ChaosMagPy is a simple Python package for evaluating the CHAOS geomagnetic field model and other models of Earth's magnetic field.
Other
25 stars 3 forks source link

Updating RC Index fails with html error 404 #5

Closed ingomichaelis closed 3 years ago

ingomichaelis commented 3 years ago

When updating the RC index file using save_RC_h5file from chaosmagpy/data_utils.py a html 404 error was thrown when downloading the latest file from http://www.spacecenter.dk/files/magnetic-models/RC/current/. This is caused by parsing the link text which has changed to 'RC_1997-2021_augment..>'. Parsing the website for latest file crashes in https://github.com/ancklo/ChaosMagPy/blob/master/chaosmagpy/data_utils.py in line 137.

Changing the line 137 from file = tree.xpath('//tr[5]//td[2]//a/text()')[0] # get name from list to file = tree.xpath('//tr[5]//td[2]//a/@href')[0] # get name from list solves the problem for me.

ancklo commented 3 years ago

Thank you for the bug report. The issue has been fixed in v0.6.