act.qc.QCFilter.available_bit

QCFilter.available_bit(qc_var_name, recycle=False)[source]

Method to determine next available bit or flag to use with a QC test. Will check for flag_masks first and if not found will check for flag_values. This will drive how the next value is chosen.

Parameters:
  • qc_var_name (str) – Quality control variable name.

  • recycle (boolean) – Option to look for a bit (test) not in use starting from 1. If a test is not defined will return the lowest number, else will just use next highest number.

Returns:

test_num (int) – Next available test number.

Examples

from act.tests import EXAMPLE_METE40
from act.io.armfiles import read_netcdf
obj = read_netcdf(EXAMPLE_METE40, cleanup_qc=True)
test_number = obj.qcfilter.available_bit('qc_atmos_pressure')
print(test_number)