climpred.smoothing.spatial_smoothing_xesmf#
- climpred.smoothing.spatial_smoothing_xesmf(ds: Dataset, d_lon_lat_kws: Dict[str, float] = {'lat': 5, 'lon': 5}, method: str = 'bilinear', periodic: bool = False, filename: None | str = None, reuse_weights: bool = False, tsmooth_kws: Dict[str, int] | None = None, how: None | str = None) Dataset [source]#
Quick regridding function.
Adapted from JiaweiZhuang/xESMF#files. # noqa: E501
- Parameters:
ds – Contain input and output grid coordinates. Look for coordinates
lon
,lat
, and optionallylon_b
,lat_b
for conservative method. Also any coordinate which is C/F compliant, .i.e. standard_name in [“longitude”, “latitude”] is allowed. Shape can be 1D (Nlon,) and (Nlat,) for rectilinear grids, or 2D (Ny, Nx) for general curvilinear grids. Shape of bounds should be (N+1,) or (Ny+1, Nx+1).d_lon_lat_kws – Longitude/Latitude step size (grid resolution); if not provided, lon will equal 5 and lat will equal lon
method – Regridding method. Options are:
“bilinear”
“conservative”, requires grid corner information
“patch”
“nearest_s2d”
“nearest_d2s”
periodic – Periodic in longitude? Defaults to
False
. Only useful for global grids with non-conservative regridding. Will be forced to False for conservative regridding.filename – Name for the weight file. The default naming scheme is “{method}_{Ny_in}x{Nx_in}_{Ny_out}x{Nx_out}.nc” e.g. “bilinear_400x600_300x400.nc”
reuse_weights – Whether to read existing weight file to save computing time. Defaults to
False
.tsmooth_kws – leads nowhere but consistent with
temporal_smoothing
.how – leads nowhere but consistent with
temporal_smoothing
.
- Returns:
regridded