diff --git a/docs/requirements.txt b/docs/requirements.txt index 6d4c4b7..06389cc 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -8,3 +8,10 @@ furo nbsphinx setuptools pyyaml +earthkit-data @ git+https://github.com/ecmwf/earthkit-data@develop +earthkit-geo @ git+https://github.com/ecmwf/earthkit-geo@develop +earthkit-utils @ git+https://github.com/ecmwf/earthkit-utils@develop +earthkit-transforms @ git+https://github.com/ecmwf/earthkit-transforms@develop +earthkit-plots @ git+https://github.com/ecmwf/earthkit-plots@develop +earthkit-hydro @ git+https://github.com/ecmwf/earthkit-hydro@develop +earthkit-meteo @ git+https://github.com/ecmwf/earthkit-meteo@develop diff --git a/docs/tutorials/index.rst b/docs/tutorials/index.rst index 8913411..72c81e3 100644 --- a/docs/tutorials/index.rst +++ b/docs/tutorials/index.rst @@ -11,6 +11,4 @@ Here is a list of small tutorial notebooks to illustrate how to use earthkit. ensemble.ipynb polytope_polygon.ipynb - polytope_polygon_logo.ipynb polytope_timeseries.ipynb - polytope_vertical_profile.ipynb diff --git a/docs/tutorials/polytope_polygon.ipynb b/docs/tutorials/polytope_polygon.ipynb index d040a12..d04759d 100644 --- a/docs/tutorials/polytope_polygon.ipynb +++ b/docs/tutorials/polytope_polygon.ipynb @@ -5,7 +5,35 @@ "id": "66a48622-e440-4057-ac31-82d73dfa6a1f", "metadata": {}, "source": [ - "## Polytope polygon coverages" + "## Polygon coverage explorer" + ] + }, + { + "cell_type": "markdown", + "id": "5639fb87", + "metadata": {}, + "source": [ + "In this notebook you will see how to:\n", + "\n", + "- use Polytope to retrieve a country cut-out of Portugal\n", + "- create a point cloud plot of the retrieved fields\n", + "\n", + "### Components of earthkit\n", + "\n", + "This tutorial uses the following earthkit components - click any logo to open the package documentation:\n", + "\n", + "
" ] }, { @@ -13,576 +41,22 @@ "id": "d0ea6d7b-1489-4b17-8c4c-82f98a1bf627", "metadata": {}, "source": [ - "First, we retrieve data within a polygon with polytope. Next, we convert the resulting CoverageJSON to Xarray." + "### 1. Data extraction\n", + "\n", + "We generate the country polygon for Portugal using earthkit-geo, then retrieve data within that polygon with Polytope and convert to xarray." ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "7b9c2b9a-a873-4b8e-abf1-042c8b012a2a", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "2024-12-18 09:10:21 - INFO - Key read from /Users/cgr/.polytopeapirc\n", - "2024-12-18 09:10:21 - INFO - Sending request...\n", - "{'request': 'class: od\\n'\n", - " 'date: -1\\n'\n", - " 'domain: g\\n'\n", - " 'expver: 1\\n'\n", - " 'feature:\\n'\n", - " ' shape:\\n'\n", - " ' - - 41.870881288\\n'\n", - " ' - -8.879136\\n'\n", - " ' - - 41.694339317422646\\n'\n", - " ' - -8.824238614026456\\n'\n", - " ' - - 40.171924585721314\\n'\n", - " ' - -8.902386975546364\\n'\n", - " ' - - 38.75694209400925\\n'\n", - " ' - -9.493088042617785\\n'\n", - " ' - - 38.42424252381525\\n'\n", - " ' - -9.171674240710018\\n'\n", - " ' - - 38.49907333213173\\n'\n", - " ' - -8.676525850529856\\n'\n", - " ' - - 37.057269459205145\\n'\n", - " ' - -8.971873318897366\\n'\n", - " ' - - 37.162874354643776\\n'\n", - " ' - -7.406745406502978\\n'\n", - " ' - - 38.19776118392036\\n'\n", - " ' - -6.931663452624974\\n'\n", - " ' - - 38.4280922170291\\n'\n", - " ' - -7.321584397020473\\n'\n", - " ' - - 39.011852875635526\\n'\n", - " ' - -6.9787177479519755\\n'\n", - " ' - - 39.66227871551288\\n'\n", - " ' - -7.5393956904523804\\n'\n", - " ' - - 39.66568774825791\\n'\n", - " ' - -7.03915852435145\\n'\n", - " ' - - 40.0019453234905\\n'\n", - " ' - -6.883203763416162\\n'\n", - " ' - - 40.20373392742229\\n'\n", - " ' - -7.035724907677206\\n'\n", - " ' - - 40.350463990828985\\n'\n", - " ' - -6.8135246275213035\\n'\n", - " ' - - 41.030499770212515\\n'\n", - " ' - -6.905947651233703\\n'\n", - " ' - - 41.593647729084154\\n'\n", - " ' - -6.22847017956974\\n'\n", - " ' - - 41.67712153119277\\n'\n", - " ' - -6.544984134823352\\n'\n", - " ' - - 41.949682257268876\\n'\n", - " ' - -6.567927092516641\\n'\n", - " ' - - 41.96960294343674\\n'\n", - " ' - -7.1747800681640115\\n'\n", - " ' - - 41.88337981339092\\n'\n", - " ' - -7.196871678410446\\n'\n", - " ' - - 41.81334515396762\\n'\n", - " ' - -8.156666519264604\\n'\n", - " ' - - 42.14242723772878\\n'\n", - " ' - -8.205142297350534\\n'\n", - " ' - - 41.870881288\\n'\n", - " ' - -8.879136\\n'\n", - " ' type: polygon\\n'\n", - " 'levtype: sfc\\n'\n", - " \"number: '1'\\n\"\n", - " 'param: 167/169\\n'\n", - " \"step: '0'\\n\"\n", - " 'stream: enfo\\n'\n", - " \"time: '1200'\\n\"\n", - " 'type: pf\\n',\n", - " 'verb': 'retrieve'}\n", - "2024-12-18 09:10:21 - INFO - Polytope user key found in session cache for user cgr\n", - "2024-12-18 09:10:21 - INFO - Request accepted. Please poll ./49adba5d-a694-4045-89da-19b07902acd8 for status\n", - "2024-12-18 09:10:21 - INFO - Polytope user key found in session cache for user cgr\n", - "2024-12-18 09:10:21 - INFO - Checking request status (./49adba5d-a694-4045-89da-19b07902acd8)...\n", - "2024-12-18 09:10:21 - INFO - The current status of the request is 'queued'\n", - "2024-12-18 09:10:22 - INFO - The current status of the request is 'processing'\n", - "2024-12-18 09:10:24 - INFO - The current status of the request is 'processed'\n" - ] - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "49adba5d-a694-4045-89da-19b07902acd8.covjson: 0%| | 0.00/71.2k [00:00, ?B/s]" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "<xarray.Dataset> Size: 53kB\n", - "Dimensions: (datetimes: 1, number: 1, steps: 1, points: 1093)\n", - "Coordinates:\n", - " * datetimes (datetimes) <U20 80B '2024-12-17T12:00:00Z'\n", - " * number (number) int64 8B 1\n", - " * steps (steps) int64 8B 0\n", - " * points (points) int64 9kB 0 1 2 3 4 5 ... 1087 1088 1089 1090 1091 1092\n", - " x (points) float64 9kB 37.08 37.08 37.08 37.15 ... 42.0 42.0 42.07\n", - " y (points) float64 9kB 351.1 351.2 351.3 ... 351.6 351.7 351.7\n", - " z (points) float64 9kB 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0\n", - "Data variables:\n", - " 2t (datetimes, number, steps, points) float64 9kB 290.9 ... 289.0\n", - " ssrd (datetimes, number, steps, points) float64 9kB 0.0 0.0 ... 0.0\n", - "Attributes:\n", - " class: od\n", - " Forecast date: 2024-12-17T12:00:00Z\n", - " domain: g\n", - " expver: 0001\n", - " levtype: sfc\n", - " number: 1\n", - " step: 0\n", - " stream: enfo\n", - " type: pf\n", - " date: 2024-12-17T12:00:00Z
<xarray.Dataset> Size: 176kB\n", - "Dimensions: (x: 1, y: 1, z: 1, number: 50, datetime: 1, t: 145)\n", - "Coordinates:\n", - " * x (x) float64 8B 38.77\n", - " * y (y) float64 8B 350.9\n", - " * z (z) int64 8B 0\n", - " * number (number) int64 400B 1 2 3 4 5 6 7 8 9 ... 43 44 45 46 47 48 49 50\n", - " * datetime (datetime) <U20 80B '2024-12-17T00:00:00Z'\n", - " * t (t) datetime64[ns] 1kB 2024-12-17 ... 2025-01-01\n", - "Data variables:\n", - " tcc (x, y, z, number, datetime, t) float64 58kB 1.0 0.9854 ... 0.999\n", - " 2t (x, y, z, number, datetime, t) float64 58kB 286.7 285.8 ... 286.3\n", - " ssrd (x, y, z, number, datetime, t) float64 58kB 0.0 0.0 ... 1.304e+08\n", - "Attributes:\n", - " class: od\n", - " Forecast date: 2024-12-17T00:00:00Z\n", - " domain: g\n", - " expver: 0001\n", - " levtype: sfc\n", - " number: 1\n", - " stream: enfo\n", - " type: pf
<xarray.Dataset> Size: 640B\n", - "Dimensions: (x: 1, y: 1, number: 1, datetime: 1, t: 1, z: 22)\n", - "Coordinates:\n", - " * x (x) float64 8B 38.91\n", - " * y (y) float64 8B 350.9\n", - " * number (number) int64 8B 1\n", - " * datetime (datetime) <U20 80B '2024-12-17T00:00:00Z'\n", - " * t (t) int64 8B 0\n", - " * z (z) int64 176B 1 2 3 5 7 10 20 30 ... 400 500 600 700 850 925 1000\n", - "Data variables:\n", - " q (x, y, number, datetime, t, z) float64 176B 4.254e-06 ... 0.005184\n", - " o3 (x, y, number, datetime, t, z) float64 176B 4.228e-06 ... 6.039...\n", - "Attributes:\n", - " class: od\n", - " Forecast date: 2024-12-17T00:00:00Z\n", - " domain: g\n", - " expver: 0001\n", - " levelist: 1\n", - " levtype: pl\n", - " number: 1\n", - " stream: enfo\n", - " type: pf