equatorial_to_ecliptic

ssapy.utils.equatorial_to_ecliptic(right_ascension, declination, degrees=False)[source][source]

Convert equatorial coordinates (RA, DEC) to ecliptic longitude and latitude.

This function transforms equatorial right ascension (RA) and declination (DEC) into ecliptic longitude and latitude, taking into account the obliquity of the ecliptic.

Parameters:

right_ascension (float): Right ascension of the object (in degrees or radians). declination (float): Declination of the object (in degrees or radians). degrees (bool, optional): If True, assumes input is in degrees and returns output in degrees;

otherwise, assumes input is in radians and returns output in radians (default is False).

Returns:

tuple: A tuple containing:
  • ec_longitude (float): Ecliptic longitude of the object (in radians or degrees).

  • ec_latitude (float): Ecliptic latitude of the object (in radians or degrees).

Notes:

  • The calculation uses the obliquity of the ecliptic, which is the tilt of Earth’s axis relative to its orbit. The constants cos_ec and sin_ec represent the cosine and sine of the obliquity angle, respectively.

  • The rad0to2pi function ensures the ecliptic longitude is normalized to the range [0, 2π] in radians.

  • The deg0to360 function ensures the ecliptic longitude is normalized to the range [0, 360] in degrees.

  • If degrees=True, the input is converted from degrees to radians using np.radians, and the output is converted back to degrees using np.degrees.

Example:

equatorial_to_ecliptic(180.0, 45.0, degrees=True) -> (ec_longitude, ec_latitude)