act.qc.add_dqr_to_qc

act.qc.add_dqr_to_qc(obj, variable=None, assessment='incorrect,suspect', exclude=None, include=None, normalize_assessment=True, cleanup_qc=True)[source]

Function to query the ARM DQR web service for reports and add as a new quality control test to ancillary quality control variable. If no anicllary quality control variable exist a new one will be created and lined to the data variable through ancillary_variables attribure.

See online documentation from ARM Data Quality Office on the use of the DQR web service.

https://code.arm.gov/docs/dqrws-examples/wikis/home

Information about the DQR web-service avaible at https://adc.arm.gov/dqrws/

Parameters:
  • obj (xarray Dataset) – Data object

  • variable (string, or list of str, or None) – Variables to check DQR web service. If set to None will attempt to update all variables.

  • assessment (string) – assessment type to get DQRs. Current options include ‘missing’, ‘suspect’, ‘incorrect’ or any combination separated by a comma.

  • exclude (list of strings) – DQR IDs to exclude from adding into QC

  • include (list of strings) – List of DQR IDs to include in flagging of data. Any other DQR IDs will be ignored.

  • normalize_assessment (boolean) – The DQR assessment term is different than the embedded QC term. Embedded QC uses “Bad” and “Indeterminate” while DQRs use “Incorrect” and “Suspect”. Setting this will ensure the same terms are used for both.

  • cleanup_qc (boolean) – Call clean.cleanup() method to convert to standardized ancillary quality control variables. Has a little bit of overhead so if the Dataset has already been cleaned up, no need to run.

Returns:

obj (xarray Dataset) – Data object

Examples

from act.qc.arm import add_dqr_to_qc
obj = add_dqr_to_qc(obj, variable=['temp_mean', 'atmos_pressure'])