-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathextremes-dt.py
34 lines (28 loc) · 1.05 KB
/
extremes-dt.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
from polytope.api import Client
# You can pass your email and apikey here, or put them in ~/.polytopeapirc (as JSON)
# You can also set POLYTOPE_USER_EMAIL and POLYTOPE_USER_KEY in your environment
client = Client(
address="polytope.lumi.apps.dte.destination-earth.eu",
# user_email='<YOUR EMAIL>',
# user_key='<YOUR ECMWF API KEY>' or '<YOUR_DESP_KEY>'
)
# Optionally revoke previous requests
client.revoke("all")
# This request retrieves a parameter from the extremes-dt dataset, for the previous week
request = {
"class": "d1",
"expver": "0001",
"dataset": "extremes-dt",
"stream": "oper",
"date": "-7/to/-1",
"time": "0000",
"type": "fc",
"levtype": "sfc",
"step": "0/to/120",
"param": "31"
}
# The data will be saved in the current working directory
files = client.retrieve("destination-earth", request)
# If you want to download the data later, you can use the pointer option, which
# will return a URL to the data instead of downloading it.
# url = client.retrieve('destination-earth', request, pointer=True)