act.qc.QCFilter.add_persistence_test#

QCFilter.add_persistence_test(var_name, window=10, test_limit=0.0001, min_periods=1, center=True, test_meaning=None, test_assessment='Bad', test_number=None, flag_value=False, prepend_text=None, ignore_range=None)#

Method to perform a persistence test over 1-D data..

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

  • window (int) – Optional number of data samples to use in the calculation of standard deviation to test for consistent data.

  • test_limit (float) – Optional test limit to use where the standard deviation less than will trigger the test.

  • min_periods (int) – Optional number of minimum values to use in the moving window. Setting to 1 so this correctly handles NaNs.

  • center (boolean) – Optional where within the moving window to report the standard deviation values. Used in the .rolling.std() calculation with xarray.

  • test_meaning (None or str) – The optional text description to add to flag_meanings describing the test. Will add a default if not set.

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

  • test_number (None or int) – Optional test number to use. If not set will ues 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 (None or str) – Optional text to prepend to the test meaning. Example is indicate what institution added the test.

  • ignore_range (None, tuple, list) – Optional list of minimum and maximum data values used to define a range where the test will not flag if a persistence is discovered if the data used in testing is within this range. Can be used when there is a specific range of values that often have a persistent value. e.g. RH at 100% during raining event.

Returns:

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