{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Plot a cross section from a PPI volume\n\nAn example which extracts a cross section at two azimuth angles from a volume\nof PPI scans and plots both cross sections.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "print(__doc__)\n\n# Author: Jonathan J. Helmus (jhelmus@anl.gov)\n# License: BSD 3 clause\n\nimport matplotlib.pyplot as plt\n\nimport pyart\nfrom pyart.testing import get_test_data\n\n# Read the data, a cfradial file\nfilename = get_test_data(\"swx_20120520_0641.nc\")\nradar = pyart.io.read(filename)\n\n# Create a cross section at 225 and 270 degrees azimuth\nxsect = pyart.util.cross_section_ppi(radar, [225, 270])\n\n# Set the colorbar label\ncolorbar_label = \"Equivalent \\n reflectivity factor \\n (dBZ)\"\n\ndisplay = pyart.graph.RadarDisplay(xsect)\nfig = plt.figure()\nax1 = fig.add_subplot(211)\ndisplay.plot(\n \"reflectivity_horizontal\", 0, vmin=-32, vmax=64.0, colorbar_label=colorbar_label\n)\nplt.ylim(0, 15)\nax2 = fig.add_subplot(212)\ndisplay.plot(\n \"reflectivity_horizontal\", 1, vmin=-32, vmax=64.0, colorbar_label=colorbar_label\n)\nplt.ylim(0, 15)\n\nplt.tight_layout()\nplt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.14.3" } }, "nbformat": 4, "nbformat_minor": 0 }