{ "cells": [ { "cell_type": "markdown", "id": "911693b6-83b0-44ee-aade-9dcb186253aa", "metadata": {}, "source": [ "# HEALPix with pyicon" ] }, { "cell_type": "markdown", "id": "883c9ace-c2d7-433b-af3c-26278afa9d19", "metadata": {}, "source": [ "In this notebook we want to explore how to plot data written out on the HEALPix grid by using pyicon.\n", "\n", "In case, you do not know pyicon, it is hosted here: https://gitlab.dkrz.de/m300602/pyicon\n", "\n", "Documentation about pyicon can be found here (note the documentation is partly outdated but hopefully will soon be updated):\n", "https://m300602.gitlab-pages.dkrz.de/pyicon/" ] }, { "cell_type": "code", "execution_count": 35, "id": "4e7505f3-a052-4010-ba51-c1d6b7584ef2", "metadata": {}, "outputs": [], "source": [ "import pyicon as pyic\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import xarray as xr\n", "import cartopy.crs as ccrs\n", "import intake\n", "import cmocean" ] }, { "cell_type": "markdown", "id": "f59d92b3-119d-41e5-b550-9898a08d9199", "metadata": {}, "source": [ "Load some data via an intake catalog:" ] }, { "cell_type": "code", "execution_count": 3, "id": "190464de-c5bd-4884-a207-9207fb274ce2", "metadata": {}, "outputs": [], "source": [ "# open the intake catalog, decide which model, simulation, outputstream and zoom level to pick\n", "cat = intake.open_catalog(f\"https://data.nextgems-h2020.eu/catalog.yaml\")\n", "ds = cat[\"ICON\"][\"ngc3028\"](zoom=7).to_dask()" ] }, { "cell_type": "code", "execution_count": 4, "id": "230c2cc1-3f4e-4504-a8e4-6abf50fd52c7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n", "Dimensions: (time: 2010, depth_half: 129,\n", " cell: 196608, level_full: 90, crs: 1,\n", " depth_full: 128,\n", " soil_depth_water_level: 5,\n", " level_half: 91,\n", " soil_depth_energy_level: 5)\n", "Coordinates:\n", " * crs (crs) float32 nan\n", " * depth_full (depth_full) float32 1.0 ... 5.904e+03\n", " * depth_half (depth_half) float32 0.0 ... 6.003e+03\n", " * level_full (level_full) int32 1 2 3 4 ... 88 89 90\n", " * level_half (level_half) int32 1 2 3 4 ... 89 90 91\n", " * soil_depth_energy_level (soil_depth_energy_level) float32 0....\n", " * soil_depth_water_level (soil_depth_water_level) float32 0.0...\n", " * time (time) datetime64[ns] 2020-01-21 ......\n", " zg (level_full, cell) float32 ...\n", " zghalf (level_half, cell) float32 ...\n", "Dimensions without coordinates: cell\n", "Data variables: (12/92)\n", " a_tracer_v_to (time, depth_half, cell) float32 ...\n", " atmos_fluxes_frshflux_evaporation (time, cell) float32 ...\n", " atmos_fluxes_frshflux_precipitation (time, cell) float32 ...\n", " atmos_fluxes_frshflux_runoff (time, cell) float32 ...\n", " atmos_fluxes_frshflux_snowfall (time, cell) float32 ...\n", " atmos_fluxes_heatflux_latent (time, cell) float32 ...\n", " ... ...\n", " va (time, level_full, cell) float32 ...\n", " vas (time, cell) float32 ...\n", " w (time, depth_half, cell) float32 ...\n", " wa_phy (time, level_half, cell) float32 ...\n", " wind_speed_10m (time, cell) float32 ...\n", " zos (time, cell) float32 ...