.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/qc/plot_relative_variability.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_qc_plot_relative_variability.py: Apply the relative variability test to data -------------------------------------------------- This is a short example of how the relative variability test can be applied to a set of variables to determine if one has greater variability than the others. This will show the variability test being tripped if the standard deviation of one variable is significantly different than that of the others. Author: Adam Theisen .. GENERATED FROM PYTHON SOURCE LINES 16-42 .. image-sg:: /source/auto_examples/qc/images/sphx_glr_plot_relative_variability_001.png :alt: sgpmfrsr7nchE11.b1 diffuse_hemisp_narrowband_filter7 on 20210329 :srcset: /source/auto_examples/qc/images/sphx_glr_plot_relative_variability_001.png :class: sphx-glr-single-img .. code-block:: Python import act from matplotlib import pyplot as plt from act.tests import EXAMPLE_MFRSR # Read in some sample MFRSR data ds = act.io.read_arm_netcdf(EXAMPLE_MFRSR) ds.clean.cleanup() variables = [v for v in list(ds) if v.startswith('diffuse_hemisp_narrowband_filter')] # Modify data to trip the test data = ds[variables[0]].values data[1000:1200] += 20 ds[variables[0]].values = data # Apply the test and have threshold of 1 thresh = 1.0 result = ds.qcfilter.add_relative_variability_test(variables, thresh) # Plot up the variables and the qc test for the first filter display = act.plotting.TimeSeriesDisplay(ds, figsize=(10, 14), subplot_shape=(2,)) for v in variables: display.plot(v, label=v, subplot_index=(0,)) display.qc_flag_block_plot(variables[0], subplot_index=(1,)) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.535 seconds) .. _sphx_glr_download_source_auto_examples_qc_plot_relative_variability.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_relative_variability.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_relative_variability.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_relative_variability.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_