{ "metadata": { "name": "", "signature": "sha256:470e554090dc85c9b7512a887dcfb29a9c6c54e5531599ff62c1bfeab34e5eab" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "

Bonus 1: CHILL data!

\n", "Scott Collis1 and \n", "Jonathan Helmus1 \n", "
\n", "1:Argonne National Laboratory\n", "
\n", "With thanks to Joe Hardin from CSU! \n", "
\n", "This is a case in example of the philosophy behind Py-ART! \n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#first import!\n", "import pyart\n", "from matplotlib import pyplot as plt\n", "%matplotlib inline" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "filename = 'data/CHL20100621_222020'\n", "radar = pyart.io.read(filename)\n" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "print radar.fields.keys()" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "display = pyart.graph.RadarDisplay(radar)" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "fig = plt.figure(figsize = [20,10])\n", "display.plot_rhi('reflectivity',vmax = 64)\n", "plt.gca().set_ylim([0,15])\n", "plt.gca().set_xlim([0,80])" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "fig = plt.figure(figsize = [20,10])\n", "display.plot_rhi('differential_reflectivity', vmin = -2, vmax =6)\n", "plt.gca().set_ylim([0,15])\n", "plt.gca().set_xlim([0,80])" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "fig = plt.figure(figsize = [20,10])\n", "display.plot_rhi('velocity')\n", "plt.gca().set_ylim([0,15])\n", "plt.gca().set_xlim([0,80])" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also use some of the IPython interactive widgets to create a interactive display utility for CHILL files!" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.html.widgets import interact, interactive, fixed\n", "from IPython.html import widgets" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "def plot_chill_field(display, field='reflectivity', tilt=0):\n", " fig = plt.figure(figsize = [20,10])\n", " display.plot_rhi(field, tilt)\n", " plt.gca().set_ylim([0,15])\n", " plt.gca().set_xlim([0,80])" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "interact(plot_chill_field,display=fixed(display), field=radar.fields.keys(), tilt=widgets.IntSliderWidget(min=0,max=radar.nsweeps-1,step=1,value=0) );" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }