When using xarray.DataArray as inputs for gsw.geo_strf_dyn_height, the result is only NaNs.
Do you have any idea why this is so?
Example
import gsw
a = [0,1,2]
print(gsw.geo_strf_dyn_height(a, a, a))
Outputs
array([ 0. , -0.27061522, -0.53269375])
Using xarray
import gsw
import xarray as xr
da = xr.DataArray([0,1,2])
print(gsw.geo_strf_dyn_height(da, da, da))
Outputs
array([nan, nan, nan])
With numpy 1.22.2 I also get a FutureWarning:
/home/romain/.cache/pypoetry/virtualenvs/gsw-xarray-NsrEXKiZ-py3.8/lib/python3.8/site-packages/gsw/geostrophy.py:83: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
pgood = p[ind][igood]
When using xarray.DataArray as inputs for gsw.geo_strf_dyn_height, the result is only NaNs. Do you have any idea why this is so?
Example
Outputs
Using xarray
Outputs
With numpy 1.22.2 I also get a FutureWarning: