{ "cells": [ { "cell_type": "markdown", "id": "4b79d41a", "metadata": {}, "source": [ "# OSNAP" ] }, { "cell_type": "code", "execution_count": 1, "id": "e8ae0410", "metadata": {}, "outputs": [], "source": [ "import os\n", "from pathlib import Path\n", "import matplotlib.pyplot as plt\n", "import cartopy.crs as ccrs\n", "import xarray as xr\n", "import iconspy as ispy\n", "from iconspy.tests.conftest import get_ds_tgrid_lr" ] }, { "cell_type": "markdown", "id": "605c732b", "metadata": {}, "source": [ "## Grid setup\n", "Load the ICON grid file and produce an ICONSPy dataset" ] }, { "cell_type": "code", "execution_count": 2, "id": "87be7686", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 7MB\n",
"Dimensions: (cell: 15105, vertex: 8067, edge: 23207, nc_e: 2,\n",
" nv_c: 3, ne_c: 3, nv_v: 6, ne_v: 6, nv_e: 2,\n",
" nc_v: 6, nc_c: 3, cart: 3)\n",
"Coordinates:\n",
" * cell (cell) int32 60kB 0 1 2 3 ... 15102 15103 15104\n",
" clon (cell) float64 121kB 69.12 73.0 ... 74.57 76.01\n",
" clat (cell) float64 121kB 72.74 74.52 ... -46.83 -44.85\n",
" * vertex (vertex) int32 32kB 0 1 2 3 ... 8063 8064 8065 8066\n",
" vlon (vertex) float64 65kB 73.0 69.39 ... 80.59 77.56\n",
" vlat (vertex) float64 65kB 73.27 71.49 ... -45.35 -45.49\n",
" * edge (edge) int32 93kB 0 1 2 3 ... 23204 23205 23206\n",
" elon (edge) float64 186kB 71.11 76.98 ... 75.34 76.04\n",
" elat (edge) float64 186kB 72.39 73.25 ... -46.52 -45.54\n",
"Dimensions without coordinates: nc_e, nv_c, ne_c, nv_v, ne_v, nv_e, nc_v, nc_c,\n",
" cart\n",
"Data variables: (12/40)\n",
" grid_sphere_radius float64 8B 6.371e+06\n",
" grav float64 8B 9.807\n",
" earth_angular_velocity float64 8B 7.292e-05\n",
" rho0 float64 8B 1.025e+03\n",
" rhoi float64 8B 917.0\n",
" rhos float64 8B 300.0\n",
" ... ...\n",
" edge_cart_vec (edge, cart) float64 557kB 0.09797 ... -0.7137\n",
" dual_edge_cart_vec (edge, cart) float64 557kB 0.09801 ... -0.7136\n",
" edge_prim_norm (edge, cart) float64 557kB 0.6463 -0.7466 ... 0.7001\n",
" fc (cell) float64 121kB 0.0001393 ... -0.0001029\n",
" fe (edge) float64 186kB 0.000139 ... -0.0001041\n",
" fv (vertex) float64 65kB 0.0001397 ... -0.000104\n",
"Attributes:\n",
" converted_tgrid: True\n",
" boundary_BallTree: <iconspy.balltree.IspyBoundaryBallTree object at 0x...\n",
" wet_BallTree: <iconspy.balltree.IspyWetBallTree object at 0x7ffb5...\n",
" uuidOfHGrid: 5bd948e8-ac1a-11ea-a6b1-d317264fdca9\n",
" IsD_compatible_flag: True<xarray.Dataset> Size: 668B\n",
"Dimensions: (step_in_path: 10, step_in_path_v: 11)\n",
"Coordinates:\n",
" * step_in_path (step_in_path) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
" elon (step_in_path) float64 80B -40.95 -36.93 ... -10.47 -7.136\n",
" elat (step_in_path) float64 80B 59.69 58.78 ... 57.51 56.79\n",
" * step_in_path_v (step_in_path_v) int64 88B 0 1 2 3 4 5 6 7 8 9 10\n",
" vlon (step_in_path_v) float64 88B -43.04 -38.92 ... -5.111\n",
" vlat (step_in_path_v) float64 88B 60.1 59.25 ... 56.67 56.89\n",
"Data variables:\n",
" edge_path (step_in_path) int32 40B 2434 2433 3427 ... 3360 3386 3397\n",
" vertex_path (step_in_path_v) int32 44B 908 911 912 ... 1274 1284 1235\n",
" path_orientation (step_in_path) float64 80B 1.0 1.0 1.0 ... 1.0 1.0 -1.0\n",
"Attributes:\n",
" date: 2026-07-14 14:12:18\n",
" ispy version: 0.2.0\n",
" uuidOfHGrid: 5bd948e8-ac1a-11ea-a6b1-d317264fdca9\n",
" section name: OSNAP East\n",
" Created by: m301014<xarray.Dataset> Size: 668B\n",
"Dimensions: (step_in_path: 10, step_in_path_v: 11)\n",
"Coordinates:\n",
" * step_in_path (step_in_path) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
" elon (step_in_path) float64 80B -40.95 -36.93 ... -10.47 -7.136\n",
" elat (step_in_path) float64 80B 59.69 58.78 ... 57.51 56.79\n",
" * step_in_path_v (step_in_path_v) int64 88B 0 1 2 3 4 5 6 7 8 9 10\n",
" vlon (step_in_path_v) float64 88B -43.04 -38.92 ... -5.111\n",
" vlat (step_in_path_v) float64 88B 60.1 59.25 ... 56.67 56.89\n",
"Data variables:\n",
" edge_path (step_in_path) int32 40B 2434 2433 3427 ... 3360 3386 3397\n",
" vertex_path (step_in_path_v) int32 44B 908 911 912 ... 1274 1284 1235\n",
" path_orientation (step_in_path) float64 80B 1.0 1.0 1.0 ... 1.0 1.0 -1.0\n",
"Attributes:\n",
" date: 2026-07-14 14:12:56\n",
" ispy version: 0.2.0\n",
" uuidOfHGrid: 5bd948e8-ac1a-11ea-a6b1-d317264fdca9\n",
" section name: OSNAP East\n",
" Created by: m301014