{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "f168804a-2c0d-4dd7-8b1c-5d909c889452", "metadata": {}, "source": [ "# RAP\n", "\n", "This demonstrates how to download and use Rapid Refresh (RAP) model data. This is perhaps the messiest dataset Herbie tries to look for (lots of sources, different file naming conventions, lots of different products)." ] }, { "cell_type": "code", "execution_count": 1, "id": "b4cba677-7674-47d6-8dde-2d297b138c57", "metadata": {}, "outputs": [], "source": [ "from herbie import Herbie\n", "from herbie.toolbox import EasyMap, pc\n", "from herbie import paint\n", "\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 12, "id": "6384df86-fc73-4496-a138-5f227535b6d6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "✅ Found ┊ model=rap ┊ \u001b[3mproduct=awp130pgrb\u001b[0m ┊ \u001b[38;2;41;130;13m2024-Jun-22 18:00 UTC\u001b[92m F00\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(\"2024-6-22 18:00\", model=\"rap\", product=\"awp130pgrb\")" ] }, { "cell_type": "code", "execution_count": 13, "id": "0de5622a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'awp130pgrb': 'CONUS Pressure levels; 13-km resolution',\n", " 'awp252pgrb': 'CONUS Pressure levels; 20-km resolution',\n", " 'awp236pgrb': 'CONUS Pressure levels; 40-km resolution',\n", " 'awp130bgrb': 'CONUS Native levels; 13-km resolution',\n", " 'awp252bgrb': 'CONUS Native levels; 20-km resolution',\n", " 'wrfprs': 'Full domain Pressure Levels; 13-km',\n", " 'wrfnat': 'Full domain Native Levels; 13-km',\n", " 'awip32': 'NOAMHI - High-Resolution North American Master Grid; 32-km resolution',\n", " 'awp242': 'Alaska Quadruple Resolution Pressure levels; 11-km resolution',\n", " 'awp200': 'Puerto Rico Pressure levels; 16-km resolution',\n", " 'awp243': 'Eastern North America Pressure levels, 0.4 degree resolution',\n", " 'wrfmsl': 'WRFMSL; 13-km resolution'}" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.PRODUCTS" ] }, { "cell_type": "code", "execution_count": 14, "id": "f2eeadf9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'aws': 'https://noaa-rap-pds.s3.amazonaws.com/rap.20240622/rap.t18z.awp130pgrbf00.grib2',\n", " 'nomads': 'https://nomads.ncep.noaa.gov/pub/data/nccf/com/rap/prod/rap.20240622/rap.t18z.awp130pgrbf00.grib2',\n", " 'google': 'https://storage.googleapis.com/rapid-refresh/rap.20240622/rap.t18z.awp130pgrbf00.grib2',\n", " 'azure': 'https://noaarap.blob.core.windows.net/rap/rap.20240622/rap.t18z.awp130pgrbf00.grib2'}" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.SOURCES" ] }, { "cell_type": "code", "execution_count": 15, "id": "8757a741-afbd-4cb7-89ab-59b647cbc4b1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 3MB\n",
"Dimensions: (y: 337, x: 451)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2024-06-22T18:00:00\n",
" step timedelta64[ns] 8B 00:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" latitude (y, x) float64 1MB 16.28 16.31 16.34 ... 55.51 55.48\n",
" longitude (y, x) float64 1MB 233.9 234.0 234.1 ... 302.4 302.6\n",
" valid_time datetime64[ns] 8B 2024-06-22T18:00:00\n",
" gribfile_projection object 8B None\n",
"Dimensions without coordinates: y, x\n",
"Data variables:\n",
" t2m (y, x) float32 608kB 296.2 296.3 296.4 ... 276.1 276.2\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: rap\n",
" product: awp130pgrb\n",
" description: Rapid Refresh (RAP) from NOMADS and Big Data Pro...\n",
" remote_grib: https://noaa-rap-pds.s3.amazonaws.com/rap.202406...\n",
" local_grib: /home/blaylock/data/rap/20240622/subset_d1efe363...\n",
" search: TMP:2 m above<xarray.Dataset> Size: 3MB\n",
"Dimensions: (y: 337, x: 451)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2019-11-23\n",
" step timedelta64[ns] 8B 00:00:00\n",
" heightAboveGround float64 8B 2.0\n",
" latitude (y, x) float64 1MB 16.28 16.31 16.34 ... 55.51 55.48\n",
" longitude (y, x) float64 1MB 233.9 234.0 234.1 ... 302.4 302.6\n",
" valid_time datetime64[ns] 8B 2019-11-23\n",
" gribfile_projection object 8B None\n",
"Dimensions without coordinates: y, x\n",
"Data variables:\n",
" t2m (y, x) float32 608kB 298.3 298.4 298.5 ... 274.3 274.4\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: rap_historical\n",
" product: analysis\n",
" description: Rapid Refresh - NCEI Historical\n",
" remote_grib: https://www.ncei.noaa.gov/data/rapid-refresh/acc...\n",
" local_grib: /home/blaylock/data/rap_historical/20191123/subs...\n",
" search: TMP:2 m above