hydromt_wflow.utils.get_grid_from_config#

hydromt_wflow.utils.get_grid_from_config(*args, config: Dict = {}, grid: Dataset = None, fallback=None, root: Path = None, abs_path: bool | None = 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:
  • args (tuple or string) – keys can given by multiple args: (‘key1’, ‘key2’) or a string with ‘.’ indicating a new level: (‘key1.key2’)

  • config (dict) – config dict to get the values from.

  • grid (xr.Dataset) – grid dataset to get the values from.

  • fallback (any, optional) – fallback value if key(s) not found in config, by default None.

  • 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