{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# NAM Data\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, "metadata": {}, "outputs": [], "source": [ "from herbie import Herbie\n", "from toolbox import EasyMap, pc\n", "from paint.standard2 import cm_tmp\n", "\n", "import matplotlib.pyplot as plt\n", "import cartopy.crs as ccrs" ] }, { "cell_type": "code", "execution_count": 8, "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": 9, "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": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.PRODUCTS" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "👨🏻🏭 Created directory: [C:\\Users\\blaylock\\data\\nam\\20221210]\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\blaylock\\_GITHUB\\Herbie\\herbie\\archive.py:1041: UserWarning: sorry, on windows I couldn't remove the file.\n", " warnings.warn(\"sorry, on windows I couldn't remove the file.\")\n" ] }, { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (y: 1059, x: 1799)\n",
"Coordinates:\n",
" time datetime64[ns] 2022-12-10\n",
" step timedelta64[ns] 06:00:00\n",
" heightAboveGround float64 2.0\n",
" latitude (y, x) float64 21.14 21.14 21.15 ... 47.86 47.85 47.84\n",
" longitude (y, x) float64 237.3 237.3 237.3 ... 299.0 299.0 299.1\n",
" valid_time datetime64[ns] 2022-12-10T06:00:00\n",
"Dimensions without coordinates: y, x\n",
"Data variables:\n",
" t2m (y, x) float32 292.3 291.9 292.2 ... 275.6 275.6 275.8\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: conusnest.hiresf\n",
" description: North America Mesoscale - CONUS\n",
" remote_grib: https://noaa-nam-pds.s3.amazonaws.com/nam.202212...\n",
" local_grib: C:\\Users\\blaylock\\data\\nam\\20221210\\subset_22b2c...\n",
" searchString: 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",
" searchString: 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",
" searchString: TMP:2 m above