climpred.smoothing.spatial_smoothing_xesmf

climpred.smoothing.spatial_smoothing_xesmf(ds, d_lon_lat_kws={'lat': 5, 'lon': 5}, method='bilinear', periodic=False, filename=None, reuse_weights=False, tsmooth_kws=None, how=None)[source]

Quick regridding function. Adapted from https://github.com/JiaweiZhuang/xESMF/pull/27/files#diff-b537ef68c98c2ec11e64e4803fe4a113R105.

Parameters
  • ds (xarray-object) – 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 (dict) – optional Longitude/Latitude step size (grid resolution); if not provided, lon will equal 5 and lat will equal lon (optional)

  • method (str) – Regridding method. Options are: - ‘bilinear’ - ‘conservative’, need grid corner information - ‘patch’ - ‘nearest_s2d’ - ‘nearest_d2s’

  • periodic (bool) – Periodic in longitude? Default to False. optional Only useful for global grids with non-conservative regridding. Will be forced to False for conservative regridding.

  • filename (str) –

    Name for the weight file. (optional) 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 (bool) – computing time. False by default. (optional)

  • tsmooth_kws (None) – leads nowhere but consistent with temporal_smoothing.

  • how (None) – leads nowhere but consistent with temporal_smoothing.

  • Returns – ds (xarray.object) regridded