act.qc.QCFilter.add_difference_test

QCFilter.add_difference_test(var_name, dataset2_dict=None, ds2_var_name=None, diff_limit=None, tolerance='1m', set_test_regardless=True, apply_assessment_to_dataset2=None, apply_tests_to_dataset2=None, test_meaning=None, test_assessment='Bad', test_number=None, flag_value=False, prepend_text=None)

Method to perform a comparison test on time series data. Tested on 1-D data only. Will check if units and long_name indicate a direction and compensate for 0 to 360 degree transition.

Parameters:
  • var_name (str) – Data variable name.

  • dataset2_dict (dict) – Dictionary with key equal to datastream name and value equal to xarray dataset containging variable to compare. If no provided will assume second dataset is the same as self dataset.

  • ds2_var_name (str) – Comparison dataset variable name to compare.

  • diff_limit (int or float) – Difference limit for comparison.

  • apply_assessment_to_dataset2 (str or list of str) – Option to filter comparison dataset variable using corresponsing quality control variable using assessments. Example would be [‘Bad’], where all quality control data with assessment Bad will not be used in this test.

  • apply_tests_to_dataset2 (int or list of int) – Option to filter comparison dataset variable using corresponding quality control variable using test numbers. Example would be [2,4], where all quality control data with test numbers 2 or 4 set will not be used in this test.

  • tolerance (str) – Optional text indicating the time tolerance for aligning two DataArrays.

  • set_test_regardless (boolean) – Option to set test description even if no data in comparison data set.

  • test_meaning (str) – Optional text description to add to flag_meanings describing the test. Will use a default if not set.

  • test_assessment (str) – Optional single word describing the assessment of the test. Will use a default if not set.

  • test_number (int) – Optional test number to use. If not set will use next available test number.

  • flag_value (boolean) – Indicates that the tests are stored as integers not bit packed values in quality control variable.

  • prepend_text (str) – Optional text to prepend to the test meaning. Example is indicate what institution added the test.

Returns:

test_info (tuple) – A tuple containing test information including var_name, qc variable name, test_number, test_meaning, test_assessment