clouddrift.sphere.cartesian_to_tangentplane

clouddrift.sphere.cartesian_to_tangentplane#

clouddrift.sphere.cartesian_to_tangentplane(u: float | ndarray, v: float | ndarray, w: float | ndarray, longitude: float | ndarray, latitude: float | ndarray) tuple[float] | tuple[ndarray][source]#

Project a three-dimensional Cartesian vector on a plane tangent to a spherical Earth.

The Cartesian coordinate system is a right-handed system whose origin lies at the center of a sphere. It is oriented with the Z-axis passing through the north pole at lat = 90, the X-axis passing through the point lon = 0, lat = 0, and the Y-axis passing through the point lon = 90, lat = 0.

Parameters#

ufloat or np.ndarray

First component of Cartesian vector.

vfloat or np.ndarray

Second component of Cartesian vector.

wfloat or np.ndarray

Third component of Cartesian vector.

longitudefloat or np.ndarray

Longitude in degrees of tangent point of plane.

latitudefloat or np.ndarray

Latitude in degrees of tangent point of plane.

Returns#

up: float or np.ndarray

First component of projected vector on tangent plane (positive eastward).

vp: float or np.ndarray

Second component of projected vector on tangent plane (positive northward).

Raises#

Warning

Raised if the input latitude is not in the expected range [-90, 90].

Examples#

>>> u, v = cartesian_to_tangentplane(1, 1, 1, 45, 90)

See Also#

tangentplane_to_cartesian()