使用 xarray 插入一个 netCDF 以匹配另一个 netCDF 的分辨率

Use xarray to interpolate one netCDF to match resolution of another netCDF

我有 2 个不同分辨率的 netCDF(一个是 1 度,另一个是 0.25 度)。如何使用一些 xarray 插值方法将 1 度 netCDF 的分辨率转换为 0.25 度(我不想用 NaN 填充)。我查看了使用 interp_like,但它似乎使用 NaN 进行填充。

你应该使用 xESMF for Python and xarray, it is really simple. The function regridder is what you are looking for (see also this example on the website). To give you another example, this is a blog post 我之前写的,你可能会觉得有用。