Closed ashtonflinders closed 4 years ago
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.
Oops, you're right, it should return an xr.DataArray
instead. I'll work on a fix for it now.
In the meantime, you can use DEPTH_SURF.z
to access the xr.DataArray
inside the xr.Dataset
.
Although the docs says pygmt.surface returns a
xarray.DataArray
, it actually returns anxarray.Dataset
. This is incompatible to what grdtrack expects as input, making it not possible to sample an internally created grid unless you write it out to file, then reread it, or do some finagling.GMTInvalidInput: Unrecognized data type xarray.core.dataset.Dataset
The work around is to convert the dataset to a dataarray;
Although this doesn't work directly, since it incorrectly broadcasts the array size;
GMTInvalidInput: Invalid number of grid dimensions '3'. Must be 2.
To get it to work, you have to use a slice of the dataarray;
Unless I'm missing something obvious here and this is the expected behavior?