{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Query the ARM DQR webservice\n\nThis example shows how to query the ARM Data Quality Report (DQR) webservice,\nto retrieve the machine readable DQR information. This function adds the\nDQR information to corresponding QC variables (qc_[variablename]) in the\ndataset. The example then shows how to visualize this information as we\ndo with the normal QC variables.\n\nAuthor: Adam Theisen\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from arm_test_data import DATASETS\nfrom matplotlib import pyplot as plt\n\nimport act\n\n# Read in sample AOSMET data\nfilename_aosmet = DATASETS.fetch('maraosmetM1.a1.20180201.000000.nc')\nds = act.io.arm.read_arm_netcdf(filename_aosmet)\n\n# Query DQR webservice for a specific variable\n# As can be seen in the \"Plotting QC Flags\" example\n# a call to obj.clean.cleanup() would normally be needed\n# in order to plot up ARM's QC information. In this case\n# the call to add DQRs to the QC automatically applies that\n# cleanup so you don't have to.\nvariable = 'temperature_ambient'\nds = act.qc.arm.add_dqr_to_qc(ds, variable=variable)\n\n# Plot data\n# Creat Plot Display\ndisplay = act.plotting.TimeSeriesDisplay(ds, figsize=(15, 10), subplot_shape=(2,))\n\n# Plot temperature data in top plot\ndisplay.plot(variable, subplot_index=(0,))\n\n# Plot QC data\ndisplay.qc_flag_block_plot(variable, subplot_index=(1,))\nplt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.14.3" } }, "nbformat": 4, "nbformat_minor": 0 }