xoa.coords.copy_coord_attrs#
- xoa.coords.copy_coord_attrs(da, ref)[source]#
Copy the attributes of the coordinates of a reference to those of an array
This is useful after
xarray.apply_ufunc(), which drops the attributes of the coordinates, like thestandard_namethat is needed to find the longitudes and latitudes.- Parameters:
da (xarray.DataArray, xarray.Dataset) – Object whose coordinates are updated in place
ref (xarray.DataArray, xarray.Dataset) – Object whose coordinate attributes are copied, for the coordinates they share
- Returns:
xarray.DataArray, xarray.Dataset – The same object as da