def calcSatHourangle(SatLon, SiteLat, SiteLon):
Azimuth = calcAzimuth(SatLon, SiteLat, SiteLon )
Elevation = calcElevation(SatLon, SiteLat, SiteLon)
a = - math.cos(math.radians(Elevation)) * math.sin(math.radians(Azimuth))
b = math.sin(math.radians(Elevation)) * math.cos(math.radians(SiteLat)) - \
math.cos(math.radians(Elevation)) * math.sin(math.radians(SiteLat)) * \
math.cos(math.radians(Azimuth))
# Works for all azimuths (northern & southern hemisphere)
returnvalue = 180 + math.degrees(math.atan(a / b))
if Azimuth > 270:
returnvalue += 180
if returnvalue > 360:
returnvalue = 720 - returnvalue
if Azimuth < 90:
returnvalue = 180 - returnvalue
return returnvalue
评论列表
文章目录