xoa.cf.CFVarSpecs.rename_dataarray

CFVarSpecs.rename_dataarray(da, name=None, specialize=False, loc=None, standardize=True, rename_dim=True, copy=True, add_loc_to_name=None)

Rename a DataArray

It is a specialized call to format_dataarray() where attributes are left unchanged.

Parameters:
  • da (xarray.DataArray) –

  • name (str, None) – A CF name. If not provided, it guessed with match().

  • specialize (bool) – Does not use the CF name for renaming, but the first name as listed in specs, which is generally a specialized one, like a name adopted by specialized dataset.

  • loc (str, {"any", None}, {"", False}) –

    • str: one of these locations

    • None or “any”: any

    • False or ‘””: no location

  • standardize (bool) –

  • rename_dim (bool) – For a 1D array, rename the dimension if it has the same name as the array. Note that it is set to False, if rename is False.

  • copy (bool) – Force a copy (not of the data) in any case?

See also

format_dataarray