Reading Older NEXRAD Data and Fixing Latitude and Longitude Issues#

In this example, we will show how to read in older NEXRAD files prior to 2008 that are missing some coordinate metadata.


# Author: Zachary Sherman (
# License: BSD 3 clause

Import our required packages.

import as ccrs
import matplotlib.pyplot as plt

import pyart

Read older NEXRAD Level 2 Data#

Older NEXRAD files prior to 2008, have the tendency to not contain some of the required metadata for Py-ART’s NEXRAD reader. This usually results in missing latitude and longitude data, so after reading with Py-ART, both coordinates have a value of 0. This example, we will show how to properly read in an older NEXRAD file.

First we want to get an older file from amazon web service:


Where in our case, we are using a sample data file from Handford, CA (KHNX) on July 24, 2006, at 0203:38 UTC. This means our path would look like this:

# Note: Older files do not contain the 'V06' but instead '.gz' in the AWS path.

aws_nexrad_level2_file = (

We can use the module to access our data, passing in the filepath.

radar =
/home/runner/work/pyart/pyart/pyart/io/ UserWarning: Gate spacing is not constant, interpolating data in scans [0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] for moment REF.

Now let us take a look at the radar latitude and longitude data.


This is clearly not correct! The problem is the reader could not find the metadata (message 31) for the coordinates.

Lucky for us, we can provide the station in Py-ART’s NEXRAD reader, which will pull the coordinate information from a dictionary found within Py-ART.

radar =, station="KHNX")

Again, let us take a look at the radar latitude and longitude data.


Everything now looks correct as this is in Handford CA!

# We can create a plot as well utilizing Cartopy to see how it looks.
display = pyart.graph.RadarMapDisplay(radar)

# Setting projection and ploting the first tilt.
projection = ccrs.LambertConformal(

fig = plt.figure(figsize=(6, 6))
    "reflectivity", 0, vmin=-20, vmax=54, projection=projection, resolution="10m"
KHNX 0.4 Deg. 2006-07-24T02:03:37Z  Equivalent reflectivity factor
/home/runner/micromamba/envs/pyart-docs/lib/python3.12/site-packages/cartopy/io/ DownloadWarning: Downloading:
  warnings.warn(f'Downloading: {url}', DownloadWarning)
/home/runner/micromamba/envs/pyart-docs/lib/python3.12/site-packages/cartopy/io/ DownloadWarning: Downloading:
  warnings.warn(f'Downloading: {url}', DownloadWarning)

Total running time of the script: (0 minutes 9.699 seconds)

Gallery generated by Sphinx-Gallery