{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Calculate and plot wind rose plots separated by day.\n\nExample of how to read in MET data and plot histograms\nof wind speed and temperature grouped by day.\n\nAuthor: Bobby Jackson\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\nfrom arm_test_data import DATASETS\n\nimport act\n\n# Read in the sample MET data\nmet_wildcard_list = [\n 'sgpmetE13.b1.20190101.000000.cdf',\n 'sgpmetE13.b1.20190102.000000.cdf',\n 'sgpmetE13.b1.20190103.000000.cdf',\n 'sgpmetE13.b1.20190104.000000.cdf',\n 'sgpmetE13.b1.20190105.000000.cdf',\n 'sgpmetE13.b1.20190106.000000.cdf',\n 'sgpmetE13.b1.20190107.000000.cdf',\n]\nmet_filenames = [DATASETS.fetch(file) for file in met_wildcard_list]\nds = act.io.arm.read_arm_netcdf(met_filenames)\n\n# Create Plot Display\ndisplay = act.plotting.WindRoseDisplay(ds, figsize=(15, 15), subplot_shape=(3, 3))\ngroupby = display.group_by('day')\ngroupby.plot_group(\n 'plot_data',\n None,\n dir_field='wdir_vec_mean',\n spd_field='wspd_vec_mean',\n data_field='temp_mean',\n num_dirs=12,\n plot_type='line',\n)\n\n# Set theta tick markers for each axis inside display to be inside the polar axes\nfor i in range(3):\n for j in range(3):\n display.axes[i, j].tick_params(pad=-20)\nplt.show()\nds.close()" ] } ], "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 }