diff --git a/CHANGELOG.md b/CHANGELOG.md index 1515b3a..cde0f8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Forecast bias adjustment failing when forecast extends into new year. ([@brews](https://github.com/brews), [PR#31](https://github.com/ClimateImpactLab/poreallas/pull/31)) +- GMFD extreme value cleaning moved so applies to all subsequent steps, not just ERA5 bias adjustment. ([@brews](https://github.com/brews), [PR#17](https://github.com/ClimateImpactLab/poreallas/pull/28)) + ## [0.5.0] - 2026-08-24 ### Changed diff --git a/scripts/01-parse_gmfd.py b/scripts/01-parse_gmfd.py index 9fd8511..f004910 100644 --- a/scripts/01-parse_gmfd.py +++ b/scripts/01-parse_gmfd.py @@ -73,9 +73,13 @@ def open_gmfd(file_pattern: str, start_year: int, stop_year: int) -> xr.Dataset: start_year=START_YEAR, stop_year=STOP_YEAR, ) + # Cannot have leap years in QDM bias adjustment. gmfd = gmfd.convert_calendar("noleap", dim="time") +# Fill extreme values +gmfd = gmfd.where(gmfd["tas"] < 1000).interpolate_na(dim="lat", method="linear") + regridder = xe.Regridder(gmfd, regrid_target, method="bilinear", periodic=True) gmfd_regrid = regridder(gmfd) gmfd_regrid.attrs |= gmfd.attrs diff --git a/scripts/02-bias_adjust_era5.py b/scripts/02-bias_adjust_era5.py index ee2448c..e181127 100644 --- a/scripts/02-bias_adjust_era5.py +++ b/scripts/02-bias_adjust_era5.py @@ -27,13 +27,6 @@ chunks={}, backend_kwargs={"storage_options": {"token": "anon"}}, ) -# Fill extreme values -gmfd = gmfd.sortby("latitude").chunk({"latitude": -1, "longitude": 30, "time": -1}) -gmfd = ( - gmfd.where(gmfd["tas"] < 1000) - .interpolate_na(dim="latitude", method="linear") - .compute() -) era5 = xr.open_dataset( ERA5_URI,