RainDataset.interpolate_to_grid¶
- RainDataset.interpolate_to_grid(storm, grid_res=0.1, method='linear', return_xarray=False)[source]¶
Interpolates storm rainfall data to a horizontal grid.
Interpolation is performed using Scipy’s scipy.interpolate.griddata() interpolation function.
- Parameters
storm (tropycal.tracks.Storm) – Instance of a Storm object.
grid_res (int or float) – Horizontal resolution of the desired grid in degrees. Default is 0.1 degrees.
method (str) – Method for interpolation to pass to scipy’s interpolation function. Default is “linear”.
return_xarray (bool) – If True, output is returned as an xarray DataArray with coordinates included. Default is false.
- Returns
dict or xarray.DataArray – If return_xarray is True, an xarray DataArray is returned. Otherwise, a dict including the grid lat, lon and grid values is returned.