cartesian_to_spherical¶
- trackstream.utils.cartesian_to_spherical(x: Union[float, numpy.ndarray], y: Union[float, numpy.ndarray], z: Union[float, numpy.ndarray], deg: bool = False) Tuple[Union[float, numpy.ndarray], Union[float, numpy.ndarray], Union[float, numpy.ndarray]][source]¶
Cartesian to Spherical.
Adopts the Astropy ranges for
lonandlat.- Parameters
- x, y, zscalar or ndarray
- degbool
Whether to return in degrees or radians – default radians.
- Returns
- r, lat, lonscalar or ndarray