Plotting QC Flags#

Simple example for cleaning up a dataset and plotting the data and its QC flags

Author: Adam Theisen

sgpmetE13.b1 temp_mean on 20190101
/home/runner/work/ACT/ACT/act/utils/datetime_utils.py:132: FutureWarning: Unlike other reduction functions (e.g. `skew`, `kurtosis`), the default behavior of `mode` typically preserves the axis it acts along. In SciPy 1.11.0, this behavior will change: the default value of `keepdims` will become False, the `axis` over which the statistic is taken will be eliminated, and the value None will no longer be accepted. Set `keepdims` to True or False to avoid this warning.
  mode = stats.mode(np.diff(time))

from matplotlib import pyplot as plt
import act

# Read in sample MET data
files = act.tests.sample_files.EXAMPLE_MET1
obj = act.io.armfiles.read_netcdf(files)

# In order to utilize all the ACT QC modules and plot the QC,
# we need to clean up the object to follow CF standards
obj.clean.cleanup()


# Plot data
# Creat Plot Display
variable = 'temp_mean'
display = act.plotting.TimeSeriesDisplay(obj, figsize=(15, 10), subplot_shape=(2,))

# Plot temperature data in top plot
display.plot(variable, subplot_index=(0,))

# Plot QC data
display.qc_flag_block_plot(variable, subplot_index=(1,))
plt.show()

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

Gallery generated by Sphinx-Gallery