imod.mf6.StructuredDiscretization.regrid_like#
- StructuredDiscretization.regrid_like(target_grid: DataArray | UgridDataArray, regrid_cache: RegridderWeightsCache, regridder_types: RegridMethodType | None = None) StructuredDiscretization | VerticesDiscretization [source]#
Regrid discretization package. Creates a StructuredDiscretization, or VerticesDiscretization package, based on type of target_grid. It regrids all the arrays in this package to the desired discretization, and leaves the options unmodified.
The default regridding methods are specified in the
_regrid_method
attribute of the package. These defaults can be overridden using the input parameters of this function.- Parameters:
target_grid (xr.DataArray or xu.UgridDataArray) – a grid defined using the same discretization as the one we want to regrid the package to.
regrid_cache (RegridderWeightsCache, optional) – stores regridder weights for different regridders. Can be used to speed up regridding, if the same regridders are used several times for regridding different arrays.
regridder_types (RegridMethodType, optional) – dictionary mapping arraynames (str) to a tuple of regrid type (a specialization class of BaseRegridder) and function name (str) this dictionary can be used to override the default mapping method.
- Returns:
Depending on type of target_grid. A package with the same options as this package, and with all the data-arrays regridded to another discretization, similar to the one used in input argument “target_grid”
- Return type: