From a2d8199db0cb85cd5b6e0f15d25bb2819db92748 Mon Sep 17 00:00:00 2001 From: terraputix Date: Tue, 14 Apr 2026 16:56:42 +0200 Subject: [PATCH 1/3] earthkit-geo instead of earthkit-regrid --- ...regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py b/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py index 00e7e71..a2208c7 100644 --- a/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py +++ b/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py @@ -6,7 +6,7 @@ # "omfiles[fsspec]>=1.1.2", # x-release-please-version # "matplotlib", # "cartopy", -# "earthkit-regrid==0.5.0", +# "earthkit-geo==1.0.0-rc", # ] # /// @@ -17,7 +17,7 @@ import fsspec import matplotlib.pyplot as plt import numpy as np -from earthkit.regrid import interpolate +from earthkit.geo.regrid.array import regrid from omfiles import OmFileReader MODEL_DOMAIN = "ecmwf_ifs" @@ -52,9 +52,8 @@ print(f"Data shape: {data.shape}") print(f"Data range: {np.nanmin(data)} to {np.nanmax(data)}") - # We are using earthkit-regrid for regridding: https://earthkit-regrid.readthedocs.io/en/stable/interpolate.html#interpolate - # with linear interpolation. Nearest neighbor interpolation can be obtained with`method="nearest-neighbour"` - regridded = interpolate(data, in_grid={"grid": "O1280"}, out_grid={"grid": [0.1, 0.1]}, method="linear") + # We are using earthkit-geo for regridding: https://earthkit-geo.readthedocs.io/en/latest/concepts/regridding/precomputed/regrid_array.html#precomputed-regrid-array + regridded, grid_spec = regrid(data, in_grid={"grid": "O1280"}, out_grid={"grid": [0.1, 0.1]}, backend="precomputed") print(f"Regridded shape: {regridded.shape}") # Create plot From 68b718cfd1ed724ecfbd66054d5efd7b05edc6ac Mon Sep 17 00:00:00 2001 From: terraputix Date: Tue, 14 Apr 2026 17:10:34 +0200 Subject: [PATCH 2/3] switch to latest release candidate --- examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py b/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py index a2208c7..ca44039 100644 --- a/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py +++ b/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py @@ -6,7 +6,7 @@ # "omfiles[fsspec]>=1.1.2", # x-release-please-version # "matplotlib", # "cartopy", -# "earthkit-geo==1.0.0-rc", +# "earthkit-geo==1.0.0rc2", # ] # /// From 877172222059378373e4b9a571d32f344a758528 Mon Sep 17 00:00:00 2001 From: terraputix Date: Mon, 4 May 2026 08:44:11 +0200 Subject: [PATCH 3/3] update import syntax --- .../regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py b/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py index 2a3b375..2b538a5 100644 --- a/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py +++ b/examples/regrid_ecmwf_ifs_hres_gaussian_O1280_to_0.1_degree.py @@ -6,7 +6,7 @@ # "omfiles[fsspec]>=1.2.0", # x-release-please-version # "matplotlib", # "cartopy", -# "earthkit-geo==1.0.0rc2", +# "earthkit-geo==1.0.0rc7", # ] # /// @@ -17,7 +17,7 @@ import fsspec import matplotlib.pyplot as plt import numpy as np -from earthkit.geo.regrid.array import regrid +from earthkit.geo.grids.array import regrid from omfiles import OmFileReader MODEL_DOMAIN = "ecmwf_ifs"