{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Polytope vertical profile" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following example first retrieves vertical profiles on pressure levels using polytope, then converts the resulting CoverageJSON data to Xarray." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2024-12-18 09:10:29 - INFO - Key read from /Users/cgr/.polytopeapirc\n", "2024-12-18 09:10:29 - INFO - Sending request...\n", "{'request': 'class: od\\n'\n", " 'date: -1\\n'\n", " 'domain: g\\n'\n", " 'expver: 1\\n'\n", " 'feature:\\n'\n", " ' points:\\n'\n", " ' - - 38.9\\n'\n", " ' - -9.1\\n'\n", " ' type: verticalprofile\\n'\n", " 'levelist: 1/to/1000\\n'\n", " 'levtype: pl\\n'\n", " \"number: '1'\\n\"\n", " 'param: 203/133\\n'\n", " \"step: '0'\\n\"\n", " 'stream: enfo\\n'\n", " \"time: '0000'\\n\"\n", " 'type: pf\\n',\n", " 'verb': 'retrieve'}\n", "2024-12-18 09:10:29 - INFO - Polytope user key found in session cache for user cgr\n", "2024-12-18 09:10:30 - INFO - Request accepted. Please poll ./76f67d4d-f386-43ff-b11c-39e6ea9c404f for status\n", "2024-12-18 09:10:30 - INFO - Polytope user key found in session cache for user cgr\n", "2024-12-18 09:10:30 - INFO - Checking request status (./76f67d4d-f386-43ff-b11c-39e6ea9c404f)...\n", "2024-12-18 09:10:30 - INFO - The current status of the request is 'queued'\n", "2024-12-18 09:10:30 - INFO - The current status of the request is 'processing'\n", "2024-12-18 09:10:33 - 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": [ "76f67d4d-f386-43ff-b11c-39e6ea9c404f.covjson: 0%| | 0.00/3.38k [00:00\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<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
" ], "text/plain": [ " 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)