docs: def solar_azimuth(self, dateandtime, latitude, longitude):
          """Calculate the azimuth angle of the sun.
  
          :param dateandtime: The date and time for which to calculate
                              the angle.
          :type dateandtime:  :class:`~datetime.datetime`
          :param latitude:   Latitude - Northern latitudes should be positive
          :type latitude:    float
          :param longitude:  Longitude - Eastern longitudes should be positive
          :type longitude:   float
  
          :return: The azimuth angle in degrees clockwise from North.
          :rtype: float
  
          If `dateandtime` is a naive Python datetime then it is assumed to be
          in the UTC timezone.
          """
  
          if latitude > 89.8:
              latitude = 89.8
  
          if latitude < -89.8:
              latitude = -89.8
  
          if dateandtime.tzinfo is None:
              zone = 0
              utc_datetime = dateandtime
          else:
              zone = -dateandtime.utcoffset().total_seconds() / 3600.0
              utc_datetime = dateandtime.astimezone(pytz.utc)
  
          timenow = (
              utc_datetime.hour
              + (utc_datetime.minute / 60.0)
              + (utc_datetime.second / 3600.0)
          )
  
          JD = self._julianday(dateandtime)
          t = self._jday_to_jcentury(JD + timenow / 24.0)
          theta = self._sun_declination(t)
          eqtime = self._eq_of_time(t)
          solarDec = theta  # in degrees
  
          solarTimeFix = eqtime - (4.0 * -longitude) + (60 * zone)
          trueSolarTime = (
              dateandtime.hour * 60.0
              + dateandtime.minute
              + dateandtime.second / 60.0
              + solarTimeFix
          )
          #    in minutes
  
          while trueSolarTime > 1440:
              trueSolarTime = trueSolarTime - 1440
  
          hourangle = trueSolarTime / 4.0 - 180.0
          #    Thanks to Louis Schwarzmayr for the next line:
          if hourangle < -180:
              hourangle = hourangle + 360.0
  
          harad = radians(hourangle)
  
          csz = sin(radians(latitude)) * sin(radians(solarDec)) + cos(
              radians(latitude)
          ) * cos(radians(solarDec)) * cos(harad)
  
          if csz > 1.0:
              csz = 1.0
          elif csz < -1.0:
              csz = -1.0
  
          zenith = degrees(acos(csz))
  
          azDenom = cos(radians(latitude)) * sin(radians(zenith))
  
          if abs(azDenom) > 0.001:
              azRad = (
                  (sin(radians(latitude)) * cos(radians(zenith))) - sin(radians(solarDec))
              ) / azDenom
  
              if abs(azRad) > 1.0:
                  if azRad < 0:
                      azRad = -1.0
                  else:
                      azRad = 1.0
  
              azimuth = 180.0 - degrees(acos(azRad))
  
              if hourangle > 0.0:
                  azimuth = -azimuth
          else:
              if latitude > 0.0:
                  azimuth = 180.0
              else:
                  azimuth = 0.0
  
          if azimuth < 0.0:
              azimuth = azimuth + 360.0
  
          return azimuth