.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plot_zdr_check.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_zdr_check.py: ZDR Bias Calculation --------------------- This example shows how to calculate the zdr bias from VPT/Birdbath scans .. GENERATED FROM PYTHON SOURCE LINES 8-35 .. image-sg:: /source/auto_examples/images/sphx_glr_plot_zdr_check_001.png :alt: plot zdr check :srcset: /source/auto_examples/images/sphx_glr_plot_zdr_check_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Zdr Bias: 2.69 | .. code-block:: Python import matplotlib.pyplot as plt from act.io.arm import read_arm_netcdf from open_radar_data import DATASETS import radtraq # Read in example data filename = DATASETS.fetch('sgpxsaprcfrvptI4.a1.20200205.100827.nc') ds = read_arm_netcdf(filename) thresh = {'cross_correlation_ratio_hv': [0.995, 1], 'reflectivity': [10, 30], 'range': [1000, 3000]} # Call RadTraQ function results = radtraq.proc.calc_zdr_offset(ds, zdr_var='differential_reflectivity', thresh=thresh) print('Zdr Bias: ' + '%.2f' % results['bias']) fig, ax = plt.subplots(1, 3, figsize=(10, 8)) ax[0].plot(results['profile_zdr'], results['range']) ax[0].set_ylabel('Range (m)') ax[0].set_xlabel('Zdr (dB)') ax[1].plot(results['profile_reflectivity'], results['range']) ax[1].set_xlabel('Zh (dBZ)') ax[2].plot(results['profile_cross_correlation_ratio_hv'], results['range']) ax[2].set_xlabel('RhoHV ()') plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.365 seconds) .. _sphx_glr_download_source_auto_examples_plot_zdr_check.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_zdr_check.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_zdr_check.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_