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

Earthdata now provides 25 maps #4

Open nhurleywalker opened 1 year ago

nhurleywalker commented 1 year ago

I've only just started using this code so I am not sure when the change occurred, but if I use url_download.py to get the latest version of some ionex data, it has 25 TEC and 25 RMS maps. teccalc.py and tecrmscalc.py are only expecting 13 maps. So when they get to this block:

newa = numpy.zeros((totalmaps, int(pointsLat), int(pointsLon)))
inc = 0
for item in range(int(NumberOfMaps)):
        newa[inc,:,:] = a[item,:,:]
        inc = inc + 2

it fails with:

    newa[inc,:,:] = a[item,:,:]
IndexError: index 26 is out of bounds for axis 0 with size 25

This can be alleviated by simply commenting out lines 145 to 162 in teccalc.py and instead write

newa = a

and likewise for tecrmscalc.py.

I suggest making this more robust by testing the size of the input file and then running the interpolation only if needed.

Side note: there is also a python2 print statement on line 50 of url_download.py.

Thanks for providing this useful code!