You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
grdimage can not plot data with decreasing latitudes #368
grdimage fails when attempting to plot grids that are not "global" [0, 360, -90, 90].
The xarray dataset I am trying to plot is equispaced in latitude and longitude, and normally would work with gmt. When trying to plot with pygmt however, the routine goes into some kind of infinite loop and never terminates.
The xarray dataset has the following characteristics:
I note that the redundant data points at 360 E are not provided, and the data point at the south pole is not provided. I further note that this is the standard format for Driscoll and Healy sampled grids which are employed in pyshtools.
With more investigation, it turns out that grdimage works when reading a netcdf file, but not when using an xarray dataarray. In particular, the following works:
pygmt can not deal with grids where latitudes decrease, such as [90, 80, ....-80].
By inverting the array of latitudes, everything worked fine (but with an upside down image). Given that gmt can correctly parse this, the problem is somewhere in pygmt.
Activity
MarkWieczorek commentedon Nov 5, 2019
With more investigation, it turns out that grdimage works when reading a netcdf file, but not when using an xarray dataarray. In particular, the following works:
but the following doesn't
MarkWieczorek commentedon Nov 5, 2019
I've narrowed the problem down to the following:
pygmt can not deal with grids where latitudes decrease, such as [90, 80, ....-80].
By inverting the array of latitudes, everything worked fine (but with an upside down image). Given that gmt can correctly parse this, the problem is somewhere in pygmt.
[-]grdimage fails when gridded data are not "global"[/-][+]grdimage can not plot data with decreasing latitudes[/+]weiji14 commentedon Nov 5, 2019
Hi @MarkWieczorek, thanks for taking a look at this, and opening a Pull Request too! I'll try and review your work in a bit.
weiji14 commentedon Nov 11, 2019
Closed in #369.