From 66b286a84da16cf2d7bedd39553b4496a7071a44 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Thu, 30 Jul 2020 20:08:06 +0100 Subject: [PATCH] Update coord attrs in _update_metadata_increased_resolution() The coordinates of a DataArray that has been interpolated will have attrs that are not consistent with the new DataArray. This commit updates _update_metadata_increased_resolution() to also replace the attrs of the DataArray's coords with the attrs of the new DataArray. --- xbout/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xbout/utils.py b/xbout/utils.py index 59960b4e..d190b460 100644 --- a/xbout/utils.py +++ b/xbout/utils.py @@ -87,4 +87,9 @@ def update_ny(name): update_ny('ny_inner') update_ny('MYSUB') + # Update attrs of coordinates to be consistent with da + for coord in da.coords: + da[coord].attrs = {} + _add_attrs_to_var(da, coord) + return da