act.qc.CleanDataset.cleanup#

CleanDataset.cleanup(cleanup_arm_qc=True, clean_arm_state_vars=None, handle_missing_value=True, link_qc_variables=True, normalize_assessment=False, cleanup_cf_qc=True, cleanup_incorrect_qc_attributes=True, **kwargs)[source]#

Wrapper method to automatically call all the standard methods for dataset cleanup.

Parameters:
  • cleanup_arm_qc (bool) – Option to clean Xarray dataset from ARM QC to CF QC standards.

  • clean_arm_state_vars (list of str) – Option to clean Xarray dataset state variables from ARM to CF standards. Pass in list of variable names.

  • handle_missing_value (bool) – Go through variables and look for cases where a QC or state varible was convereted to a float and missing values set to np.nan. This is done because of xarry’s default to use mask_and_scale=True. This will convert the data type back to integer and replace any instances of np.nan to a missing value indicator (most likely -9999).

  • link_qc_variables (bool) – Option to link QC variablers through ancillary_variables if not already set.

  • normalize_assessment (bool) – Option to clean up assessments to use the same terminology. Set to False for default because should only be an issue after adding DQRs and the function to add DQRs calls this method.

  • cleanup_incorrect_qc_attributes (bool) – Fix incorrectly named quality control variable attributes before converting to standardized QC.

  • **kwargs (keywords) – Keyword arguments passed through to clean.clean_arm_qc method.

Examples

files = act.tests.sample_files.EXAMPLE_MET1
ds = act.io.arm.read_arm_netcdf(files)
ds.clean.cleanup()