polartoolkit.resample_grid#
- resample_grid(grid, spacing=None, region=None, registration=None, **kwargs)[source]#
Resample a grid to a new spacing, region, and/or registration. Method of resampling depends on comparison with initial and supplied values for spacing, region, and registration. If initial values not supplied, will try and extract them from the grid.
- Parameters:
grid (
DataArray) â grid to resamplespacing (
float|None) â new spacing for grid, by default Noneregion (
tuple[float,float,float,float] |None) â new region for grid in format [xmin, xmax, ymin, ymax], by default Noneregistration (
str|None) â new registration for grid, by default None
- Returns:
grid, either resampled or same as original depending on inputs. If no resampling, and supplied grid is a filepath, returns filepath.
- Return type: