def get_heat_index(temperature, humidity):
temperature = cf.s2f(temperature)
humidity = cf.s2f(humidity)
if humidity > 0.0 and temperature >= 77.0:
# temperature ºF
# humidity over 100
c1 = -42.379
c2 = 2.04901523
c3 = 10.14333127
c4 = -0.22475541
c5 = -0.00683783
c6 = -0.05481717
c7 = 0.00122874
c8 = 0.00085282
c9 = -0.00000199
hi = c1 + c2 * temperature + c3 * humidity + c4 * temperature *\
humidity + c5 * math.pow(temperature, 2.0) + c6 *\
math.pow(humidity, 2.0) + c7 * math.pow(temperature, 2.0) *\
humidity + c8 * temperature * math.pow(humidity, 2.0) + c9 *\
math.pow(temperature, 2.0) * math.pow(humidity, 2.0)
return hi - temperature
return 0
评论列表
文章目录