.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plotting/plot_data_rose.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_source_auto_examples_plotting_plot_data_rose.py: Data rose plot -------------- This is an example of how to display a data rose. As can be seen in the final plot, there are two major bullseyes of data, one around 0ºC to the Northeast and another around 15ºC to the South. This tells us that we get lower temperatures when winds are out of the N/NE as would be expected at this location. This can be extended to easily review other types of data as well like aerosols and fluxes. .. GENERATED FROM PYTHON SOURCE LINES 15-106 .. image-sg:: /source/auto_examples/plotting/images/sphx_glr_plot_data_rose_001.png :alt: Mean of temp_mean (degC) by wdir_vec_mean from 20190101 to 20190107, Median of temp_mean (degC) by wdir_vec_mean from 20190101 to 20190107, Standard Deviation of temp_mean (degC) by wdir_vec_mean from 20190101 to 20190107, Heatmap of temp_mean (degC) by wdir_vec_mean from 20190101 to 20190107, Mean of temp_mean (degC) by wdir_vec_mean from 20190101 to 20190107, Boxplot of temp_mean (degC) by wdir_vec_mean from 20190101 to 20190107 :srcset: /source/auto_examples/plotting/images/sphx_glr_plot_data_rose_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/ACT/ACT/act/plotting/windrosedisplay.py:358: RuntimeWarning: Mean of empty slice arr.append(np.nanmean(data[idx])) /home/runner/micromamba/envs/act-docs/lib/python3.12/site-packages/numpy/lib/_nanfunctions_impl.py:1241: RuntimeWarning: Mean of empty slice return np.nanmean(a, axis, out=out, keepdims=keepdims) /home/runner/micromamba/envs/act-docs/lib/python3.12/site-packages/numpy/lib/_nanfunctions_impl.py:2053: RuntimeWarning: Degrees of freedom <= 0 for slice. var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof, /home/runner/work/ACT/ACT/act/plotting/windrosedisplay.py:429: RuntimeWarning: Mean of empty slice mean_data[i, j] = np.nanmean(data[idx]) | .. code-block:: Python from arm_test_data import DATASETS from matplotlib import pyplot as plt import act # Read in some data with wind speed/direction in the file met_wildcard_list = [ 'sgpmetE13.b1.20190101.000000.cdf', 'sgpmetE13.b1.20190102.000000.cdf', 'sgpmetE13.b1.20190103.000000.cdf', 'sgpmetE13.b1.20190104.000000.cdf', 'sgpmetE13.b1.20190105.000000.cdf', 'sgpmetE13.b1.20190106.000000.cdf', 'sgpmetE13.b1.20190107.000000.cdf', ] met_filenames = [DATASETS.fetch(file) for file in met_wildcard_list] ds = act.io.arm.read_arm_netcdf(met_filenames) # Set up wind rose display object display = act.plotting.WindRoseDisplay(ds, subplot_shape=(2, 3), figsize=(16, 10)) # Plot mean temperature based on wind direction display.plot_data( 'wdir_vec_mean', 'wspd_vec_mean', 'temp_mean', num_dirs=12, plot_type='line', subplot_index=(0, 0), ) # Plot median temperature based on wind direction display.plot_data( 'wdir_vec_mean', 'wspd_vec_mean', 'temp_mean', num_dirs=12, plot_type='line', subplot_index=(0, 1), line_plot_calc='median', ) # Plot standard deviation of temperature based on wind direction display.plot_data( 'wdir_vec_mean', 'wspd_vec_mean', 'temp_mean', num_dirs=12, plot_type='line', subplot_index=(0, 2), line_plot_calc='stdev', ) # Plot a contour of counts of temperature based on wind direction display.plot_data( 'wdir_vec_mean', 'wspd_vec_mean', 'temp_mean', num_dirs=12, plot_type='contour', subplot_index=(1, 0), ) # Plot a contour of mean temperature based on wind direction and wind speed display.plot_data( 'wdir_vec_mean', 'wspd_vec_mean', 'temp_mean', num_dirs=12, plot_type='contour', contour_type='mean', num_data_bins=10, clevels=21, cmap='rainbow', vmin=-5, vmax=20, subplot_index=(1, 1), ) # Plot a boxplot of temperature based on wind direction display.plot_data( 'wdir_vec_mean', 'wspd_vec_mean', 'temp_mean', num_dirs=12, plot_type='boxplot', subplot_index=(1, 2), ) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.586 seconds) .. _sphx_glr_download_source_auto_examples_plotting_plot_data_rose.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_data_rose.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_data_rose.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_data_rose.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_