{ "cells": [ { "cell_type": "markdown", "id": "8d99fcb6-6b6c-4fb4-a732-476b34a54f16", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "## Xarray engine: field dimensions" ] }, { "cell_type": "code", "execution_count": 1, "id": "2338abba-887d-4d94-af7b-0261cd9ab42c", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [ "import earthkit.data as ekd" ] }, { "cell_type": "raw", "id": "2f23c9c6-09b3-477f-8d2f-534312bc835f", "metadata": { "editable": true, "raw_mimetype": "text/restructuredtext", "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "When converting a GRIB fieldlist to Xarray with :py:meth:`~data.readers.grib.index.GribFieldList.to_xarray` the last one or two dimensions representing the field values depend on the grid type and the ``flatten_values`` settings. \n", "\n", "When ``flatten_values`` is False (the is the default, depending on the profile) the field shape is used to form the field dimensions, whose names vary with the grid type. Otherwise, a single dimension called \"values\" will represent a field." ] }, { "cell_type": "markdown", "id": "93dd5a95-a27a-4b6d-9379-d4ef3a276c09", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "#### Regular grids" ] }, { "cell_type": "code", "execution_count": 2, "id": "230c93d6-78ed-4111-b8c7-b5147629d004", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9d15f57ec3eb42f19a24d4fd6774fb79", "version_major": 2, "version_minor": 0 }, "text/plain": [ "pl.grib: 0%| | 0.00/48.8k [00:00