{ "cells": [ { "cell_type": "markdown", "id": "9ea9a922-c03f-43c1-aa83-b4ce321b75f5", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "## Xarray engine: ensemble data" ] }, { "cell_type": "markdown", "id": "ef0e9584-da7b-4461-804e-5785e494485e", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "Get input GRIB ensemble forecast data." ] }, { "cell_type": "code", "execution_count": 1, "id": "ecc9eac2-21fa-47a1-b1a4-37a26c980800", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "fe83d176cacd410da62e44b2ac16e0b2", "version_major": 2, "version_minor": 0 }, "text/plain": [ "ens_cf_pf.grib: 0%| | 0.00/7.03k [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import earthkit.data as ekd\n", "ds_fl = ekd.from_source(\"sample\", \"ens_cf_pf.grib\")" ] }, { "cell_type": "markdown", "id": "b36e3ccd-d616-4b51-bfc5-8e42c34312d6", "metadata": {}, "source": [ "The data contains 3 ensemble members: 1 control and 2 perturbed members." ] }, { "cell_type": "code", "execution_count": 2, "id": "6d754b0e-6717-425a-9d48-0ab8ed20b171", "metadata": { "editable": true, "raw_mimetype": "text/restructuredtext", "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
| \n", " | centre | \n", "shortName | \n", "typeOfLevel | \n", "level | \n", "dataDate | \n", "dataTime | \n", "stepRange | \n", "dataType | \n", "number | \n", "gridType | \n", "
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "ecmf | \n", "t | \n", "isobaricInhPa | \n", "500 | \n", "20240603 | \n", "0 | \n", "0 | \n", "cf | \n", "0 | \n", "regular_ll | \n", "
| 1 | \n", "ecmf | \n", "t | \n", "isobaricInhPa | \n", "500 | \n", "20240603 | \n", "0 | \n", "6 | \n", "cf | \n", "0 | \n", "regular_ll | \n", "
| 2 | \n", "ecmf | \n", "t | \n", "isobaricInhPa | \n", "500 | \n", "20240603 | \n", "0 | \n", "0 | \n", "pf | \n", "1 | \n", "regular_ll | \n", "
| 3 | \n", "ecmf | \n", "t | \n", "isobaricInhPa | \n", "500 | \n", "20240603 | \n", "0 | \n", "0 | \n", "pf | \n", "2 | \n", "regular_ll | \n", "
| 4 | \n", "ecmf | \n", "t | \n", "isobaricInhPa | \n", "500 | \n", "20240603 | \n", "0 | \n", "6 | \n", "pf | \n", "1 | \n", "regular_ll | \n", "
| 5 | \n", "ecmf | \n", "t | \n", "isobaricInhPa | \n", "500 | \n", "20240603 | \n", "0 | \n", "6 | \n", "pf | \n", "2 | \n", "regular_ll | \n", "
<xarray.Dataset> Size: 33kB\n",
"Dimensions: (number: 3, step: 2, latitude: 19, longitude: 36)\n",
"Coordinates:\n",
" * number (number) int64 24B 0 1 2\n",
" * step (step) timedelta64[ns] 16B 00:00:00 06:00:00\n",
" * latitude (latitude) float64 152B 90.0 80.0 70.0 60.0 ... -70.0 -80.0 -90.0\n",
" * longitude (longitude) float64 288B 0.0 10.0 20.0 30.0 ... 330.0 340.0 350.0\n",
"Data variables:\n",
" t (number, step, latitude, longitude) float64 33kB ...\n",
"Attributes: (12/13)\n",
" param: t\n",
" paramId: 130\n",
" class: od\n",
" stream: enfo\n",
" levtype: pl\n",
" type: cf\n",
" ... ...\n",
" date: 20240603\n",
" time: 0\n",
" domain: g\n",
" levelist: 500\n",
" Conventions: CF-1.8\n",
" institution: ECMWF<xarray.Dataset> Size: 33kB\n",
"Dimensions: (number: 3, step: 2, latitude: 19, longitude: 36)\n",
"Coordinates:\n",
" * number (number) int64 24B 0 1 2\n",
" * step (step) timedelta64[ns] 16B 00:00:00 06:00:00\n",
" * latitude (latitude) float64 152B 90.0 80.0 70.0 60.0 ... -70.0 -80.0 -90.0\n",
" * longitude (longitude) float64 288B 0.0 10.0 20.0 30.0 ... 330.0 340.0 350.0\n",
"Data variables:\n",
" t (number, step, latitude, longitude) float64 33kB ...\n",
"Attributes: (12/14)\n",
" param: t\n",
" paramId: 130\n",
" class: od\n",
" stream: enfo\n",
" levtype: pl\n",
" type: cf\n",
" ... ...\n",
" time: 0\n",
" domain: g\n",
" number: 0\n",
" levelist: 500\n",
" Conventions: CF-1.8\n",
" institution: ECMWF