oceanspy.utils.spherical2cartesian

oceanspy.utils.spherical2cartesian(Y, X, R=None)[source]

Convert spherical coordinates to cartesian.

Parameters
Y: _xr.DataArray or array_like

Spherical Y coordinate (latitude)

X: _xr.DataArray or array_like

Spherical X coordinate (longitude)

R: scalar

Earth radius in km If None, use geopy default

Returns
x: _xr.DataArray or array_like

Cartesian x coordinate

y: _xr.DataArray or array_like

Cartesian y coordinate

z: scalar

Cartesian z coordinate