spherical_to_cartesian

halotools.utils.spherical_to_cartesian(ra, dec)[source] [edit on github]

Calculate cartesian coordinates on a unit sphere given two angular coordinates. parameters

Parameters:

ra : array

Angular coordinate in degrees

dec : array

Angular coordinate in degrees

Returns:

x,y,z : sequence of arrays

Cartesian coordinates.

Examples

>>> ra, dec = 0.1, 1.5
>>> x, y, z = spherical_to_cartesian(ra, dec)