imap_processing.spice.geometry.spherical_to_cartesian#

imap_processing.spice.geometry.spherical_to_cartesian(spherical_coords: ndarray[tuple[int, ...], dtype[_ScalarType_co]], degrees: bool = False) ndarray[tuple[int, ...], dtype[_ScalarType_co]]#

Convert spherical coordinates to Cartesian coordinates.

Parameters:
  • spherical_coords (np.ndarray) –

    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 xy-plane in radians [-pi/2, pi/2].

  • degrees (bool) – Set to True if input azimuth and elevation angles are in degrees. Defaults to False.

Returns:

cartesian_coords – Cartesian coordinates.

Return type:

np.ndarray