{ "cells": [ { "cell_type": "markdown", "id": "efdd065e-e9fc-494d-9f73-9cb3d525dc4a", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "## Retrieving fields with polytope" ] }, { "cell_type": "raw", "id": "9a779849-2eb3-4076-ac20-20a6fef63aed", "metadata": { "editable": true, "raw_mimetype": "text/restructuredtext", "slideshow": { "slide_type": "" }, "tags": [], "vscode": { "languageId": "raw" } }, "source": [ "The :ref:`polytope ` source provides access to the `Polytope web services `_." ] }, { "cell_type": "markdown", "id": "621c0aa7-db93-441a-ab55-743fa6fbcd51", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "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": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
centreshortNametypeOfLevelleveldataDatedataTimestepRangedataTypenumbergridType
0ecmfzisobaricInhPa5002020091500fc0sh
1ecmfzisobaricInhPa50020200915012fc0sh
\n", "
" ], "text/plain": [ " centre shortName typeOfLevel level dataDate dataTime stepRange \\\n", "0 ecmf z isobaricInhPa 500 20200915 0 0 \n", "1 ecmf z isobaricInhPa 500 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 as ekd\n", "\n", "request = {\n", " 'stream': 'oper',\n", " 'levtype': 'pl',\n", " 'levellist': '500',\n", " 'param': '129.128',\n", " 'step': '0/12',\n", " 'time': '00',\n", " 'date': '20200915',\n", " 'type': 'fc',\n", " 'class': 'rd',\n", " 'expver': 'hsvs',\n", " 'domain': 'g'\n", "}\n", "\n", "ds = ekd.from_source(\"polytope\", \"ecmwf-mars\", request, stream=False)\n", "ds.ls()" ] }, { "cell_type": "code", "execution_count": null, "id": "46115487-af1f-448e-b4fa-fc52dbbf9fb3", "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.13.1" } }, "nbformat": 4, "nbformat_minor": 5 }