{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "a1b317c9", "metadata": {}, "source": [ "# NAM\n", "\n", "This tutorial shows you how to download NAM data from Amazon (and other sources) with the Herbie Python package." ] }, { "cell_type": "code", "execution_count": 2, "id": "3fcc2f74", "metadata": {}, "outputs": [], "source": [ "from herbie import Herbie\n", "from herbie.toolbox import EasyMap, pc, ccrs\n", "from herbie import paint\n", "\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 3, "id": "3384287b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "✅ Found ┊ model=nam ┊ \u001b[3mproduct=conusnest.hiresf\u001b[0m ┊ \u001b[38;2;41;130;13m2022-Dec-10 00: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-10\", model=\"nam\", fxx=6)" ] }, { "cell_type": "code", "execution_count": 4, "id": "8fb00436", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'conusnest.hiresf': 'CONUS 5 km',\n", " 'firewxnest.hiresf': 'Fire Weather 1.33 km CONUS/1.5 km Alaska',\n", " 'alaskanest.hiresf': 'Alaska 6 km',\n", " 'hawaiinest.hiresf': 'Hawaii 6 km',\n", " 'priconest.hiresf': 'Puerto Rico 3 km',\n", " 'afwaca': 'Central America/Caribbean',\n", " 'awphys': 'NAM 218 AWIPS Grid - CONUS; 12-km Resolution; full complement of pressure level fields and some surface-based fields',\n", " 'awip12': 'NAM 218 AWIPS Grid - CONUS; 12-km Resolution; 12-km Resolution; full complement of surface-based fields',\n", " 'goes218': 'NAM 218 AWIPS Grid - CONUS; 12-km Resolution; GOES Simulated Brightness Temp',\n", " 'bgrdsf': 'NAM 190 grid - CONUS; 12-km Resolution; Staggered B-grid on rotated latitude/longitude grid',\n", " 'bgrd3d': 'NAM 190 grid - CONUS; 12-km Resolution; Staggered B-grid on rotated lat/lon grid using the 60 NAM hybrid levels',\n", " 'awip32': 'NAM 221 AWIPS Grid; 32-km Resolution; High Resolution North American Master Grid'}" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.PRODUCTS" ] }, { "cell_type": "markdown", "id": "9347bf9d-d5c1-4207-97e1-6e6dbcf0a740", "metadata": {}, "source": [ "## Hi-Res NAM CONUS" ] }, { "cell_type": "code", "execution_count": 5, "id": "fd5dc734", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 38MB\n",
"Dimensions: (y: 1059, x: 1799)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2022-12-10\n",
" step timedelta64[ns] 8B 06:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" latitude (y, x) float64 15MB 21.14 21.14 21.15 ... 47.85 47.84\n",
" longitude (y, x) float64 15MB 237.3 237.3 237.3 ... 299.0 299.1\n",
" valid_time datetime64[ns] 8B 2022-12-10T06:00:00\n",
" gribfile_projection object 8B None\n",
"Dimensions without coordinates: y, x\n",
"Data variables:\n",
" t2m (y, x) float32 8MB 292.3 291.9 292.2 ... 275.6 275.8\n",
"Attributes:\n",
" GRIB_edition: 2\n",
" GRIB_centre: kwbc\n",
" GRIB_centreDescription: US National Weather Service - NCEP\n",
" GRIB_subCentre: 0\n",
" Conventions: CF-1.7\n",
" institution: US National Weather Service - NCEP\n",
" model: nam\n",
" product: conusnest.hiresf\n",
" description: North America Mesoscale - CONUS\n",
" remote_grib: https://noaa-nam-pds.s3.amazonaws.com/nam.202212...\n",
" local_grib: /home/meteo/kps5442/data/nam/20221210/subset_22b...\n",
" search: TMP:2 m above| \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.0 | \n", "0 | \n", "246500.0 | \n", "0-246500 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "PRMSL | \n", "mean sea level | \n", "6 hour fcst | \n", ":PRMSL:mean sea level:6 hour fcst | \n", "
| 1 | \n", "2.0 | \n", "246501 | \n", "385516.0 | \n", "246501-385516 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "REFD | \n", "1 hybrid level | \n", "6 hour fcst | \n", ":REFD:1 hybrid level:6 hour fcst | \n", "
| 2 | \n", "3.0 | \n", "385517 | \n", "577236.0 | \n", "385517-577236 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "REFC | \n", "entire atmosphere (considered as a single layer) | \n", "6 hour fcst | \n", ":REFC:entire atmosphere (considered as a singl... | \n", "
| 3 | \n", "4.0 | \n", "577237 | \n", "687332.0 | \n", "577237-687332 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "VIS | \n", "surface | \n", "6 hour fcst | \n", ":VIS:surface:6 hour fcst | \n", "
| 4 | \n", "5.0 | \n", "687333 | \n", "878205.0 | \n", "687333-878205 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "VIS | \n", "cloud top | \n", "6 hour fcst | \n", ":VIS:cloud top:6 hour fcst | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 449 | \n", "400.0 | \n", "62089262 | \n", "62379571.0 | \n", "62089262-62379571 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "DLWRF | \n", "surface | \n", "6 hour fcst | \n", ":DLWRF:surface:6 hour fcst | \n", "
| 450 | \n", "401.0 | \n", "62379572 | \n", "62380615.0 | \n", "62379572-62380615 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "USWRF | \n", "surface | \n", "6 hour fcst | \n", ":USWRF:surface:6 hour fcst | \n", "
| 451 | \n", "402.0 | \n", "62380616 | \n", "62597205.0 | \n", "62380616-62597205 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "ULWRF | \n", "surface | \n", "6 hour fcst | \n", ":ULWRF:surface:6 hour fcst | \n", "
| 452 | \n", "403.0 | \n", "62597206 | \n", "62671780.0 | \n", "62597206-62671780 | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "APCP | \n", "surface | \n", "3-6 hour acc fcst | \n", ":APCP:surface:3-6 hour acc fcst | \n", "
| 453 | \n", "404.0 | \n", "62671781 | \n", "NaN | \n", "62671781- | \n", "2024-07-22 | \n", "2024-07-22 06:00:00 | \n", "ACPCP | \n", "surface | \n", "3-6 hour acc fcst | \n", ":ACPCP:surface:3-6 hour acc fcst | \n", "
454 rows × 10 columns
\n", "<xarray.Dataset> Size: 5MB\n",
"Dimensions: (y: 428, x: 614)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2024-07-22\n",
" step timedelta64[ns] 8B 06:00:00\n",
" atmosphereSingleLayer float64 8B 0.0\n",
" latitude (y, x) float64 2MB 12.19 12.22 12.25 ... 57.36 57.33\n",
" longitude (y, x) float64 2MB 226.5 226.6 226.8 ... 310.4 310.6\n",
" valid_time datetime64[ns] 8B 2024-07-22T06:00:00\n",
" gribfile_projection object 8B None\n",
"Dimensions without coordinates: y, x\n",
"Data variables:\n",
" refc (y, x) float32 1MB -1.03 -20.0 -20.0 ... 3.89 6.17\n",
"Attributes:\n",
" GRIB_edition: 2\n",
" GRIB_centre: kwbc\n",
" GRIB_centreDescription: US National Weather Service - NCEP\n",
" GRIB_subCentre: 0\n",
" Conventions: CF-1.7\n",
" institution: US National Weather Service - NCEP\n",
" model: nam\n",
" product: awphys\n",
" description: North America Mesoscale - CONUS\n",
" remote_grib: https://noaa-nam-pds.s3.amazonaws.com/nam.202407...\n",
" local_grib: /home/meteo/kps5442/data/nam/20240722/subset_1eb...\n",
" search: REFC<xarray.Dataset> Size: 1MB\n",
"Dimensions: (values: 72225)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2022-08-10\n",
" step timedelta64[ns] 8B 00:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" latitude (values) float64 578kB 18.07 18.07 ... 23.09 23.09\n",
" longitude (values) float64 578kB 198.5 198.5 ... 206.1 206.1\n",
" valid_time datetime64[ns] 8B 2022-08-10\n",
" gribfile_projection object 8B None\n",
"Dimensions without coordinates: values\n",
"Data variables:\n",
" t2m (values) float32 289kB 299.8 299.8 ... 299.0 299.0\n",
"Attributes:\n",
" GRIB_edition: 2\n",
" GRIB_centre: kwbc\n",
" GRIB_centreDescription: US National Weather Service - NCEP\n",
" GRIB_subCentre: 0\n",
" Conventions: CF-1.7\n",
" institution: US National Weather Service - NCEP\n",
" model: nam\n",
" product: hawaiinest.hiresf\n",
" description: North America Mesoscale - CONUS\n",
" remote_grib: https://noaa-nam-pds.s3.amazonaws.com/nam.202208...\n",
" local_grib: /home/meteo/kps5442/data/nam/20220810/subset_6fe...\n",
" search: TMP:2 m<xarray.Dataset> Size: 3MB\n",
"Dimensions: (values: 168640)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2022-08-10\n",
" step timedelta64[ns] 8B 00:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" latitude (values) float64 1MB 15.0 15.0 15.0 ... 22.01 22.01\n",
" longitude (values) float64 1MB 284.5 284.5 284.5 ... 297.5 297.5\n",
" valid_time datetime64[ns] 8B 2022-08-10\n",
" gribfile_projection object 8B None\n",
"Dimensions without coordinates: values\n",
"Data variables:\n",
" t2m (values) float32 675kB nan nan nan nan ... nan nan nan\n",
"Attributes:\n",
" GRIB_edition: 2\n",
" GRIB_centre: kwbc\n",
" GRIB_centreDescription: US National Weather Service - NCEP\n",
" GRIB_subCentre: 0\n",
" Conventions: CF-1.7\n",
" institution: US National Weather Service - NCEP\n",
" model: nam\n",
" product: priconest.hiresf\n",
" description: North America Mesoscale - CONUS\n",
" remote_grib: https://noaa-nam-pds.s3.amazonaws.com/nam.202208...\n",
" local_grib: /home/meteo/kps5442/data/nam/20220810/subset_6fe...\n",
" search: TMP:2 m above