diff --git a/wxee/xarray.py b/wxee/xarray.py index cdd2eea..c366b40 100644 --- a/wxee/xarray.py +++ b/wxee/xarray.py @@ -130,7 +130,7 @@ def normalize(self, stretch: float = 1.0) -> xr.DataArray: if stretch < 0 or stretch > 1: raise ValueError("Stretch value must be in the range [0.0, 1.0].") - min_val = da.quantile(1 - stretch) - max_val = da.quantile(stretch) + min_val = da.quantile(1 - stretch, dim=["x", "y", "variable"]) + max_val = da.quantile(stretch, dim=["x", "y", "variable"]) return ((da - min_val) / (max_val - min_val)).clip(0, 1)