{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Calculate and Plot Composite Reflectivity\n\nCalculates and plots the composite reflectivity, or the\nmaximum reflectivity across all of the elevations.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Author: Maxwell Grover (mgrover@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 in a sample file\nfilename = get_test_data(\"swx_20120520_0641.nc\")\nradar = pyart.io.read(filename)\n\n# Configure a gatefilter to filter out copolar correlation coefficient values > 0.9\ngatefilter = pyart.filters.GateFilter(radar)\ngatefilter.exclude_transition()\ngatefilter.exclude_below(\"copol_coeff\", 0.9)\n\n# Calculate composite reflectivity, or the maximum reflectivity across all elevation levels\ncompz = pyart.retrieve.composite_reflectivity(\n radar, field=\"reflectivity_horizontal\", gatefilter=gatefilter\n)\n\n# Plot the original reflectivity field and the composite field\nfig = plt.figure(figsize=(16, 6))\nax = plt.subplot(121)\ndisplay = pyart.graph.RadarDisplay(radar)\ndisplay.plot(\"reflectivity_horizontal\", ax=ax, vmin=-20, vmax=80)\n\nax2 = plt.subplot(122)\ncomposite_display = pyart.graph.RadarDisplay(compz)\ncomposite_display.plot(\n \"composite_reflectivity\", ax=ax2, vmin=-20, vmax=80, cmap=\"HomeyerRainbow\"\n)" ] } ], "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 }