climpred.smoothing.spatial_smoothing_xesmf

climpred.smoothing.spatial_smoothing_xesmf(ds: xarray.Dataset, d_lon_lat_kws: Dict[str, float] = {'lat': 5, 'lon': 5}, method: str = 'bilinear', periodic: bool = False, filename: Union[None, str] = None, reuse_weights: bool = False, tsmooth_kws: Optional[Dict[str, int]] = None, how: Union[None, str] = None) xarray.Dataset[source]

Quick regridding function.

Adapted from https://github.com/JiaweiZhuang/xESMF/pull/27/files#diff-b537ef68c98c2ec11e64e4803fe4a113R105. # noqa: E501

Parameters
  • ds – Contain input and output grid coordinates. Look for coordinates lon, lat, and optionally lon_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