csobey / ionFR

A code that allows you to predict the ionospheric Faraday rotation for a specific line-of-sight, geographic location, and epoch
GNU General Public License v3.0
8 stars 9 forks source link

bug in url_download.py #3

Open scottransom opened 2 years ago

scottransom commented 2 years ago

Hi Charlotte,

Thanks for this code! I just found a bug that prevents the download code from being used on certain dates.

if dayofyear < 10:
        dayofyear = '00'+str(dayofyear)
if dayofyear < 100 and dayofyear >= 10:
        dayofyear = '0'+str(dayofyear)

That 2nd if should be an elif since if the first one is True, it converts dayofyear into a string which can't then be compared to a number for the 2nd one.

Thanks again,

Scott

bryanbutler2 commented 4 months ago

Or, alternatively, replace that entire if block with: dayofyear = "%03d" % dayofyear

And, hi Scott - I see you there :).