act.qc.QCFilter.update_ancillary_variable

QCFilter.update_ancillary_variable(var_name, qc_var_name=None)[source]

Method to check if ancillary_variables variable attribute is set with quality control variable name.

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

  • qc_var_name (str) – quality control variable name. If not given will attempt to get the name from data variable ancillary_variables attribute.

Examples

from act.tests import EXAMPLE_AOSMET
from act.io.armfiles import read_netcdf
obj = read_netcdf(EXAMPLE_AOSMET)
var_name = 'temperature_ambient'
qc_var_name = obj.qcfilter.create_qc_variable(var_name)
del obj[var_name].attrs['ancillary_variables']
obj.qcfilter.update_ancillary_variable(var_name, qc_var_name)
print(obj[var_name].attrs['ancillary_variables'])