Skip to content

Commit

Permalink
Update coord attrs in _update_metadata_increased_resolution()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
johnomotani committed Jul 30, 2020
1 parent ff1bc30 commit 66b286a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xbout/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 66b286a

Please sign in to comment.