act.utils.ChangeUnits.change_units#
- ChangeUnits.change_units(variables=None, desired_unit=None, skip_variables=None, skip_standard=True, verbose=False, raise_error=False)[source]#
- Parameters:
variables (None, str or list of str) – Variable names to attempt to change units.
desired_unit (str) – Desired udunits unit string.
skip_variables (None, str or list of str) – Variable names to skip. Works well when not providing a variables keyword.
skip_standard (boolean) – Flag indicating the QC variables that will not need changing are skipped. Makes the processing faster when processing all variables in dataset.
verbose (boolean) – Option to print statement when an attempted conversion fails. Set to False as default because many units strings are not udunits complient and when trying to convert all varialbes of a type of units (eg temperature) the code can print a lot of unecessary information.
raise_error (boolean) – Raise an error if conversion is not successful.
- Returns:
dataset (xarray.dataset) – A new dataset if the coordinate variables are updated. Required to use returned dataset if coordinage variabels are updated, otherwise the dataset is updated in place.