ecliptic_to_equatorial

ssapy.utils.ecliptic_to_equatorial(lon, lat, degrees=False)[source][source]

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

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

Parameters:

lon (float): Ecliptic longitude of the object (in degrees or radians). lat (float): Ecliptic latitude 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:
  • ra (float): Right ascension of the object (in radians or degrees).

  • dec (float): Declination 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 np.arctan function computes the RA, and np.arcsin computes the DEC.

  • 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:

ecliptic_to_equatorial(180.0, 45.0, degrees=True) -> (ra, dec)