Skip to content

Commit

Permalink
DOC: Add docs on using xradar with Py-ART
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrover1 committed Sep 29, 2023
1 parent c4ff8ed commit f2f0629
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
- sphinx-copybutton
- nbsphinx
- pre_commit
- cmweather
- pip
- pip:
- pooch
Expand Down
6 changes: 6 additions & 0 deletions examples/xradar/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _xradar_examples:

Xradar Examples
------------------

Examples of using Xradar with Py-ART to accomplish different tasks.
30 changes: 30 additions & 0 deletions examples/xradar/plot_xradar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
==================================
Plot a PPI Using Xradar and Py-ART
==================================
An example which uses xradar andd Py-ART to create a PPI plot of a Cfradial file.
"""

# Author: Max Grover ([email protected])
# License: BSD 3 clause


import xradar as xd

import pyart
from pyart.testing import get_test_data

# Locate the test data and read in using xradar
filename = get_test_data("swx_20120520_0641.nc")
tree = xd.io.open_cfradial1_datatree(filename)

# Give the tree Py-ART radar methods
radar = pyart.xradar.Xradar(tree)

# Plot the Reflectivity Field (corrected_reflectivity_horizontal)
display = pyart.graph.RadarMapDisplay(radar)
display.plot_ppi(
"corrected_reflectivity_horizontal", cmap="ChaseSpectral", vmin=-20, vmax=70
)

0 comments on commit f2f0629

Please sign in to comment.