{ "cells": [ { "cell_type": "markdown", "id": "be3d8559", "metadata": {}, "source": [ "# NEXRAD SITES WITH LAT/LON\n", "## Author: Hamid Ali Syed | [@hamidrixvi](https://twitter.com/hamidrixvi) | syed44@purdue.edu" ] }, { "cell_type": "markdown", "id": "0aa32d75", "metadata": {}, "source": [ "### Import packages" ] }, { "cell_type": "code", "execution_count": 1, "id": "bd8f60f1", "metadata": {}, "outputs": [], "source": [ "import warnings\n", "warnings.filterwarnings(\"ignore\")\n", "import datetime as dt\n", "import matplotlib.pyplot as plt\n", "import cartopy.crs as ccrs\n", "import numpy as np\n", "import pandas as pd\n", "import seaborn as sns\n", "import cartopy.crs as ccrs\n", "import cartopy.feature as feat\n", "from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER\n", "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", "import matplotlib.patches as mpatches\n", "import plotly.graph_objects as go\n", "import glob\n", "import os" ] }, { "cell_type": "markdown", "id": "f1c23a09", "metadata": {}, "source": [ "The add_Map() function is to add coastlines, land, ocean, and state boundaries to the axes." ] }, { "cell_type": "code", "execution_count": 2, "id": "1604139b", "metadata": {}, "outputs": [], "source": [ "def add_Map(ax, b = 0, t=0, l = 0, r = 0):\n", " gl = ax.gridlines(crs=ccrs.PlateCarree(), linewidth=0.3, color='black', alpha=0.3, \n", " linestyle='-', draw_labels=True)\n", " gl.xlabels_top = t\n", " gl.xlabels_bottom = b\n", " gl.ylabels_left = l\n", " gl.ylabels_right=r\n", " gl.xlines = True\n", " gl.ylines = True\n", " gl.xformatter = LONGITUDE_FORMATTER\n", " gl.yformatter = LATITUDE_FORMATTER\n", " ax.add_feature(feat.BORDERS, lw = 0.5)\n", " ax.add_feature(feat.LAND, lw = 0.3, fc = [0.9,0.9,0.9])\n", " ax.add_feature(feat.COASTLINE, lw = 0.5)\n", " ax.add_feature(feat.OCEAN, alpha = 0.5)\n", " ax.add_feature(feat.STATES.with_scale(\"10m\"), alpha = 0.5, lw = 0.5)" ] }, { "cell_type": "markdown", "id": "d56ff504", "metadata": {}, "source": [ "### Read NEXRAD data" ] }, { "cell_type": "code", "execution_count": 3, "id": "2d7dfe8b", "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv(\"nexrad_site_list.csv\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "25484052", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", " | ID | \n", "NAME | \n", "LAT | \n", "LON | \n", "
---|---|---|---|---|
0 | \n", "KVNX | \n", "VANCE AFB | \n", "36.740617 | \n", "-98.127717 | \n", "
1 | \n", "PACG | \n", "SITKA | \n", "56.852778 | \n", "-135.529167 | \n", "
2 | \n", "PAEC | \n", "NOME | \n", "64.511389 | \n", "-165.295000 | \n", "
3 | \n", "TJUA | \n", "SAN JUAN | \n", "18.115667 | \n", "-66.078167 | \n", "
4 | \n", "TJRV | \n", "JOSE APONTE DE LA TORR | \n", "18.256000 | \n", "-65.637000 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
207 | \n", "KOHX | \n", "NASHVILLE | \n", "36.247222 | \n", "-86.562500 | \n", "
208 | \n", "KYUX | \n", "YUMA | \n", "32.495281 | \n", "-114.656711 | \n", "
209 | \n", "RKSG | \n", "CAMP HUMPHREYS | \n", "37.207569 | \n", "127.285561 | \n", "
210 | \n", "TFLL | \n", "FT LAUDERDALE | \n", "26.143056 | \n", "-80.343889 | \n", "
211 | \n", "KLGX | \n", "LANGLEY HILL NW WASHIN | \n", "47.116944 | \n", "-124.106667 | \n", "
212 rows × 4 columns
\n", "