250-hPa Hemispheric Map using Python - Worked in August, not now....sigh #2783
-
I am new to MetPy. In August, I was able to implement the Unidata Python Gallery's 250-hPa Hemispheric Map example presented on the following page: https://unidata.github.io/python-gallery/examples/250hPa_Hemispheric_Plot.html It worked brilliantly. I recently tried running this exact script again (not having done anything to the code), and I am now suddenly getting the following error. Any suggestions would be greatly appreciated. peace, IndexError Traceback (most recent call last) ~.conda\envs\metpy\lib\site-packages\cartopy\util.py in add_cyclic_point(data, coord, axis) ~.conda\envs\metpy\lib\site-packages\numpy\ma\core.py in getitem(self, indx) IndexError: index 0 is out of bounds for axis 0 with size 0 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Sorry you've run into this problem. What I think happened is that in August we upgraded our THREDDS data server to its next major version, v5. That subtly changed some behavior this example was relying on. The problematic lines are: gfsdata_hght.lonlat_box(0, 360, 0, 90) and gfsdata_wind.lonlat_box(0, 360, 0, 90) On the new version of the server, 0 and 360 seem to be treated the same, so the request ends up getting a single longitude line of data. The quick fix is to not quite request all the way to 360, like: gfsdata_hght.lonlat_box(0, 359.9, 0, 90) and gfsdata_wind.lonlat_box(0, 359.9, 0, 90) |
Beta Was this translation helpful? Give feedback.
Sorry you've run into this problem. What I think happened is that in August we upgraded our THREDDS data server to its next major version, v5. That subtly changed some behavior this example was relying on. The problematic lines are:
and
On the new version of the server, 0 and 360 seem to be treated the same, so the request ends up getting a single longitude line of data. The quick fix is to not quite request all the way to 360, like:
and
With that change made, I get the expected image: