Open karlwx opened 4 years ago
The regridding takes place in the target projection (axes), so some of the spatial locations are getting mapped to the infs and messing the interpolation routines up. I was running into similar issues when I opened PR https://github.com/SciTools/cartopy/pull/1636. That PR doesn't currently work on your example with the 0->360 longitudes, but if you change to -180->180 it does. One suggestion in the meantime would be to calculate and transform the regridded points yourself, which I outlined in a few steps in that PR.
Description
When plotting global data, vector transforms fail with many projections with a QhullError. This is similar to an issue in this stackoverflow question: https://stackoverflow.com/questions/50454322/matplotlib-cartopy-streamplot-results-in-qhullerror-with-some-projections Some map projections throw an error (Lambert Conformal, Orthographic (as in example), while others may result in no data being plotted (Plate Carree with regrid_shape specififed).
Code to reproduce
Traceback
The above code can work if the latitudes are changed to:
np.arange(-89,91,1)
I've tried using masked arrays (data outside of visible map extent is masked), but that does not change anything. Also, setting the masked values to NaN does not work - that results in another error.Is there a way to make this work without taking a subset of the global data?