xoa.cf.SGLocator.format_dataarray

SGLocator.format_dataarray(da, loc=None, standardize=True, name=None, attrs=None, rename=True, copy=True, replace_attrs=False, add_loc_to_name=True, add_loc_to_attrs=True)[source]

Format name and attributes of a copy of DataArray

Parameters:
  • da (xarray.DataArray) –

  • loc ({True, None}, str, {False, ""}) – If None, location is left unchanged; if a string, it is set; else, it is removed.

  • standardize (bool) – If True, standardize root and loc values.

  • name (str, None) – Substitute for data array name

  • attrs (str, None) – Substitute for dataarray attributes. If standard_name and long_name values are a list, and if the dataarray has its attribute included in the list, it is left unchanged since it is considered compatible.

  • rename – Allow renaming the array if its name is already set

  • add_loc_to_name (bool) – Add the location to the name

  • replace_attrs (bool) – Replace existing attributes?

  • copy (bool) – Make sure to work on a copy

Returns:

xarray.DataArray