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.arm import read_arm_netcdf
ds = read_arm_netcdf(EXAMPLE_AOSMET)
var_name = 'temperature_ambient'
qc_var_name = ds.qcfilter.create_qc_variable(var_name)
del ds[var_name].attrs['ancillary_variables']
ds.qcfilter.update_ancillary_variable(var_name, qc_var_name)
print(ds[var_name].attrs['ancillary_variables'])