-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconverter.py
287 lines (172 loc) · 5.12 KB
/
converter.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
import datetime
def time(d: float):
return datetime.datetime.combine(datetime.date(2024, 8, 1) + datetime.timedelta(days=int(d - 739100)),
datetime.time(hour=(round(24 * (d % 1)))))
def apcpsfc(x):
"surface total precipitation [kg/m^2]"
return x[0][0]
def capesfc(x):
"surface convective available potential energy [j/kg]"
return x[0][0]
def cinsfc(x):
"surface convective inhibition [j/kg]"
return x[0][0]
def dpt2m(x):
"2 m above ground dew point temperature [k]"
return x[0][0] - 273.15
def dzdtprs(x):
"(1000 975 950 925 900.. 10 7 4 2 1) vertical velocity (geometric) [m/s]"
return x[0][0][0]
def gustsfc(x):
"surface wind speed (gust) [m/s]"
return x[0][0]
def hcdcavehcll(x):
"high cloud layer high cloud cover [%]"
return x[0][0]
def hgtsfc(x):
"surface geopotential height [gpm]"
return x[0][0]
def hgtprs(x):
"(1000 975 950 925 900.. 10 7 4 2 1) geopotential height [gpm]"
return x[0][0][0]
def hgtceil(x):
"cloud ceiling geopotential height [gpm]"
return x[0][0]
def hpblsfc(x):
"surface planetary boundary layer height [m]"
return x[0][0]
def lcdcavelcll(x):
"low cloud layer low cloud cover [%]"
return x[0][0]
def lftxsfc(x):
"surface surface lifted index [k]"
return x[0][0]
def mcdcavemcll(x):
"middle cloud layer medium cloud cover [%]"
return x[0][0]
def no4lftxsfc(x):
"surface best (4 layer) lifted index [k]"
return x[0][0]
def prateavesfc(x):
"surface precipitation rate [kg/m^2/s]"
return x[0][0] * 3600 * 3
def pressfc(x):
"surface pressure [pa] "
return x[0][0] / 133.322
def pres80m(x):
"80 m above ground pressure [pa]"
return x[0][0] / 133.322
def prmslmsl(x):
"mean sea level pressure reduced to msl [pa] "
return x[0][0] / 133.322
def rhprs(x):
"(1000 975 950 925 900.. 10 7 4 2 1) relative humidity [%]"
return x[0][0][0]
def rh2m(x):
"2 m above ground relative humidity [%]"
return x[0][0]
def spfhprs(x):
"(1000 975 950 925 900.. 10 7 4 2 1) specific humidity [kg/kg]"
return x[0][0]
def spfh2m(x):
"2 m above ground specific humidity [kg/kg]"
return x[0][0]
def spfh80m(x):
"80 m above ground specific humidity [kg/kg]"
return x[0][0]
def tcdcaveclm(x):
"entire atmosphere total cloud cover [%]"
return x[0][0]
def tcdcblcll(x):
"boundary layer cloud layer total cloud cover [%]"
return x[0][0]
def tcdcprs(x):
"(1000 975 950 925 900.. 250 200 150 100 50) total cloud cover [%]"
return x[0][0][0]
def tcdcccll(x):
"convective cloud layer total cloud cover [%]"
return x[0][0]
def tmax2m(x):
"2 m above ground maximum temperature [k]"
return x[0][0] - 273.15
def tmin2m(x):
"2 m above ground minimum temperature [k]"
return x[0][0] - 273.15
def tmpsfc(x):
"surface temperature [k]"
return x[0][0] - 273.15
def tmpprs(x):
"(1000 975 950 925 900.. 10 7 4 2 1) temperature [k]"
return x[0][0][0] - 273.15
def tmp2m(x):
"2 m above ground temperature [k]"
return x[0][0] - 273.15
def tmp80m(x):
"80 m above ground temperature [k]"
return x[0][0] - 273.15
def tmp100m(x):
"100 m above ground temperature [k]"
return x[0][0] - 273.15
def ugrdprs(x):
"(1000 975 950 925 900.. 10 7 4 2 1) u-component of wind [m/s]"
return x[0][0][0]
def ugrd_1829m(x):
"1829 m above mean sea level u-component of wind [m/s]"
return x[0][0]
def ugrd10m(x):
"10 m above ground u-component of wind [m/s]"
return x[0][0]
def ugrd20m(x):
"20 m above ground u-component of wind [m/s]"
return x[0][0]
def ugrd30m(x):
"30 m above ground u-component of wind [m/s]"
return x[0][0]
def ugrd40m(x):
"40 m above ground u-component of wind [m/s]"
return x[0][0]
def ugrd50m(x):
"50 m above ground u-component of wind [m/s]"
return x[0][0]
def ugrd80m(x):
"80 m above ground u-component of wind [m/s]"
return x[0][0]
def ugrd100m(x):
"100 m above ground u-component of wind [m/s]"
return x[0][0]
def ugrdpbl(x):
"planetary boundary layer u-component of wind [m/s]"
return x[0][0]
def vgrdprs(x):
"(1000 975 950 925 900.. 10 7 4 2 1) v-component of wind [m/s]"
return x[0][0][0]
def vgrd_1829m(x):
"1829 m above mean sea level v-component of wind [m/s]"
return x[0][0]
def vgrd10m(x):
"10 m above ground v-component of wind [m/s]"
return x[0][0]
def vgrd20m(x):
"20 m above ground v-component of wind [m/s]"
return x[0][0]
def vgrd30m(x):
"30 m above ground v-component of wind [m/s]"
return x[0][0]
def vgrd40m(x):
"40 m above ground v-component of wind [m/s]"
return x[0][0]
def vgrd50m(x):
"50 m above ground v-component of wind [m/s]"
return x[0][0]
def vgrd80m(x):
"80 m above ground v-component of wind [m/s]"
return x[0][0]
def vgrd100m(x):
"100 m above ground v-component of wind [m/s]"
return x[0][0]
def vgrdpbl(x):
"planetary boundary layer v-component of wind [m/s]"
return x[0][0]
def vissfc(x):
"surface visibility [m]"
return x[0][0]