{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "f168804a-2c0d-4dd7-8b1c-5d909c889452", "metadata": {}, "source": [ "# RAP Data\n", "\n", "This demonstrates how to use data from the Rapid Refresh (RAP) model. 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 toolbox import EasyMap, pc\n", "from paint.standard2 import cm_tmp\n", "import pandas as pd\n", "\n", "import matplotlib.pyplot as plt\n", "import cartopy.crs as ccrs" ] }, { "cell_type": "code", "execution_count": 2, "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;13m2021-Nov-19 00: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(\"2021-11-19\", model=\"rap\", product=\"awp130pgrb\")" ] }, { "cell_type": "code", "execution_count": 3, "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": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.PRODUCTS" ] }, { "cell_type": "code", "execution_count": 5, "id": "f2eeadf9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'aws': 'https://noaa-rap-pds.s3.amazonaws.com/rap.20211119/rap.t00z.awp130pgrbf00.grib2',\n", " 'nomads': 'https://nomads.ncep.noaa.gov/pub/data/nccf/com/rap/prod/rap.20211119/rap.t00z.awp130pgrbf00.grib2',\n", " 'google': 'https://storage.googleapis.com/rapid-refresh/rap.20211119/rap.t00z.awp130pgrbf00.grib2',\n", " 'azure': 'https://noaarap.blob.core.windows.net/rap/rap.20211119/rap.t00z.awp130pgrbf00.grib2'}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.SOURCES" ] }, { "cell_type": "code", "execution_count": 7, "id": "8757a741-afbd-4cb7-89ab-59b647cbc4b1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (y: 337, x: 451)\n",
"Coordinates:\n",
" time datetime64[ns] 2021-11-19\n",
" step timedelta64[ns] 00:00:00\n",
" heightAboveGround float64 2.0\n",
" latitude (y, x) float64 ...\n",
" longitude (y, x) float64 ...\n",
" valid_time datetime64[ns] ...\n",
"Dimensions without coordinates: y, x\n",
"Data variables:\n",
" t2m (y, x) float32 ...\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: 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.202111...\n",
" local_grib: C:\\Users\\blaylock\\data\\rap\\20211119\\subset_5aefe...\n",
" searchString: TMP:2 m above<xarray.Dataset>\n",
"Dimensions: (y: 337, x: 451)\n",
"Coordinates:\n",
" time datetime64[ns] 2019-11-23\n",
" step timedelta64[ns] 00:00:00\n",
" heightAboveGround float64 2.0\n",
" latitude (y, x) float64 16.28 16.31 16.34 ... 55.54 55.51 55.48\n",
" longitude (y, x) float64 233.9 234.0 234.1 ... 302.3 302.4 302.6\n",
" valid_time datetime64[ns] 2019-11-23\n",
"Dimensions without coordinates: y, x\n",
"Data variables:\n",
" t2m (y, x) float32 298.3 298.4 298.5 ... 274.3 274.3 274.4\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: 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: C:\\Users\\blaylock\\data\\rap_historical\\20191123\\s...\n",
" searchString: TMP:2 m above