horizontal_to_equatorial

ssapy.utils.horizontal_to_equatorial(observer_latitude, azimuth, altitude)[source][source]

Convert horizontal coordinates (azimuth and altitude) to equatorial coordinates (hour angle and declination).

This function calculates the hour angle and declination of a celestial object based on its horizontal coordinates and the observer’s latitude.

Parameters:

observer_latitude (float): Latitude of the observer in degrees. azimuth (float): Azimuth angle of the object in degrees (measured clockwise from north). altitude (float): Altitude angle of the object in degrees (above the horizon).

Returns:

tuple: A tuple containing:
  • hour_angle (float): Hour angle of the object in degrees.

  • declination (float): Declination of the object in degrees.

Notes:

  • The function assumes the input angles are in degrees and internally converts them to radians for calculations.

  • Adjusts for southern hemisphere observations by flipping zenith angle signs.

  • The hour angle is calculated using trigonometric relationships, with corrections for specific latitude and declination conditions.

Example:

horizontal_to_equatorial(45.0, 120.0, 30.0) -> (hour_angle, declination)