{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "f168804a-2c0d-4dd7-8b1c-5d909c889452", "metadata": {}, "source": [ "# NAVGEM\n", "\n", "This demonstrates how to use public data from the NAVGEM model from NOMADS or GODAE.\n", "\n", "> Note: there are not .idx files provided, so you have to download the full file and generate the .idx file with wgrib2 (requires Linux).\n", "\n", "## NAVGEM on NOMADS\n" ] }, { "cell_type": "code", "execution_count": 42, "id": "b4cba677-7674-47d6-8dde-2d297b138c57", "metadata": {}, "outputs": [], "source": [ "import cartopy.crs as ccrs\n", "import matplotlib.pyplot as plt\n", "from paint.standard2 import cm_tmp\n", "from toolbox import EasyMap, pc\n", "\n", "from herbie import Herbie" ] }, { "cell_type": "code", "execution_count": 43, "id": "6384df86-fc73-4496-a138-5f227535b6d6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "✅ Found ┊ model=navgem_nomads ┊ \u001b[3mproduct=none\u001b[0m ┊ \u001b[38;2;41;130;13m2024-Jan-18 00:00 UTC\u001b[92m F06\u001b[0m ┊ \u001b[38;2;255;153;0m\u001b[3mGRIB2 @ local\u001b[0m ┊ \u001b[38;2;255;153;0m\u001b[3mIDX @ None\u001b[0m\n" ] } ], "source": [ "H = Herbie(\"2024-01-18\", model=\"navgem_nomads\", fxx=6)" ] }, { "cell_type": "code", "execution_count": 44, "id": "3995709a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'none': ''}" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.PRODUCTS" ] }, { "cell_type": "code", "execution_count": 45, "id": "bfadf78b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'nomads': 'https://nomads.ncep.noaa.gov/pub/data/nccf/com/fnmoc/prod/navgem.20240118/navgem_2024011800f006.grib2'}" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.SOURCES" ] }, { "cell_type": "code", "execution_count": 46, "id": "8757a741-afbd-4cb7-89ab-59b647cbc4b1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "PosixPath('/p/cwfs/blaylock/data/navgem_nomads/20240118/navgem_2024011800f006.grib2')" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# no index file available. Have to download the full file.\n", "H.download()" ] }, { "cell_type": "code", "execution_count": 47, "id": "7d6b06d7", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/p/home/blaylock/BB_python/Herbie/herbie/core.py:1064: UserWarning: Will not remove GRIB file because it previously existed.\n", " warnings.warn(\"Will not remove GRIB file because it previously existed.\")\n" ] }, { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (latitude: 361, longitude: 720)\n",
"Coordinates:\n",
" time datetime64[ns] 2024-01-18\n",
" step timedelta64[ns] 06:00:00\n",
" heightAboveGround float64 2.0\n",
" * latitude (latitude) float64 -90.0 -89.5 -89.0 ... 89.0 89.5 90.0\n",
" * longitude (longitude) float64 0.0 0.5 1.0 ... 358.5 359.0 359.5\n",
" valid_time datetime64[ns] ...\n",
"Data variables:\n",
" t2m (latitude, longitude) float32 ...\n",
" gribfile_projection object None\n",
"Attributes:\n",
" GRIB_edition: 2\n",
" GRIB_centre: fnmo\n",
" GRIB_centreDescription: US Navy - Fleet Numerical Oceanography Center\n",
" GRIB_subCentre: 0\n",
" Conventions: CF-1.7\n",
" institution: US Navy - Fleet Numerical Oceanography Center\n",
" model: navgem_nomads\n",
" product: none\n",
" description: Navy Global Environment Model\n",
" remote_grib: /p/cwfs/blaylock/data/navgem_nomads/20240118/nav...\n",
" local_grib: /p/cwfs/blaylock/data/navgem_nomads/20240118/nav...\n",
" search: None| \n", " | grib_message | \n", "start_byte | \n", "end_byte | \n", "range | \n", "reference_time | \n", "valid_time | \n", "variable | \n", "level | \n", "forecast_time | \n", "search_this | \n", "
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "1 | \n", "421 | \n", "150741.0 | \n", "421-150741 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "ACPCP | \n", "surface | \n", "0-6 hour acc fcst | \n", ":ACPCP:surface:0-6 hour acc fcst | \n", "
| 1 | \n", "2 | \n", "150742 | \n", "296573.0 | \n", "150742-296573 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "APCP | \n", "surface | \n", "0-6 hour acc fcst | \n", ":APCP:surface:0-6 hour acc fcst | \n", "
| 2 | \n", "3 | \n", "296574 | \n", "522814.0 | \n", "296574-522814 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "TMP | \n", "max wind | \n", "6 hour fcst | \n", ":TMP:max wind:6 hour fcst | \n", "
| 3 | \n", "4 | \n", "522815 | \n", "791251.0 | \n", "522815-791251 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "HGT | \n", "max wind | \n", "6 hour fcst | \n", ":HGT:max wind:6 hour fcst | \n", "
| 4 | \n", "5 | \n", "791252 | \n", "1110273.0 | \n", "791252-1110273 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "PRES | \n", "max wind | \n", "6 hour fcst | \n", ":PRES:max wind:6 hour fcst | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 86 | \n", "87 | \n", "18256249 | \n", "18609646.0 | \n", "18256249-18609646 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "UGRD | \n", "10 m above ground | \n", "6 hour fcst | \n", ":UGRD:10 m above ground:6 hour fcst | \n", "
| 87 | \n", "88 | \n", "18609647 | \n", "18961671.0 | \n", "18609647-18961671 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "VGRD | \n", "10 m above ground | \n", "6 hour fcst | \n", ":VGRD:10 m above ground:6 hour fcst | \n", "
| 88 | \n", "89 | \n", "18961672 | \n", "19336231.0 | \n", "18961672-19336231 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "var discipline=0 center=58 local_table=0 parmc... | \n", "19.5 m above ground | \n", "6 hour fcst | \n", ":var discipline=0 center=58 local_table=0 parm... | \n", "
| 89 | \n", "90 | \n", "19336232 | \n", "19693176.0 | \n", "19336232-19693176 | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "UGRD | \n", "19.5 m above ground | \n", "6 hour fcst | \n", ":UGRD:19.5 m above ground:6 hour fcst | \n", "
| 90 | \n", "91 | \n", "19693177 | \n", "NaN | \n", "19693177- | \n", "2024-01-18 | \n", "2024-01-18 06:00:00 | \n", "VGRD | \n", "19.5 m above ground | \n", "6 hour fcst | \n", ":VGRD:19.5 m above ground:6 hour fcst | \n", "
91 rows × 10 columns
\n", "<xarray.Dataset>\n",
"Dimensions: (latitude: 361, longitude: 720)\n",
"Coordinates:\n",
" time datetime64[ns] 2024-01-18\n",
" step timedelta64[ns] 06:00:00\n",
" heightAboveGround float64 2.0\n",
" * latitude (latitude) float64 -90.0 -89.5 -89.0 ... 89.0 89.5 90.0\n",
" * longitude (longitude) float64 0.0 0.5 1.0 ... 358.5 359.0 359.5\n",
" valid_time datetime64[ns] 2024-01-18T06:00:00\n",
"Data variables:\n",
" t2m (latitude, longitude) float32 243.6 244.1 ... 248.9\n",
" gribfile_projection object None\n",
"Attributes:\n",
" GRIB_edition: 2\n",
" GRIB_centre: fnmo\n",
" GRIB_centreDescription: US Navy - Fleet Numerical Oceanography Center\n",
" GRIB_subCentre: 0\n",
" Conventions: CF-1.7\n",
" institution: US Navy - Fleet Numerical Oceanography Center\n",
" model: navgem_nomads\n",
" product: none\n",
" description: Navy Global Environment Model\n",
" remote_grib: /p/cwfs/blaylock/data/navgem_nomads/20240118/nav...\n",
" local_grib: /p/cwfs/blaylock/data/navgem_nomads/20240118/sub...\n",
" search: TMP:2 m<xarray.Dataset>\n",
"Dimensions: (latitude: 361, longitude: 720)\n",
"Coordinates:\n",
" time datetime64[ns] 2023-01-12T18:00:00\n",
" step timedelta64[ns] 00:00:00\n",
" isobaricInhPa float64 1.013e+03\n",
" * latitude (latitude) float64 -90.0 -89.5 -89.0 ... 89.0 89.5 90.0\n",
" * longitude (longitude) float64 -0.5 0.0 0.5 ... 358.0 358.5 359.0\n",
" valid_time datetime64[ns] ...\n",
"Data variables:\n",
" t (latitude, longitude) float32 ...\n",
" gribfile_projection object None\n",
"Attributes:\n",
" GRIB_edition: 1\n",
" GRIB_centre: fnmo\n",
" GRIB_centreDescription: US Navy - Fleet Numerical Oceanography Center\n",
" GRIB_subCentre: 0\n",
" Conventions: CF-1.7\n",
" institution: US Navy - Fleet Numerical Oceanography Center\n",
" model: navgem_godae\n",
" product: GMET\n",
" description: Navy Global Environment Model\n",
" remote_grib: /p/cwfs/blaylock/data/navgem_godae/20230112/US05...\n",
" local_grib: /p/cwfs/blaylock/data/navgem_godae/20230112/US05...\n",
" search: None