-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdicts.py
588 lines (584 loc) · 19.5 KB
/
dicts.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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
import datetime
import joanne
list_of_vars = [
"sounding",
"circle",
# "launch_time",
"alt",
# "latitude",
# "longitude",
# "pressure",
# "temperature",
# "relative_humidity",
# "wind_speed",
# "wind_direction",
# "u_wind",
# "v_wind",
# "potential_temperature",
# "specific_humidity",
# "precipitable_water",
# "static_stability",
# "low_height_flag",
# "cloud_flag",
"platform_id",
"flight_altitude",
# "flight_lat",
# "flight_lon",
"circle_lon",
"circle_lat",
"circle_diameter",
"circle_time",
# "dx",
# "dy",
"u",
"dudx",
"dudy",
# "sondes_regressed",
"segment_id",
"sonde_id",
"v",
"dvdx",
"dvdy",
"q",
"dqdx",
"dqdy",
"ta",
"dtadx",
"dtady",
"p",
"dpdx",
"dpdy",
"D",
"vor",
# "density",
# "mean_density",
"W",
"se_dudx",
"se_dudy",
"se_dvdx",
"se_dvdy",
"se_dqdx",
"se_dqdy",
"se_dpdx",
"se_dpdy",
"se_dtadx",
"se_dtady",
"se_D",
"se_vor",
"se_W",
"omega",
# "h_adv_q",
# "h_adv_ta",
# "h_adv_p",
# "h_adv_u",
# "h_adv_v",
]
nc_attrs = {
"sounding": {
"standard_name": "sounding",
"long_name": "sonde number",
"units": "",
# "axis": "T",
},
"circle": {
"standard_name": "time",
"long_name": "circle number",
"units": "",
# "axis": "T",
},
"launch_time": {
"standard_name": "time",
"long_name": "time of dropsonde launch",
"units": "seconds since 2020-01-01",
"calendar": "gregorian",
# "axis": "T",
},
"sonde_id": {
"description": "unique sonde ID",
"long_name": "sonde identifier",
"units": "",
"coordinates": "circle segment_id sounding",
},
"alt": {
"standard_name": "geopotential_height",
"long_name": "geopotential height",
"description": "height obtained by integrating upwards the atmospheric thickness estimated from the hypsometric equation",
"units": "m",
"axis": "Z",
"positive": "up",
},
"latitude": {
"standard_name": "latitude",
"long_name": "latitude",
"units": "degree_north",
"axis": "Y",
},
"longitude": {
"standard_name": "longitude",
"long_name": "longitude",
"units": "degree_east",
"axis": "X",
},
# "p": {
# "standard_name": "air_pressure",
# "long_name": "atmospheric pressure",
# "units": "Pa",
# "coordinates": "launch_time longitude latitude alt",
# },
# "ta": {
# "standard_name": "air_temperature",
# "long_name": "dry bulb temperature",
# "units": "K",
# "coordinates": "launch_time longitude latitude alt",
# },
# "potential_temperature": {
# "standard_name": "air_potential_temperature",
# "long_name": "air potential temperature",
# "units": "K",
# "coordinates": "launch_time longitude latitude alt",
# },
# "relative_humidity": {
# "standard_name": "relative_humidity",
# "long_name": "relative humidity",
# "units": "",
# "coordinates": "launch_time longitude latitude alt",
# },
# "specific_humidity": {
# "standard_name": "specific_humidity",
# "long_name": "specific humidity",
# "units": "kg kg-1",
# "coordinates": "launch_time longitude latitude alt",
# },
# "wind_speed": {
# "standard_name": "wind_speed",
# "long_name": "wind speed",
# "units": "m s-1",
# "coordinates": "launch_time longitude latitude alt",
# },
# "u_wind": {
# "standard_name": "eastward_wind",
# "long_name": "u-component of the wind",
# "units": "m s-1",
# "coordinates": "launch_time longitude latitude alt",
# },
# "v_wind": {
# "standard_name": "northward_wind",
# "long_name": "v-component of the wind",
# "units": "m s-1",
# "coordinates": "launch_time longitude latitude alt",
# },
# "wind_direction": {
# "standard_name": "wind_from_direction",
# "long_name": "wind direction",
# "units": "degree",
# "coordinates": "launch_time longitude latitude alt",
# },
# "precipitable_water": {
# "standard_name": "precipitable_water",
# "long_name": "integrated water vapour in the measured column",
# "units": "kg m-2",
# "coordinates": "launch_time",
# },
# "static_stability": {
# "standard_name": "static_stability",
# "long_name": "static stability",
# "description": "gradient of potential temperature along the pressure grid",
# "units": " K hPa-1",
# "coordinates": "launch_time longitude latitude alt",
# },
# "low_height_flag": {
# "long_name": "flag to indicate if flight height at launch was low",
# "flag_values": "1, 0",
# "units": "",
# "flag_meanings": "flight height below 4 km flight height at or above 4 km",
# "valid_range": "0, 1",
# },
# "cloud_flag": {
# "long_name": "flag to indicate presence of cloud",
# "flag_values": "1, 0",
# "units": "",
# "flag_meanings": "cloud no_cloud",
# "valid_range": "0, 1",
# },
"platform_id": {
"standard_name": "platform_id",
"long_name": "platform which flew the circle",
"coordinates": "circle segment_id circle_lon circle_lat circle_time",
"units": "",
},
"flight_altitude": {
"standard_name": "altitude",
"long_name": "mean altitude of the aircraft during the circle",
"units": "m",
"coordinates": "circle segment_id circle_lon circle_lat circle_time",
"positive": "up",
},
"segment_id": {
"description": "unique segment ID",
"long_name": "segment (circle) identifier",
"cf_role": "trajectory_id",
"units": "",
},
# "flight_lat": {
# "standard_name": "latitude",
# "long_name": "latitude of the aircraft when the dropsonde was launched",
# "units": "degree_north",
# "coordinates": "launch_time",
# },
# "flight_lon": {
# "standard_name": "longitude",
# "long_name": "longitude of the aircraft when the dropsonde was launched",
# "units": "degree_east",
# "coordinates": "launch_time",
# },
"circle_lon": { # mean lon for circles at all levels fitted as least square fit to all sondes
"standard_name": "longitude",
"long_name": "longitude of fitted circle for all regressed sondes in circle",
"units": "degree_east",
# "coordinates": "circle",
"axis": "X",
},
"circle_lat": { # mean y for circles at all levels fitted as least square fit to all sondes
"standard_name": "latitude",
"long_name": "latitude of fitted circle for all regressed sondes in circle",
"units": "degree_north",
# "coordinates": "circle",
"axis": "Y",
},
"circle_diameter": { # mean diameter for circles at all levels fitted as least square fit to all sondes
# "standard_name": "circle_diameter",
"long_name": "diameter of fitted circle for all regressed sondes in circle",
"units": "m",
"coordinates": "circle segment_id circle_lon circle_lat",
},
"circle_time": {
# "standard_name": "circle_time",
"long_name": "mean launch time of all sondes in circle",
# "units": "seconds since 1970-01-01 00:00:00 UTC",
# "calendar": "gregorian",
"axis": "T",
},
"dx": {
# "standard_name": "delta_x",
"long_name": "zonal distance of sonde from center of circle",
"units": "m",
"coordinates": "sounding alt",
},
"dy": {
# "standard_name": "delta_y",
"long_name": "meridional distance of sonde from center of circle",
"units": "m",
"coordinates": "sounding alt",
},
"u": {
"standard_name": "eastward_wind",
"long_name": "mean eastward wind in circle",
"units": "m s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
},
"dudx": {
"standard_name": "eastward_derivative_of_eastward_wind",
"long_name": "zonal gradient of eastward wind",
"units": "s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dudx",
},
"dudy": {
"standard_name": "northward_derivative_of_eastward_wind",
"long_name": "meridional gradient of eastward wind",
"units": "s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dudy",
},
"sondes_regressed": {
"long_name": "number of sondes regressed",
"units": "",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
},
"v": {
"standard_name": "northward_wind",
"long_name": "mean northward wind in circle",
"units": "m s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
},
"dvdx": {
"standard_name": "eastward_derivative_of_northward_wind",
"long_name": "zonal gradient of northward wind",
"units": "s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dvdx",
},
"dvdy": {
"standard_name": "northward_derivative_of_northward_wind",
"long_name": "meridional gradient of northward wind",
"units": "s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dvdy",
},
"q": {
"standard_name": "specific_humidity",
"long_name": "mean specific humidity in circle",
"units": "kg kg-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
},
"dqdx": {
"standard_name": "eastward_derivative_of_specific_humidity",
"long_name": "zonal gradient of specific humidity",
"units": "kg kg-1 m-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dqdx",
},
"dqdy": {
"standard_name": "northward_derivative_of_specific_humidity",
"long_name": "meridional gradient of specific humidity",
"units": "kg kg-1 m-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dqdy",
},
"ta": {
"standard_name": "air_temperature",
"long_name": "mean air temperature in circle",
"units": "K",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
},
"dtadx": {
"standard_name": "eastward_derivative_of_air_temperature",
"long_name": "zonal gradient of temperature",
"units": "K m-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dtadx",
},
"dtady": {
"standard_name": "northward_derivative_of_air_temperature",
"long_name": "meridional gradient of temperature",
"units": "K m-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dtady",
},
"p": {
"standard_name": "air_pressure",
"long_name": "mean air pressure in circle",
"units": "Pa",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
},
"dpdx": {
"standard_name": "eastward_derivative_of_air_pressure",
"long_name": "zonal gradient of pressure",
"units": "Pa m-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dpdx",
},
"dpdy": {
"standard_name": "northward_derivative_of_air_pressure",
"long_name": "meridional gradient of pressure",
"units": "Pa m-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_dpdy",
},
"D": {
"standard_name": "divergence_of_wind",
"long_name": "area averaged horizontal mass divergence",
"units": "s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_D",
},
"vor": {
"standard_name": "atmosphere_upward_relative_vorticity",
"long_name": "area averaged horizontal relative vorticity",
"units": "s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_vor",
},
"density": {
"standard_name": "air_density",
"long_name": "air density",
"units": "kg m-3",
"coordinates": "launch_time alt",
},
"mean_density": {
"standard_name": "air_density",
"long_name": "mean air density across all sondes in circle",
"units": "kg m-3",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
},
"W": {
"standard_name": "upward_air_velocity",
"long_name": "area averaged vertical air velocity",
"units": "m s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
"ancillary_variables": "se_W",
},
"omega": {
"standard_name": "vertical_air_velocity_expressed_as_tendency_of_pressure",
"long_name": "area averaged atmospheric pressure velocity",
"units": "Pa s-1",
"coordinates": "circle segment_id circle_lon circle_lat circle_time alt",
},
# "h_adv_q": {
# "standard_name": "q_advection",
# "long_name": "horizontal advection of specific humidity",
# "units": "kg kg-1 s-1",
# "coordinates": "circle alt",
# },
# "h_adv_ta": {
# "standard_name": "T_advection",
# "long_name": "horizontal advection of temperature",
# "units": "K s-1",
# "coordinates": "circle alt",
# },
# "h_adv_p": {
# "standard_name": "p_advection",
# "long_name": "horizontal advection of pressure",
# "units": "Pa s-1",
# "coordinates": "circle alt",
# },
# "h_adv_u": {
# "standard_name": "u_advection",
# "long_name": "horizontal advection of eastward wind",
# "units": "m s-1 s-1",
# "coordinates": "circle alt",
# },
# "h_adv_v": {
# "standard_name": "v_advection",
# "long_name": "horizontal advection of northward wind",
# "units": "m s-1 s-1",
# "coordinates": "circle alt",
# },
"se_dudx": {
"standard_name": "eastward_derivative_of_eastward_wind standard_error",
"units": "s-1",
},
"se_dudy": {
"standard_name": "northward_derivative_of_eastward_wind standard_error",
"units": "s-1",
},
"se_dvdx": {
"standard_name": "eastward_derivative_of_northward_wind standard_error",
"units": "s-1",
},
"se_dvdy": {
"standard_name": "northward_derivative_of_northward_wind standard_error",
"units": "s-1",
},
"se_dqdx": {
"standard_name": "eastward_derivative_of_specific_humidity standard_error",
"units": "kg kg-1 m-1",
},
"se_dqdy": {
"standard_name": "northward_derivative_of_specific_humidity standard_error",
"units": "kg kg-1 m-1",
},
"se_dpdx": {
"standard_name": "eastward_derivative_of_air_pressure standard_error",
"units": "Pa m-1",
},
"se_dpdy": {
"standard_name": "northward_derivative_of_air_pressure standard_error",
"units": "Pa m-1",
},
"se_dtadx": {
"standard_name": "eastward_derivative_of_air_temperature standard_error",
"units": "K m-1",
},
"se_dtady": {
"standard_name": "northward_derivative_of_air_temperature standard_error",
"units": "K m-1",
},
"se_D": {"standard_name": "divergence_of_wind standard_error", "units": "s-1",},
"se_vor": {
"standard_name": "atmosphere_upward_relative_vorticity standard_error",
"units": "s-1",
},
"se_W": {"standard_name": "upward_air_velocity standard_error", "units": "m s-1",},
}
nc_dims = {
"sounding": ["sounding"],
"circle": ["circle"],
"segment_id": ["circle"],
"launch_time": ["circle", "sounding"],
"sonde_id": ["circle", "sounding"],
"alt": ["alt"],
"latitude": ["circle", "sounding", "alt"],
"longitude": ["circle", "sounding", "alt"],
"pressure": ["circle", "sounding", "alt"],
"temperature": ["circle", "sounding", "alt"],
"relative_humidity": ["circle", "sounding", "alt"],
"wind_speed": ["circle", "sounding", "alt"],
"wind_direction": ["circle", "sounding", "alt"],
"u_wind": ["circle", "sounding", "alt"],
"v_wind": ["circle", "sounding", "alt"],
"potential_temperature": ["circle", "sounding", "alt"],
"specific_humidity": ["circle", "sounding", "alt"],
"precipitable_water": ["circle", "sounding"],
"static_stability": ["circle", "sounding", "alt"],
"low_height_flag": ["circle", "sounding"],
"cloud_flag": ["circle", "sounding", "alt"],
"platform_id": ["circle"],
"flight_altitude": ["circle"],
"flight_lat": ["circle", "sounding"],
"flight_lon": ["circle", "sounding"],
"circle_lon": ["circle"],
"circle_lat": ["circle"],
"circle_diameter": ["circle"],
"circle_time": ["circle"],
"dx": ["circle", "sounding", "alt"],
"dy": ["circle", "sounding", "alt"],
"u": ["circle", "alt"],
"dudx": ["circle", "alt"],
"dudy": ["circle", "alt"],
"sondes_regressed": ["circle", "alt"],
"v": ["circle", "alt"],
"dvdx": ["circle", "alt"],
"dvdy": ["circle", "alt"],
"q": ["circle", "alt"],
"dqdx": ["circle", "alt"],
"dqdy": ["circle", "alt"],
"ta": ["circle", "alt"],
"dtadx": ["circle", "alt"],
"dtady": ["circle", "alt"],
"p": ["circle", "alt"],
"dpdx": ["circle", "alt"],
"dpdy": ["circle", "alt"],
"D": ["circle", "alt"],
"vor": ["circle", "alt"],
"density": ["sounding", "circle", "alt"],
"mean_density": ["circle", "alt"],
"W": ["circle", "alt"],
"omega": ["circle", "alt"],
"h_adv_q": ["circle", "alt"],
"h_adv_ta": ["circle", "alt"],
"h_adv_p": ["circle", "alt"],
"h_adv_u": ["circle", "alt"],
"h_adv_v": ["circle", "alt"],
"se_dudx": ["circle", "alt"],
"se_dudy": ["circle", "alt"],
"se_dvdx": ["circle", "alt"],
"se_dvdy": ["circle", "alt"],
"se_dqdx": ["circle", "alt"],
"se_dqdy": ["circle", "alt"],
"se_dpdx": ["circle", "alt"],
"se_dpdy": ["circle", "alt"],
"se_dtadx": ["circle", "alt"],
"se_dtady": ["circle", "alt"],
"se_D": ["circle", "alt"],
"se_vor": ["circle", "alt"],
"se_W": ["circle", "alt"],
}
nc_global_attrs = {
"title": "EUREC4A JOANNE Level-4",
"doi": f"{joanne.data_doi}",
"created with": f"run_joanne.py doi:{joanne.software_doi}",
"Conventions": "CF-1.8",
"campaign_id": "EUREC4A",
"project_id": "JOANNE",
"instrument_id": "Vaisala RD-41",
"product_id": "Level-4",
"AVAPS_software_version": "Version 4.1.2",
"ASPEN_version": "BatchAspen v3.4.3",
"JOANNE_version": joanne.__version__,
"author": "Geet George",
"author_email": "geet.george@mpimet.mpg.de",
"featureType": "trajectory",
"reference": joanne.reference_study,
"creation_time": str(datetime.datetime.utcnow()) + " UTC",
}