
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "source/auto_examples/force_line_plot_qc.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_source_auto_examples_force_line_plot_qc.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_source_auto_examples_force_line_plot_qc.py:


===========================================================
Example for working with embedded quality control variables
===========================================================

This is an example of how to use 2 dimentional DataArrays containing
multiple 1 dimentional data, including a summary quality control
plot showing the tests for each 1 dimentional data slice. This
example uses the force_line_plot keyword which will force multiple
1 dimentional plots for each element along the second dimention of
the non-time dimention.

Author: Ken Kehoe

.. GENERATED FROM PYTHON SOURCE LINES 16-48

.. code-block:: default


    import matplotlib.pyplot as plt
    from act.io.armfiles import read_netcdf
    from act.plotting import TimeSeriesDisplay
    from act.tests import EXAMPLE_SURFSPECALB1MLAWER

    # Read a data file that has a 2D DataArray of multiple 1D data.
    # The corresponding quality control DataArray is also read in and
    # will be used to make a summary plot of quality control infomation
    # of each assessment category.
    obj = read_netcdf(EXAMPLE_SURFSPECALB1MLAWER)

    # The name of the data variable we wish to plot
    var_name = 'surface_albedo_mfr_narrowband_10m'

    # Create the ACT display object used for plotting. This will have two
    # vertical plots of 800 by 400 pixels.
    display = TimeSeriesDisplay(obj, subplot_shape=(2, ), figsize=(8, 2 * 4))

    # Create the top plot of data using the force_line_plot option.
    # This will force the plotting to not assume the data are 2D data that
    # would normally be plotted as a 2D plot. Rather for each index into the
    # filter dimention plot a 1D time series plot. Setting labels=True
    # will create a legend using the filter dimention DataArray.
    display.plot(var_name, force_line_plot=True, labels=True)

    # Create the bottom plot of summarized quality control by assessment
    # cateory.
    display.qc_flag_block_plot(var_name, subplot_index=(1, ))

    # Show the plot in a new window.
    plt.show()


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** ( 0 minutes  0.000 seconds)


.. _sphx_glr_download_source_auto_examples_force_line_plot_qc.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example



  .. container:: sphx-glr-download sphx-glr-download-python

     :download:`Download Python source code: force_line_plot_qc.py <force_line_plot_qc.py>`



  .. container:: sphx-glr-download sphx-glr-download-jupyter

     :download:`Download Jupyter notebook: force_line_plot_qc.ipynb <force_line_plot_qc.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
