{ "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 and NOGAPS 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", "\n", "[NOMADS](https://nomads.ncep.noaa.gov/pub/data/nccf/com/fnmoc/prod/) hosts a copy of the the latest NAVGEM forecasts for the last two days.\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "b4cba677-7674-47d6-8dde-2d297b138c57", "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "from herbie import Herbie\n", "from herbie import paint\n", "from herbie.toolbox import EasyMap, pc" ] }, { "cell_type": "code", "execution_count": 4, "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-Jun-11 00:00 UTC\u001b[92m F06\u001b[0m ┊ \u001b[38;2;255;153;0m\u001b[3mGRIB2 @ nomads\u001b[0m ┊ \u001b[38;2;255;153;0m\u001b[3mIDX @ None\u001b[0m\n" ] } ], "source": [ "H = Herbie(\"2024-06-11 00:00\", model=\"navgem_nomads\", fxx=6)" ] }, { "cell_type": "code", "execution_count": 5, "id": "3995709a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'none': ''}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.PRODUCTS" ] }, { "cell_type": "code", "execution_count": 6, "id": "bfadf78b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'nomads': 'https://nomads.ncep.noaa.gov/pub/data/nccf/com/fnmoc/prod/navgem.20240611/navgem_2024061100f006.grib2'}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.SOURCES" ] }, { "cell_type": "code", "execution_count": 7, "id": "8757a741-afbd-4cb7-89ab-59b647cbc4b1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "👨🏻🏭 Created directory: [/home/blaylock/data/navgem_nomads/20240611]\n" ] }, { "data": { "text/plain": [ "PosixPath('/home/blaylock/data/navgem_nomads/20240611/navgem_2024061100f006.grib2')" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# There is no index file available. Have to download the full file.\n", "H.download()" ] }, { "cell_type": "code", "execution_count": 8, "id": "7d6b06d7", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/blaylock/GITHUB/Herbie/herbie/core.py:1097: 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> Size: 1MB\n",
"Dimensions: (latitude: 361, longitude: 720)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2024-06-11\n",
" step timedelta64[ns] 8B 06:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" * latitude (latitude) float64 3kB -90.0 -89.5 -89.0 ... 89.5 90.0\n",
" * longitude (longitude) float64 6kB 0.0 0.5 1.0 ... 359.0 359.5\n",
" valid_time datetime64[ns] 8B ...\n",
" gribfile_projection object 8B None\n",
"Data variables:\n",
" t2m (latitude, longitude) float32 1MB ...\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 (NAVGEM) from NOMADS.\n",
" remote_grib: /home/blaylock/data/navgem_nomads/20240611/navge...\n",
" local_grib: /home/blaylock/data/navgem_nomads/20240611/navge...\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", "172266.0 | \n", "421-172266 | \n", "2024-06-11 | \n", "2024-06-11 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", "172267 | \n", "408146.0 | \n", "172267-408146 | \n", "2024-06-11 | \n", "2024-06-11 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", "408147 | \n", "643549.0 | \n", "408147-643549 | \n", "2024-06-11 | \n", "2024-06-11 06:00:00 | \n", "TMP | \n", "max wind | \n", "6 hour fcst | \n", ":TMP:max wind:6 hour fcst | \n", "
| 3 | \n", "4 | \n", "643550 | \n", "917714.0 | \n", "643550-917714 | \n", "2024-06-11 | \n", "2024-06-11 06:00:00 | \n", "HGT | \n", "max wind | \n", "6 hour fcst | \n", ":HGT:max wind:6 hour fcst | \n", "
| 4 | \n", "5 | \n", "917715 | \n", "1246460.0 | \n", "917715-1246460 | \n", "2024-06-11 | \n", "2024-06-11 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", "18346863 | \n", "18701766.0 | \n", "18346863-18701766 | \n", "2024-06-11 | \n", "2024-06-11 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", "18701767 | \n", "19056137.0 | \n", "18701767-19056137 | \n", "2024-06-11 | \n", "2024-06-11 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", "19056138 | \n", "19432421.0 | \n", "19056138-19432421 | \n", "2024-06-11 | \n", "2024-06-11 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", "19432422 | \n", "19791097.0 | \n", "19432422-19791097 | \n", "2024-06-11 | \n", "2024-06-11 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", "19791098 | \n", "NaN | \n", "19791098- | \n", "2024-06-11 | \n", "2024-06-11 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> Size: 1MB\n",
"Dimensions: (latitude: 361, longitude: 720)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2024-06-11\n",
" step timedelta64[ns] 8B 06:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" * latitude (latitude) float64 3kB -90.0 -89.5 -89.0 ... 89.5 90.0\n",
" * longitude (longitude) float64 6kB 0.0 0.5 1.0 ... 359.0 359.5\n",
" valid_time datetime64[ns] 8B 2024-06-11T06:00:00\n",
" gribfile_projection object 8B None\n",
"Data variables:\n",
" t2m (latitude, longitude) float32 1MB 219.5 219.2 ... 272.4\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 (NAVGEM) from NOMADS.\n",
" remote_grib: /home/blaylock/data/navgem_nomads/20240611/navge...\n",
" local_grib: /home/blaylock/data/navgem_nomads/20240611/subse...\n",
" search: TMP:2 m<xarray.Dataset> Size: 1MB\n",
"Dimensions: (latitude: 361, longitude: 720)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2023-02-13T12:00:00\n",
" step timedelta64[ns] 8B 00:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" * latitude (latitude) float64 3kB -90.0 -89.5 -89.0 ... 89.5 90.0\n",
" * longitude (longitude) float64 6kB -0.5 0.0 0.5 ... 358.5 359.0\n",
" valid_time datetime64[ns] 8B ...\n",
" gribfile_projection object 8B None\n",
"Data variables:\n",
" t2m (latitude, longitude) float32 1MB ...\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 (NAVGEM, 2013-2024...\n",
" remote_grib: /home/blaylock/data/navgem_godae/20230213/US058G...\n",
" local_grib: /home/blaylock/data/navgem_godae/20230213/US058G...\n",
" search: None<xarray.Dataset> Size: 3MB\n",
"Dimensions: (latitude: 361, longitude: 720)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2023-02-13T12:00:00\n",
" step timedelta64[ns] 8B 00:00:00\n",
" isobaricInhPa float64 8B 500.0\n",
" * latitude (latitude) float64 3kB -90.0 -89.5 -89.0 ... 89.5 90.0\n",
" * longitude (longitude) float64 6kB -0.5 0.0 0.5 ... 358.5 359.0\n",
" valid_time datetime64[ns] 8B 2023-02-13T12:00:00\n",
" gribfile_projection object 8B None\n",
"Data variables:\n",
" u (latitude, longitude) float32 1MB -6.4 -6.5 ... -14.6\n",
" v (latitude, longitude) float32 1MB 9.8 10.4 ... -16.7\n",
" wspd (latitude, longitude) float32 1MB 11.7 12.26 ... 22.18\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 (NAVGEM, 2013-2024...\n",
" search: None<xarray.Dataset> Size: 265kB\n",
"Dimensions: (latitude: 181, longitude: 360)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2005-02-13T12:00:00\n",
" step timedelta64[ns] 8B 00:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" * latitude (latitude) float64 1kB -90.0 -89.0 -88.0 ... 89.0 90.0\n",
" * longitude (longitude) float64 3kB -1.0 0.0 1.0 ... 357.0 358.0\n",
" valid_time datetime64[ns] 8B ...\n",
" gribfile_projection object 8B None\n",
"Data variables:\n",
" t2m (latitude, longitude) float32 261kB ...\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 (NAVGEM, 2013-2024...\n",
" remote_grib: https://usgodae.org/ftp/outgoing/fnmoc/models/no...\n",
" local_grib: /home/blaylock/data/navgem_godae/20050213/US058G...\n",
" search: None