-
Notifications
You must be signed in to change notification settings - Fork 6
/
HWvariables_info.py
82 lines (66 loc) · 3.53 KB
/
HWvariables_info.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
class VariablesInfo(object):
RAW_SOURCE = {
'HWA': { 'Longname' : 'Peak of the hottest heatwave per year',
'units' : 'degC',
'description': 'Peak of the hottest heatwave per year - yearly maximum of each heatwave peak',
},
'HWM': { 'Longname' : 'Average magnitude of the yearly heatwave',
'units' : 'degC2',
'description': 'Average magnitude of the yearly heatwave - yearly average of heatwave magnitude',
},
'HWN': { 'Longname' : 'Number of heatwaves',
'units' : '',
'description': 'Number of heatwaves per year',
},
'HWF': { 'Longname' : 'Number of heatwave days',
'units' : '',
'description': 'Number of heatwave days - expressed as the percentage relative to the total number of days',
},
'HWD': { 'Longname' : 'Duration of yearly longest heatwave',
'units' : 'days',
'description': 'Duration of the longest heatwave per year',
},
'HWT': { 'Longname' : 'First heat wave day of the year',
'units' : 'day',
'description': 'Time of the first heat wave day of the year from 1st %month%',
},
'HWL': { 'Longname' : 'Mean duration of heat waves',
'units' : 'days',
'description': 'Mean duration of heat waves',
},
'pct': { 'Longname' : 'Percentile 95th',
'units' : 'degC',
'description': 'Percentile 95th over the entire base_period',
},
'EHFindex': { 'Longname' : 'Excess Heat Factor',
'units' : 'degC2',
'description': 'Excess Heat Factor index',
},
'HWAt': { 'Longname' : 'Temperature at the peak of the hottest heatwave per year ',
'units' : 'degC',
'description': 'Temperature at the peak of the hottest heatwave per year - yearly maximum of each heatwave peak',
},
'HWMt': { 'Longname' : 'Average temperature for all yearly heatwave',
'units' : 'degC',
'description': 'Average temperature for all yearly heatwave - yearly average of temperature heatwave days',
},
'spell': { 'Longname' : 'Length of the heatwave',
'units' : 'days',
'description': 'Length of the heatwave in days after the date',
},
}
def get_var_names(self):
return self.RAW_SOURCE.keys()
def get_atts(self, var_name):
""" get the list of variable attributes
"""
return self.RAW_SOURCE[var_name].keys()
def is_supported(self, var_name):
for raw_type, vnames in self.RAW_SOURCE.items():
if var_name in vnames.keys():
return True
return False
def get_varatt(self,var_name,attrib):
return self.RAW_SOURCE[var_name][attrib]
def get_attdict(self,var_name):
return self.RAW_SOURCE[var_name]