2020-11-26 09:26:55 -05:00
|
|
|
"""
|
|
|
|
weather helper
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2021-06-10 08:29:24 -04:00
|
|
|
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
2020-11-26 09:26:55 -05:00
|
|
|
"""
|
2020-10-28 13:42:58 -04:00
|
|
|
import math
|
|
|
|
import helpers.constants as cte
|
|
|
|
|
|
|
|
|
2021-08-27 12:51:30 -04:00
|
|
|
class Weather:
|
2020-11-26 09:26:55 -05:00
|
|
|
"""
|
|
|
|
Weather class
|
|
|
|
"""
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def sky_temperature(ambient_temperature):
|
2020-11-26 09:26:55 -05:00
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get sky temperature from ambient temperature in Celsius
|
2020-11-26 09:26:55 -05:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
# Swinbank - Source sky model approximation(1963) based on cloudiness statistics(32 %) in United States
|
2020-10-28 13:42:58 -04:00
|
|
|
# ambient temperatures( in °C)
|
|
|
|
# sky temperatures( in °C)
|
|
|
|
values = []
|
2020-10-30 13:47:59 -04:00
|
|
|
for temperature in ambient_temperature:
|
2021-05-25 13:34:57 -04:00
|
|
|
value = 0.037536 * math.pow((temperature + cte.KELVIN), 1.5) \
|
|
|
|
+ 0.32 * (temperature + cte.KELVIN) - cte.KELVIN
|
2020-10-28 13:42:58 -04:00
|
|
|
values.append(value)
|
2020-10-30 13:47:59 -04:00
|
|
|
return values
|