-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
95 lines (83 loc) · 4.11 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import math
from WeatherUnits.defaults.WeatherFlow import Wind
from WeatherUnits.defaults.WeatherFlow.units import Density, PrecipitationType, Temperature, Precipitation
from WeatherUnits.length import Kilometer, Millimeter
from WeatherUnits.others import Direction, Humidity, Lux, RadiantFlux, Volts
from WeatherUnits.pressure import Pressure, hPa
from WeatherUnits.temperature import Celsius
from WeatherUnits.time import Minute, Second
classAtlas = {
'time': int,
'lullSpeed': Wind,
'windSpeed': Wind,
'gustSpeed': Wind,
'speed': Wind,
'direction': Direction,
'windDirection': Direction,
'windSampleInterval': Second,
'temperature': Celsius,
"feelsLike": Celsius,
"heatIndex": Celsius,
"windChill": Celsius,
"dewpoint": Celsius,
"wetbulb": Celsius,
"delta_t": Celsius,
'humidity': Humidity,
'pressure': hPa,
"pressureTrend": str,
"airDensity": Density,
'illuminance': Lux,
'uvi': int,
'irradiance': RadiantFlux,
'accumulation': Millimeter,
'distance': Kilometer,
'strikeDistance': Kilometer,
'strikeLastDistance': Kilometer,
'strikeLastTime': int,
'strikes': int,
"strikes1h": int,
"strikes3h": int,
'energy': int,
'battery': Volts,
'reportInterval': Minute,
'precipitationType': int,
'rainingMinutes': list,
'rainingTotalMinutes': Minute,
'rainingTotalMinutesYesterday': Minute,
'dailyAccumulationRaw': Millimeter,
'dailyAccumulationRainCheck': bool,
'localDailyAccumulationRainCheck': bool,
"dailyAccumulationYesterday": Millimeter,
"dailyAccumulationYesterdayRainCheck": Millimeter,
"precipitationTypeYesterday": int,
"accumulation1h": Precipitation,
'rainCheck': int,
"pulse_adj_ob_temp": Celsius,
"pulse_adj_ob_time": int,
"pulse_adj_ob_wind_avg": Wind,
}
summaryAtlas = {
'feels_like': 'feelsLike',
'heat_index': 'heatIndex',
'dew_point': 'dewpoint',
'wet_bulb_temperature': 'wetbulb',
'precip_accum_local_yesterday': 'dailyAccumulationYesterday',
'precip_accum_local_yesterday_final': 'dailyAccumulationYesterdayRainCheck',
'precip_analysis_type_yesterday': 'precipitationTypeYesterday',
'precip_total_1h': 'accumulation1h',
'pressure_trend': 'pressureTrend',
'air_density': 'airDensity',
# 'pulse_adj_ob_temp': 'pulse_adj_ob_temp',
# 'pulse_adj_ob_time': 'pulse_adj_ob_time',
# 'pulse_adj_ob_wind_avg': 'pulse_adj_ob_wind_avg',
'raining_minutes': 'rainingMinutes',
"precip_minutes_local_day": 'rainingTotalMinutes',
"precip_minutes_local_yesterday": 'rainingTotalMinutesYesterday',
'strike_last_epoch': 'strikeLastTime',
'strike_last_dist': 'strikeLastDistance',
'strike_count_1h': 'strikes1h',
'strike_count_3h': 'strikes3h',
'wind_chill': 'windChill'
}
def airDensityCalc(temperature: Celsius, pressure: Pressure):
return (pressure.mb*100)/(temperature.kel*287.058)