.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plot_cloud_mask.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_plot_cloud_mask.py: Example on how to calculate and plot cloud masks ------------------------------------------------ This example shows how to calculate a cloud mask and plot data .. GENERATED FROM PYTHON SOURCE LINES 8-33 .. image-sg:: /source/auto_examples/images/sphx_glr_plot_cloud_mask_001.png :alt: sgpkazrgeC1.a1 reflectivity_copol on 20190529 :srcset: /source/auto_examples/images/sphx_glr_plot_cloud_mask_001.png :class: sphx-glr-single-img .. code-block:: Python import act import matplotlib.pyplot as plt from open_radar_data import DATASETS import radtraq # Read in sample data using ACT filename = DATASETS.fetch('sgpkazrgeC1.a1.20190529.000002.cdf') ds = act.io.arm.read_arm_netcdf(filename) # Resample data for ease of processing ds = ds.resample(time='1min').nearest() # Calculate and apply cloud mask ds = radtraq.proc.cloud_mask.calc_cloud_mask(ds, 'reflectivity_copol') ds = ds.where(ds['cloud_mask_2'] == 1) # Plot data using ACT display = act.plotting.TimeSeriesDisplay(ds) display.plot('reflectivity_copol', cmap='jet') display.axes[0].set_ylim([0, 20000]) plt.show() ds.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.458 seconds) .. _sphx_glr_download_source_auto_examples_plot_cloud_mask.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_cloud_mask.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_cloud_mask.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_