-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_extraction.py
106 lines (104 loc) · 2.88 KB
/
data_extraction.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
import cdsapi
dataset = "reanalysis-era5-pressure-levels"
request = {
"product_type": ["reanalysis"],
"variable": [
#"divergence",
#"fraction_of_cloud_cover",
#"geopotential",
#"ozone_mass_mixing_ratio",
#"potential_vorticity",
#"relative_humidity",
#"specific_cloud_ice_water_content",
#"specific_cloud_liquid_water_content",
#"specific_humidity",
#"specific_rain_water_content",
#"specific_snow_water_content",
"temperature",
#"u_component_of_wind",
#"v_component_of_wind",
#"vertical_velocity",
#"vorticity"
],
"year": [
# "1940", "1941", "1942",
# "1943", "1944", "1945",
# "1946", "1947", "1948",
# "1949", "1950", "1951",
# "1952", "1953", "1954",
# "1955", "1956", "1957",
# "1958", "1959", "1960",
# "1961", "1962", "1963",
# "1964", "1965", "1966",
# "1967", "1968", "1969",
# "1970", "1971", "1972",
# "1973", "1974", "1975",
# "1976", "1977", "1978",
# "1979", "1980", "1981",
# "1982", "1983", "1984",
# "1985", "1986", "1987",
# "1988", "1989", "1990",
# "1991", "1992", "1993",
# "1994", "1995", "1996",
# "1997", "1998", "1999",
# "2000", "2001", "2002",
# "2003", "2004", "2005",
# "2006", "2007", "2008",
# "2009", "2010", "2011",
# "2012", "2013", "2014",
# "2015", "2016", "2017",
# "2018", "2019", "2020",
# "2021", "2022", "2023",
"2024"
],
"month": [
"01",
#"02", "03",
# "04", "05", "06",
# "07", "08", "09",
# "10", "11", "12"
],
"day": [
"01", "02", "03",
"04", "05", "06",
"07", "08", "09",
"10", "11", "12",
"13", "14", "15",
"16", "17", "18",
"19", "20", "21",
"22", "23", "24",
"25", "26", "27",
"28", "29", "30",
"31"
],
"time": [
"00:00", "01:00", "02:00",
"03:00", "04:00", "05:00",
"06:00", "07:00", "08:00",
"09:00", "10:00", "11:00",
"12:00", "13:00", "14:00",
"15:00", "16:00", "17:00",
"18:00", "19:00", "20:00",
"21:00", "22:00", "23:00"
],
"pressure_level": [
# "1", "2", "3",
# "5", "7", "10",
# "20", "30", "50",
# "70", "100", "125",
# "150", "175", "200",
# "225", "250", "300",
# "350", "400", "450",
# "500", "550", "600",
# "650", "700", "750",
# "775", "800", "825",
# "850", "875", "900",
"925", "950", "975",
"1000"
],
"data_format": "grib",
"download_format": "unarchived",
"area": [54.5, 14.07, 49, 24.09]
}
client = cdsapi.Client()
client.retrieve(dataset, request).download()