{ "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": 1, "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": 2, "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": 3, "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'}" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.PRODUCTS" ] }, { "cell_type": "code", "execution_count": 4, "id": "fd5dc734", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "👨🏻🏭 Created directory: [/home/blaylock/data/nam/20221210]\n" ] }, { "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/blaylock/data/nam/20221210/subset_22b2c01a...\n",
" search: TMP:2 m above<xarray.Dataset>\n",
"Dimensions: (values: 72225)\n",
"Coordinates:\n",
" time datetime64[ns] 2022-08-10\n",
" step timedelta64[ns] 00:00:00\n",
" heightAboveGround float64 2.0\n",
" latitude (values) float64 18.07 18.07 18.07 ... 23.09 23.09\n",
" longitude (values) float64 198.5 198.5 198.5 ... 206.1 206.1\n",
" valid_time datetime64[ns] 2022-08-10\n",
"Dimensions without coordinates: values\n",
"Data variables:\n",
" t2m (values) float32 299.8 299.8 299.8 ... 299.0 299.0\n",
" gribfile_projection object None\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: /p/cwfs/blaylock/data/nam/20220810/subset_93f271...\n",
" search: TMP:2 m<xarray.Dataset>\n",
"Dimensions: (values: 168640)\n",
"Coordinates:\n",
" time datetime64[ns] 2022-08-10\n",
" step timedelta64[ns] 00:00:00\n",
" heightAboveGround float64 2.0\n",
" latitude (values) float64 15.0 15.0 15.0 ... 22.01 22.01 22.01\n",
" longitude (values) float64 284.5 284.5 284.5 ... 297.5 297.5\n",
" valid_time datetime64[ns] 2022-08-10\n",
"Dimensions without coordinates: values\n",
"Data variables:\n",
" t2m (values) float32 nan nan nan nan ... nan nan nan nan\n",
" gribfile_projection object None\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: /p/cwfs/blaylock/data/nam/20220810/subset_93f271...\n",
" search: TMP:2 m above