imap_processing.spice.geometry.cartesian_to_spherical#

imap_processing.spice.geometry.cartesian_to_spherical(v: ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]]#

Convert cartesian coordinates to spherical coordinates.

Parameters:

v (np.ndarray) – A NumPy array with shape (n, 3) where each row represents a vector with x, y, z-components.

Returns:

spherical_coords – A NumPy array with shape (n, 3), where each row contains the spherical coordinates (r, azimuth, elevation):

  • r : Distance of the point from the origin.

  • azimuth : angle in the xy-plane in radians [0, 2*pi].

  • elevation : angle from the z-axis in radians [-pi/2, pi/2].

Return type:

np.ndarray