NEXRAD (Next-Generation Radar) Level II data is publicly available through AWS S3. The data is organized by date and radar site, making it easy to download specific datasets.
NEXRAD Level II data is stored in the AWS S3 bucket: s3://noaa-nexrad-level2
Bucket Structure:
s3://noaa-nexrad-level2/
└── YYYY/
└── MM/
└── DD/
└── RADAR_SITE/
└── RADAR_SITE_YYYYMMDD_HHMMSS_V##.gz
Path Format:
YYYY- 4-digit year (e.g., 2024)MM- 2-digit month (e.g., 01, 12)DD- 2-digit day (e.g., 01, 31)RADAR_SITE- 4-letter radar site identifier (e.g., KTLX, KFWS, KDFW)
Example Path:
s3://noaa-nexrad-level2/2024/01/15/KTLX/KTLX20240115_120000_V06.gz
nexradaws
- Library:
nexradaws(pip install nexradaws) - Provides easy-to-use functions to query and download NEXRAD data
- Example:
import nexradaws conn = nexradaws.NexradAwsInterface() scans = conn.get_avail_scans('2024-01-15', 'KTLX') conn.download(scans, '/path/to/download')
pyart
- Library:
arm_pyart(pip install arm_pyart) - Comprehensive radar data analysis library
- Can read NEXRAD Level II files after download
boto3 (AWS SDK)
- Direct S3 access using AWS SDK
- Example:
import boto3 s3 = boto3.client('s3', region_name='us-east-1') s3.download_file('noaa-nexrad-level2', '2024/01/15/KTLX/KTLX20240115_120000_V06.gz', 'local_file.gz')
AWS CLI
aws s3 ls s3://noaa-nexrad-level2/2024/01/15/KTLX/
aws s3 cp s3://noaa-nexrad-level2/2024/01/15/KTLX/file.gz ./wget/curl
- Can download directly from S3 public URLs (though S3 API is preferred)
NEXRAD sites use 4-letter identifiers (ICAO format):
- Format:
K+ 3-letter identifier - Examples:
KTLX- Twin Lakes, OklahomaKFWS- Fort Worth, TexasKDFW- Dallas/Fort Worth, TexasKJAX- Jacksonville, Florida
Full list of radar sites available at: https://www.weather.gov/radar_tabular
File Naming Convention:
RADAR_SITE_YYYYMMDD_HHMMSS_V##.gz
RADAR_SITE- 4-letter site codeYYYYMMDD- Date (year, month, day)HHMMSS- Time (hour, minute, second, UTC)V##- Version number (typically V06).gz- Gzip compressed
Data Format:
- Files are compressed with gzip
- Original format is NEXRAD Level II (binary format)
- Requires specialized software/libraries to read (pyart, wradlib, etc.)
Time Resolution:
- Scans typically occur every 4-10 minutes
- Multiple scans per day available
- Historical data available back to ~1991
Query Available Scans:
-
List all files for a specific date and site:
aws s3 ls s3://noaa-nexrad-level2/YYYY/MM/DD/RADAR_SITE/ --recursive
-
Using Python (nexradaws):
import nexradaws conn = nexradaws.NexradAwsInterface() scans = conn.get_avail_scans('2024-01-15', 'KTLX') print(f"Found {len(scans)} scans")
Download Specific Time Range:
import nexradaws
from datetime import datetime
conn = nexradaws.NexradAwsInterface()
start = datetime(2024, 1, 15, 12, 0, 0)
end = datetime(2024, 1, 15, 18, 0, 0)
scans = conn.get_avail_scans_in_range(start, end, 'KTLX')
conn.download(scans, './downloads')This project provides Python modules for downloading and visualizing NEXRAD Level II data.
The project uses pixi for dependency management. Install dependencies with:
pixi installDependencies include:
python(3.12.*)nexradaws- For downloading NEXRAD data from AWSarm_pyart- For reading and plotting radar datamatplotlib- For creating visualizations
The nexrad.py module provides functions for downloading and plotting NEXRAD data.
download_nexrad_data(date_str, radar_site, output_dir="./downloads", time_range=None)
- Downloads NEXRAD Level II data for a given date and radar site
- Parameters:
date_str: Date in format 'YYYY-MM-DD' (e.g., '2024-01-15')radar_site: 4-letter radar site identifier (e.g., 'KTLX', 'KFWS')output_dir: Directory to save downloaded files (default: './downloads')time_range: Optional tuple of (start_time, end_time) as datetime objects
- Returns: List of paths to downloaded files
- Example:
from nexrad import download_nexrad_data files = download_nexrad_data('2024-01-15', 'KTLX', './downloads') print(f"Downloaded {len(files)} files")
download_nexrad_data_by_time_range(date_str, radar_site, start_hour, end_hour, output_dir="./downloads")
- Downloads NEXRAD data for a specific date and time range
- Parameters:
date_str: Date in format 'YYYY-MM-DD'radar_site: 4-letter radar site identifierstart_hour: Start hour (0-23) in UTCend_hour: End hour (0-23) in UTCoutput_dir: Directory to save downloaded files
- Returns: List of paths to downloaded files
- Example:
from nexrad import download_nexrad_data_by_time_range files = download_nexrad_data_by_time_range( '2024-01-15', 'KTLX', start_hour=12, end_hour=18, output_dir='./downloads' )
plot_nexrad_data(file_path, output_path=None, field='reflectivity', sweep=0, figsize=(10, 10))
- Plots NEXRAD Level II data using pyart
- Parameters:
file_path: Path to the NEXRAD Level II file (.gz or uncompressed)output_path: Optional path to save the plot. If None, saves toplotsfolder with naming:radar_date_time_variable.pngfield: Radar field to plot (default: 'reflectivity'). Common fields: 'reflectivity', 'velocity', 'spectrum_width'sweep: Sweep/elevation angle index to plot (default: 0, lowest elevation)figsize: Figure size tuple (width, height) in inches
- Returns: Path to the saved plot file
- Example:
from nexrad import plot_nexrad_data plot_path = plot_nexrad_data('./downloads/KTLX20240115_120000_V06') print(f"Plot saved to: {plot_path}")
plot_multiple_nexrad_files(file_paths, output_dir=None, field='reflectivity', sweep=0)
- Plots multiple NEXRAD files and saves plots
- Parameters:
file_paths: List of paths to NEXRAD Level II filesoutput_dir: Optional directory to save plots. If None, saves to plots folder next to each filefield: Radar field to plot (default: 'reflectivity')sweep: Sweep/elevation angle index to plot (default: 0)
- Returns: List of paths to saved plot files
- Example:
from nexrad import plot_multiple_nexrad_files files = ['./downloads/file1', './downloads/file2'] plot_paths = plot_multiple_nexrad_files(files, field='reflectivity')
download_and_plot_sequential_scans(start_datetime, radar_site, n_additional, output_dir="./downloads", plots_dir=None, field='reflectivity', sweep=0)
- Downloads and plots a scan at a given datetime plus n additional sequential scans
- Parameters:
start_datetime: Starting datetime for the first scan (datetime object)radar_site: 4-letter radar site identifier (e.g., 'KTLX')n_additional: Number of additional scans to download and plot after the start datetimeoutput_dir: Directory to save downloaded files (default: './downloads')plots_dir: Directory to save plots. If None, uses 'plots' folder at rootfield: Radar field to plot (default: 'reflectivity')sweep: Sweep/elevation angle index to plot (default: 0)
- Returns: List of paths to saved plot files
- Example:
from nexrad import download_and_plot_sequential_scans from datetime import datetime start = datetime(2024, 1, 15, 12, 0, 0) plots = download_and_plot_sequential_scans(start, 'KTLX', 3) print(f"Created {len(plots)} plots")
You can also run nexrad.py directly from the command line:
pixi run python nexrad.py <date> <radar_site> [output_dir]Example:
pixi run python nexrad.py 2024-01-15 KTLX ./downloadsThis will download all scans for the specified date and radar site, and automatically plot the first file.
The test.py script provides comprehensive tests for all functionality in nexrad.py.
Run all tests with:
pixi run python test.pyThe test script includes the following test functions:
test_list_available_scans()- Tests querying available scans for yesterdaytest_download_nexrad_data()- Tests downloading NEXRAD data for a 1-hour time windowtest_plot_nexrad_data()- Tests plotting a single NEXRAD filetest_sequential_scans_plotting()- Tests downloading and plotting sequential scans
All tests use yesterday's date to ensure data availability and download a small sample to keep test execution time reasonable.
The test script provides detailed output showing:
- Number of scans found
- Files downloaded
- Plots created
- File sizes and paths
- Test pass/fail status
Plots are automatically saved with the naming format:
radar_date_time_variable.png
Example: KTLX_20240115_120505_reflectivity.png
KTLX- Radar site code20240115- Date (YYYYMMDD)120505- Time (HHMMSS UTC)reflectivity- Radar variable plotted
Plots are saved in the plots folder at the project root by default.
from nexrad import download_and_plot_sequential_scans
from datetime import datetime
# Download and plot 4 sequential scans starting at noon
start_time = datetime(2024, 1, 15, 12, 0, 0)
plot_paths = download_and_plot_sequential_scans(
start_datetime=start_time,
radar_site='KTLX',
n_additional=3, # Total of 4 scans (1 initial + 3 additional)
output_dir='./downloads',
plots_dir='plots',
field='reflectivity'
)
print(f"Created {len(plot_paths)} plots:")
for plot_path in plot_paths:
print(f" - {plot_path}")- AWS NEXRAD Data: https://registry.opendata.aws/noaa-nexrad/
- NOAA NEXRAD Information: https://www.weather.gov/radar
- PyArt Documentation: https://arm-doe.github.io/pyart/
- NEXRADaws Documentation: https://github.com/aarande/nexradaws