hydromt.DataArray.raster.interpolate_na#

DataArray.raster.interpolate_na(method: str = 'nearest', extrapolate: bool = False, **kwargs)#

Interpolate missing data.

Parameters:
  • method ({'linear', 'nearest', 'cubic', 'rio_idw'}, optional) – {‘linear’, ‘nearest’, ‘cubic’} use scipy.interpolate.griddata(); ‘rio_idw’ applies inverse distance weighting based on rasterio.fill.fillnodata(). Default is ‘nearest’.

  • extrapolate (bool, optional) – If True, extrapolate data at remaining nodata cells after interpolation based on nearest neighbor.

  • **kwargs – Additional key-word arguments are passed to rasterio.fill.fillnodata(), only used in combination with method=’rio_idw’

Returns:

Filled object

Return type:

xarray.DataArray