ecliptic_xyz_to_equatorial
- ssapy.utils.ecliptic_xyz_to_equatorial(xc, yc, zc, xe=0, ye=0, ze=0, degrees=False)[source][source]
Convert ecliptic Cartesian coordinates (X, Y, Z) to equatorial right ascension (RA) and declination (DEC).
This function first converts ecliptic Cartesian coordinates to equatorial Cartesian coordinates and then computes the equatorial coordinates (RA and DEC) of an object relative to the Earth or another reference point.
Parameters:
xc (float): X-coordinate of the object in the ecliptic coordinate system. yc (float): Y-coordinate of the object in the ecliptic coordinate system. zc (float): Z-coordinate of the object in the ecliptic coordinate system. xe (float, optional): X-coordinate of the reference point (default is 0, typically Earth’s position). ye (float, optional): Y-coordinate of the reference point (default is 0, typically Earth’s position). ze (float, optional): Z-coordinate of the reference point (default is 0, typically Earth’s position). degrees (bool, optional): If True, returns the RA and DEC in degrees; otherwise, returns them in radians (default is False).
Returns:
- tuple: A tuple containing:
ra (float): Right ascension of the object (in radians or degrees).
dec (float): Declination of the object (in radians or degrees).
Notes:
The function relies on ecliptic_xyz_to_equatorial_xyz to perform the conversion from ecliptic Cartesian coordinates to equatorial Cartesian coordinates.
The calculation assumes the XY plane corresponds to the celestial equator, and the -X axis points toward the vernal equinox.
The rad0to2pi function ensures the RA is normalized to the range [0, 2π] in radians.
The np.arctan2 function is used to compute the RA, and np.arcsin is used for DEC.
If degrees=True, the results are converted from radians to degrees using np.degrees.
Example:
ecliptic_xyz_to_equatorial(1.0, 0.5, 0.3, xe=0.1, ye=0.2, ze=0.3, degrees=True) -> (ra, dec)