{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Dealias doppler velocities using the Region Based Algorithm\n\nIn this example doppler velocities are dealiased using the ial condition of the dealiasing,\nusing the region-based dealiasing algorithm in Py-ART.\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\nradar_file = get_test_data(\"095636.mdv\")\nsonde_file = get_test_data(\"sgpinterpolatedsondeC1.c1.20110510.000000.cdf\")\n\n# read in the data\nradar = pyart.io.read_mdv(radar_file)\n\n# read in sonde data\ndt, profile = pyart.io.read_arm_sonde_vap(sonde_file, radar=radar)\n\n# create a gate filter which specifies gates to exclude from dealiasing\ngatefilter = pyart.filters.GateFilter(radar)\ngatefilter.exclude_transition()\ngatefilter.exclude_invalid(\"velocity\")\ngatefilter.exclude_invalid(\"reflectivity\")\ngatefilter.exclude_outside(\"reflectivity\", 0, 80)\n\n# perform dealiasing\ndealias_data = pyart.correct.dealias_region_based(radar, gatefilter=gatefilter)\nradar.add_field(\"corrected_velocity\", dealias_data)\n\n# create a plot of the first and sixth sweeps\nfig = plt.figure(figsize=(15, 10))\nax1 = fig.add_subplot(221)\ndisplay = pyart.graph.RadarDisplay(radar)\ndisplay.plot(\n \"velocity\",\n 0,\n vmin=-16,\n vmax=16,\n ax=ax1,\n colorbar_label=\"\",\n title=\"Raw Doppler Velocity, First Sweep\",\n)\n\nax2 = fig.add_subplot(222)\ndisplay.plot(\n \"corrected_velocity\",\n 0,\n vmin=-40,\n vmax=40,\n colorbar_label=\"\",\n ax=ax2,\n title=\"Corrected Doppler Velocity, First Sweep\",\n)\n\nax3 = fig.add_subplot(223)\ndisplay = pyart.graph.RadarDisplay(radar)\ndisplay.plot(\n \"velocity\",\n 5,\n vmin=-16,\n vmax=16,\n colorbar_label=\"\",\n ax=ax3,\n title=\"Raw Doppler Velocity, Sixth Sweep\",\n)\n\nax4 = fig.add_subplot(224)\ndisplay.plot_ppi(\n \"corrected_velocity\",\n 5,\n vmin=-40,\n vmax=40,\n colorbar_label=\"\",\n ax=ax4,\n title=\"Corrected Doppler Velocity, Sixth Sweep\",\n)\nplt.suptitle(\"Velocity dealiasing using Py-ART\", fontsize=16)\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 }