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
raanddecshould be arrays of the same shape, or they should both be float.
- Returns:
- cartndarray
If
raanddecare float, this will be a 3-element array. Ifraanddecare arrays, this will be an array with shapera.shape + (3,). For each element ofra(ordec), the last axis ofcartwill give the Cartesian coordinates of a unit vector in the directionra,dec. The elements of the vector in Cartesian coordinates are in the orderx, 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.