{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# 🌐 Cartopy CRS\n", "\n", "Herbie can help you get the Cartopy Coordinate Reference System (CRS) for the model domain. Just use the Herbie accessor on a returned xarray Dataset.\n", "\n", "```python\n", "crs = ds.herbie.crs\n", "```\n", "\n", "This is helpful if you want to plot the data on the map.\n", "\n", "> This feature requires Metpy and Pygrib\n" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "from herbie import Herbie\n", "import matplotlib.pyplot as plt\n", "import cartopy.crs as ccrs" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "✅ Found ┊ model=hrrr ┊ \u001b[3mproduct=sfc\u001b[0m ┊ \u001b[38;2;41;130;13m2022-Dec-05 06:00 UTC\u001b[92m F06\u001b[0m ┊ \u001b[38;2;255;153;0m\u001b[3mGRIB2 @ aws\u001b[0m ┊ \u001b[38;2;255;153;0m\u001b[3mIDX @ aws\u001b[0m\n" ] } ], "source": [ "H = Herbie(\"2022-12-05 06:00\", fxx=6, model=\"hrrr\")\n", "ds = H.xarray(\"TMP:2 m\")" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "
<cartopy.crs.LambertConformal object at 0x7f8187e67ce0>" ], "text/plain": [ "