diff --git a/uxarray/core/dataarray.py b/uxarray/core/dataarray.py index 7d980a60d..f01caa3b1 100644 --- a/uxarray/core/dataarray.py +++ b/uxarray/core/dataarray.py @@ -745,10 +745,19 @@ def zonal_mean(self, lat=(-90, 90, 10), conservative: bool = False, **kwargs): dims = list(self.dims) dims[face_axis] = "latitudes" + # Assign coords from `self` to the result except one that corresponds to `dims[face_axis]` + new_coords = { + k: v + for k, v in self.coords.items() + if self.dims[face_axis] not in v.dims + } + # Add latitudes to the resulting coords + new_coords["latitudes"] = centers + return xr.DataArray( res, dims=dims, - coords={"latitudes": centers}, + coords=new_coords, name=self.name + "_zonal_mean" if self.name is not None else "zonal_mean",