{ "cells": [ { "cell_type": "markdown", "id": "618aa79a-1759-4291-b9f8-bcca4726fc19", "metadata": {}, "source": [ "# Visualizing the cloud-capped boundary layer\n", "\n", "Data is from a large eddy simulation of trade cumulus clouds. \n", "\n", "* Single timestep at 12.5 m x, y, z grid spacing\n", "\n", "* Variable is QN -- cloud liquid water (g/kg)\n" ] }, { "cell_type": "markdown", "id": "77b9292b-bffd-429a-ae29-d6dec2bb5377", "metadata": {}, "source": [ "## link to data file\n", "\n", "The netcdf file: bomex_qv_qn.nc -- 527 Mbytes\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "d78190d9-d512-4943-a483-a0b1e743d2f5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vapor 3.8.3\n", "Python 3.9.16 (/home/phil/mini39/envs/vapor)\n", "OpenGL 4.6.0 NVIDIA 470.182.03\n" ] } ], "source": [ "import xarray as xr\n", "from pathlib import Path\n", "from vapor import session, renderer, dataset, camera" ] }, { "cell_type": "markdown", "id": "fb4e299a-35d2-47c7-80ab-e22f0722e035", "metadata": {}, "source": [ "## adjust path to point to file " ] }, { "cell_type": "code", "execution_count": 4, "id": "5bf95bdf-20e2-4f77-b7d0-0448afd3c660", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/home/phil/repos/vapor-python-cookbook/notebooks/bomex_qv_qn.nc\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "the_file = Path().resolve() / 'bomex_qv_qn.nc'\n", "print(the_file)\n", "the_file.exists()" ] }, { "cell_type": "markdown", "id": "10c3b053-28a9-4f1f-be2b-e414a9ce9d6b", "metadata": {}, "source": [ "## Inspect the xarray dataset" ] }, { "cell_type": "code", "execution_count": 5, "id": "378873be-f4d4-48bd-a2d6-cf6e462a8082", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n", "Dimensions: (x: 512, y: 512, z: 256, time: 1)\n", "Coordinates:\n", " * x (x) float32 0.0 12.5 25.0 37.5 ... 6.362e+03 6.375e+03 6.388e+03\n", " * y (y) float32 0.0 12.5 25.0 37.5 ... 6.362e+03 6.375e+03 6.388e+03\n", " * z (z) float32 12.5 25.0 37.5 50.0 ... 3.175e+03 3.188e+03 3.2e+03\n", " * time (time) float32 0.1264\n", "Data variables:\n", " p (z) float32 ...\n", " QV (time, z, y, x) float32 ...\n", " QN (time, z, y, x) float32 ...