-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/grib-output-from-climetlab
- Loading branch information
Showing
28 changed files
with
648 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "efdd065e-e9fc-494d-9f73-9cb3d525dc4a", | ||
"metadata": {}, | ||
"source": [ | ||
"## Retrieving data with polytope" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "75079b34-78ba-4536-8498-4dc3d0c3e646", | ||
"metadata": {}, | ||
"source": [ | ||
"The “polytope” data source provides access to the [Polytope web services](https://polytope-client.readthedocs.io/en/latest/)." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "621c0aa7-db93-441a-ab55-743fa6fbcd51", | ||
"metadata": {}, | ||
"source": [ | ||
"The following example retrieves data from the ECMWF MARS archive using polytope. The dataset was prepared for the OGC GeoDataCubes working group, see details [here](https://github.com/ecmwf/ogc-gdc-usecase/tree/main)." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "7910ac60-a503-4392-a719-0b780625346f", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"2023-09-29 18:03:52 - INFO - Sending request...\n", | ||
"{'request': 'class: rd\\n'\n", | ||
" \"date: '20200915'\\n\"\n", | ||
" 'domain: g\\n'\n", | ||
" 'expver: hsvs\\n'\n", | ||
" \"levellist: '1'\\n\"\n", | ||
" 'levtype: pl\\n'\n", | ||
" \"param: '129.128'\\n\"\n", | ||
" 'step: 0/12\\n'\n", | ||
" 'stream: oper\\n'\n", | ||
" 'time: 00:00:00\\n'\n", | ||
" 'type: fc\\n',\n", | ||
" 'verb': 'retrieve'}\n", | ||
"2023-09-29 18:03:53 - INFO - Request accepted. Please poll http://polytope.ecmwf.int/api/v1/requests/5af79420-5e06-477d-8167-a54e0de84fe1 for status\n", | ||
"2023-09-29 18:03:53 - INFO - Checking request status (5af79420-5e06-477d-8167-a54e0de84fe1)...\n", | ||
"2023-09-29 18:03:54 - INFO - The current status of the request is 'processing'\n", | ||
"2023-09-29 18:03:58 - INFO - The current status of the request is 'processed'\n", | ||
" \r" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<div>\n", | ||
"<style scoped>\n", | ||
" .dataframe tbody tr th:only-of-type {\n", | ||
" vertical-align: middle;\n", | ||
" }\n", | ||
"\n", | ||
" .dataframe tbody tr th {\n", | ||
" vertical-align: top;\n", | ||
" }\n", | ||
"\n", | ||
" .dataframe thead th {\n", | ||
" text-align: right;\n", | ||
" }\n", | ||
"</style>\n", | ||
"<table border=\"1\" class=\"dataframe\">\n", | ||
" <thead>\n", | ||
" <tr style=\"text-align: right;\">\n", | ||
" <th></th>\n", | ||
" <th>centre</th>\n", | ||
" <th>shortName</th>\n", | ||
" <th>typeOfLevel</th>\n", | ||
" <th>level</th>\n", | ||
" <th>dataDate</th>\n", | ||
" <th>dataTime</th>\n", | ||
" <th>stepRange</th>\n", | ||
" <th>dataType</th>\n", | ||
" <th>number</th>\n", | ||
" <th>gridType</th>\n", | ||
" </tr>\n", | ||
" </thead>\n", | ||
" <tbody>\n", | ||
" <tr>\n", | ||
" <th>0</th>\n", | ||
" <td>ecmf</td>\n", | ||
" <td>z</td>\n", | ||
" <td>isobaricInhPa</td>\n", | ||
" <td>1</td>\n", | ||
" <td>20200915</td>\n", | ||
" <td>0</td>\n", | ||
" <td>0</td>\n", | ||
" <td>fc</td>\n", | ||
" <td>0</td>\n", | ||
" <td>sh</td>\n", | ||
" </tr>\n", | ||
" <tr>\n", | ||
" <th>1</th>\n", | ||
" <td>ecmf</td>\n", | ||
" <td>z</td>\n", | ||
" <td>isobaricInhPa</td>\n", | ||
" <td>1</td>\n", | ||
" <td>20200915</td>\n", | ||
" <td>0</td>\n", | ||
" <td>12</td>\n", | ||
" <td>fc</td>\n", | ||
" <td>0</td>\n", | ||
" <td>sh</td>\n", | ||
" </tr>\n", | ||
" </tbody>\n", | ||
"</table>\n", | ||
"</div>" | ||
], | ||
"text/plain": [ | ||
" centre shortName typeOfLevel level dataDate dataTime stepRange \\\n", | ||
"0 ecmf z isobaricInhPa 1 20200915 0 0 \n", | ||
"1 ecmf z isobaricInhPa 1 20200915 0 12 \n", | ||
"\n", | ||
" dataType number gridType \n", | ||
"0 fc 0 sh \n", | ||
"1 fc 0 sh " | ||
] | ||
}, | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"import earthkit.data\n", | ||
"\n", | ||
"request = {\n", | ||
" 'stream': 'oper',\n", | ||
" 'levtype': 'pl',\n", | ||
" 'levellist': '1',\n", | ||
" 'param': '129.128',\n", | ||
" 'step': '0/12',\n", | ||
" 'time': '00:00:00',\n", | ||
" 'date': '20200915',\n", | ||
" 'type': 'fc',\n", | ||
" 'class': 'rd',\n", | ||
" 'expver': 'hsvs',\n", | ||
" 'domain': 'g'\n", | ||
"}\n", | ||
"\n", | ||
"\n", | ||
"ds = earthkit.data.from_source(\"polytope\", \"ecmwf-mars\", request)\n", | ||
"ds.ls()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "32cb0e10-7545-4758-b2f0-99984f01d71f", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "dev", | ||
"language": "python", | ||
"name": "dev" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.11" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import earthkit.data | ||
|
||
# Change the location of the user defined cache: | ||
earthkit.data.settings.set("user-cache-directory", "/big-disk/earthkit-data-cache") | ||
|
||
# Change number of download threads | ||
earthkit.data.settings.set("number-of-download-threads", 7) | ||
|
||
# Multiple values can be set together. The argument list | ||
# can be a dictionary: | ||
earthkit.data.settings.set( | ||
{"number-of-download-threads": 7, "url-download-timeout": "1m"} | ||
) | ||
|
||
# Alternatively, we can use keyword arguments. However, because | ||
# the “-” character is not allowed in variable names in Python we have | ||
# to replace “-” with “_” in all the keyword arguments: | ||
earthkit.data.settings.set(number_of_download_threads=8, url_download_timeout="2m") |
Oops, something went wrong.