transform_vectors_sph_to_cart

transform_vectors_sph_to_cart#

transform_vectors_sph_to_cart(
*,
theta: VectorLikeFloat,
phi: VectorLikeFloat,
r: VectorLikeFloat,
u: ArrayLikeFloat,
v: ArrayLikeFloat,
w: ArrayLikeFloat,
) → tuple[NDArray[np.floating], NDArray[np.floating], NDArray[np.floating]][source]#

Transform vectors from spherical (r, phi, theta) to Cartesian coordinates (z, y, x).

Note the “reverse” order of arrays’s axes, commonly used in geosciences.

Parameters:
thetaVectorLikeFloat

Azimuthal angle in degrees [0, 360] of shape (M,).

phiVectorLikeFloat

Polar (zenith) angle in degrees [0, 180] of shape (N,).

rVectorLikeFloat

Distance (radius) from the point of origin of shape (P,).

uArrayLikeFloat

X-component of the vector of shape (M, N, P) with length-one axes dropped.

vArrayLikeFloat

Y-component of the vector of shape (M, N, P) with length-one axes dropped.

wArrayLikeFloat

Z-component of the vector of shape (M, N, P) with length-one axes dropped.

Returns:
u_t, v_t, w_tnumpy.ndarray

Arrays of transformed x-, y-, z-components, respectively.