code: def radec2azel(
      ra_deg: float,
      dec_deg: float,
      lat_deg: float,
      lon_deg: float,
      time: datetime,
  ) -> tuple[float, float]:
      """
      converts right ascension, declination to azimuth, elevation
  
      Parameters
      ----------
  
      ra_deg : float
          right ascension to target [degrees]
      dec_deg : float
          declination to target [degrees]
      lat_deg : float
          observer WGS84 latitude [degrees]
      lon_deg : float
          observer WGS84 longitude [degrees]
      time : datetime.datetime
          time of observation
  
      Results
      -------
  
      az_deg : float
          azimuth clockwise from north to point [degrees]
      el_deg : float
          elevation above horizon to point [degrees]
  
  
      from D. Vallado "Fundamentals of Astrodynamics and Applications "
         4th Edition Ch. 4.4 pg. 266-268
      """
      if abs(lat_deg) > 90:
          raise ValueError("-90 <= lat <= 90")
  
      ra = radians(ra_deg)
      dec = radians(dec_deg)
      lat = radians(lat_deg)
      lon = radians(lon_deg)
  
      lst = datetime2sidereal(time, lon)  # RADIANS
      # %% Eq. 4-11 p. 267 LOCAL HOUR ANGLE
      lha = lst - ra
      # %% #Eq. 4-12 p. 267
      el = asin(sin(lat) * sin(dec) + cos(lat) * cos(dec) * cos(lha))
      # %% combine Eq. 4-13 and 4-14 p. 268
      az = atan2(
          -sin(lha) * cos(dec) / cos(el),
          (sin(dec) - sin(el) * sin(lat)) / (cos(el) * cos(lat)),
      )
  
      return degrees(az) % 360.0, degrees(el)
  
imports: from __future__ import annotations
  from datetime import datetime
  from .mathfun import asin, atan2, cos, degrees, radians, sin
  from .sidereal import datetime2sidereal
label_desc: Use image node_id 2 for calling a global function with example usage: radec2azel(ra_deg, dec_deg, lat_deg, lon_deg, time) and returns: unknown,  degrees