hydromt_wflow.utils.get_grid_from_config#
- hydromt_wflow.utils.get_grid_from_config(var_name: str, config: Dict = {}, grid: Dataset | None = None, root: Path | None = None, abs_path: bool = False, nodata: int | float = -9999, mask_name: str | None = None) DataArray [source]#
Get actual grid values from config including scale and offset.
Calls get_config and applies value, scale and offset if available.
- Parameters:
var_name (string) – Wflow variable name to get from config. Input, static and cyclic will be deduced. Eg ‘land_surface__slope’.
config (dict) – config dict to get the values from.
grid (xr.Dataset) – grid dataset to get the values from.
abs_path (bool, optional) – If True return the absolute path relative to the model root, by default False.
nodata (int or float, optional) – nodata value to use for the DataArray, by default -9999. Used only if the variable in config is described using value only.
mask_name (str, optional) – Name of the mask variable in grid. Used only if the variable in config is described using value only.
- Returns:
da – DataArray with actual grid values
- Return type:
xr.DataArray
See also
get_config
,hydromt.workflows.grid.grid_from_constant