.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/plotting/plot_cappi.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_plotting_plot_cappi.py: ==================== Compare PPI vs CAPPI ==================== This example demonstrates how to create and compare PPI (Plan Position Indicator) and CAPPI (Constant Altitude Plan Position Indicator) plots using radar data. In this example, we load sample radar data, create a CAPPI at 2,000 meters for the 'reflectivity' field, and then plot both the PPI and CAPPI for comparison. .. GENERATED FROM PYTHON SOURCE LINES 13-54 .. image-sg:: /examples/plotting/images/sphx_glr_plot_cappi_001.png :alt: PPI Reflectivity, CAPPI Reflectivity at 2000 meters :srcset: /examples/plotting/images/sphx_glr_plot_cappi_001.png :class: sphx-glr-single-img .. code-block:: Python print(__doc__) # Author: Hamid Ali Syed (syed44@purdue.edu) # License: BSD 3 clause import matplotlib.pyplot as plt from open_radar_data import DATASETS import pyart # Load the sample radar data file = DATASETS.fetch("RAW_NA_000_125_20080411190016") radar = pyart.io.read(file) # Apply gate filtering to exclude unwanted data gatefilter = pyart.filters.GateFilter(radar) gatefilter.exclude_transition() # Create CAPPI at 2,000 meters for the 'reflectivity' field cappi = pyart.retrieve.create_cappi( radar, fields=["reflectivity"], height=2000, gatefilter=gatefilter ) # Create RadarMapDisplay objects for both PPI and CAPPI radar_display = pyart.graph.RadarMapDisplay(radar) cappi_display = pyart.graph.RadarMapDisplay(cappi) # Plotting the PPI and CAPPI for comparison fig, ax = plt.subplots(1, 2, figsize=(13, 5)) # Plot PPI for 'reflectivity' field radar_display.plot_ppi("reflectivity", vmin=-10, vmax=60, ax=ax[0]) ax[0].set_title("PPI Reflectivity") # Plot CAPPI for 'reflectivity' field cappi_display.plot_ppi("reflectivity", vmin=-10, vmax=60, ax=ax[1]) ax[1].set_title("CAPPI Reflectivity at 2000 meters") # Show the plots plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.968 seconds) .. _sphx_glr_download_examples_plotting_plot_cappi.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_cappi.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_cappi.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_cappi.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_