celestial_to_cartesian

jwst.extract_1d.ifu.celestial_to_cartesian(ra, dec)[source]

Convert celestial coordinates to Cartesian.

Parameters:
ra, decndarray or float

The right ascension and declination (degrees). Both ra and dec should be arrays of the same shape, or they should both be float.

Returns:
cartndarray

If ra and dec are float, this will be a 3-element array. If ra and dec are arrays, this will be an array with shape ra.shape + (3,). For each element of ra (or dec), the last axis of cart will give the Cartesian coordinates of a unit vector in the direction ra, dec. The elements of the vector in Cartesian coordinates are in the order x, y, z, where x is the direction toward the vernal equinox, y is the direction toward right ascension of 90 degrees (6 hours) and declination of 0, and z is toward the north celestial pole.