{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# 🔳 Domain Boundary\n",
"\n",
"Herbie provides the model domain boundary as a Shapely Polygon with the accessor\n",
"\n",
"```python\n",
"ds.herbie.polygon\n",
"```\n",
"\n",
"This returns two polygons\n",
"\n",
"1. A Polygon in model coordinate system.\n",
"2. A Polygon in latitude/longitude coordinates.\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"ERROR 1: PROJ: proj_create_from_database: Open of /home/blaylock/miniconda3/envs/herbie-dev/share/proj failed\n"
]
}
],
"source": [
"from herbie import Herbie"
]
},
{
"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": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds.herbie.polygon[0]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds.herbie.polygon[1]"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "herbie-dev",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "2695187304852ca21b499847a7537891f3bdd144e5b1560be94787bfd8158445"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}