-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Updating example to show how to clean object and plot QC (#455)
* ENH: Updating example to show how to clean object and plot QC * ENH: Updating a little more and adding the file I missed!
- Loading branch information
1 parent
7fa467f
commit 243b088
Showing
2 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
""" | ||
Query the ARM DQR webservice | ||
---------------------------- | ||
Simple example for querying the ARM DQR webservice | ||
and plotting up the results | ||
Author: Adam Theisen | ||
""" | ||
|
||
|
||
from matplotlib import pyplot as plt | ||
import act | ||
|
||
# Read in sample AOSMET data | ||
files = act.tests.sample_files.EXAMPLE_AOSMET | ||
obj = act.io.armfiles.read_netcdf(files) | ||
|
||
# Query DQR webservice for a specific variable | ||
# As can be seen in the "Plotting QC Flags" example | ||
# a call to obj.clean.cleanup() would normally be needed | ||
# in order to plot up ARM's QC information. In this case | ||
# the call to add DQRs to the QC automatically applies that | ||
# cleanup so you don't have to. | ||
variable = 'temperature_ambient' | ||
obj = act.qc.arm.add_dqr_to_qc(obj, variable=variable) | ||
|
||
# Plot data | ||
# Creat Plot Display | ||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters