hydromt.GridModel.setup_maps_from_raster_reclass#

GridModel.setup_maps_from_raster_reclass(raster_fn: str, reclass_table_fn: str, reclass_variables: List, variable: str | None = None, fill_method: str | None = None, reproject_method: str | None = None, name: str | None = None, split_dataset: bool | None = True, **kwargs) List[str]#

This component adds data variable(s) to maps object by reclassifying the data in raster_fn based on reclass_table_fn.

Adds model layers:

  • reclass_variables maps: reclassified raster data

Parameters:
  • raster_fn (str) – Source name of raster data in data_catalog. Should be a DataArray. Else use **kwargs to select variables/time_tuple in hydromt.data_catalog.get_rasterdataset() method.

  • reclass_table_fn (str) – Source name of reclassification table of raster_fn in data_catalog.

  • reclass_variables (list) – List of reclass_variables from reclass_table_fn table to add to maps. Index column should match values in raster_fn.

  • variable (str, optional) – Name of raster dataset variable to use. This is only required when reading datasets with multiple variables. By default None.

  • fill_method (str, optional) – If specified, fills nodata values in raster_fn using fill_nodata method before reclassifying. Available methods are {‘linear’, ‘nearest’, ‘cubic’, ‘rio_idw’}.

  • reproject_method (str, optional) – See rasterio.warp.reproject for existing methods, by default the data is not reprojected (None).

  • name (str, optional) – Name of new maps variable, only in case split_dataset=False.

  • split_dataset (bool, optional) – If data is a xarray.Dataset split it into several xarray.DataArrays (default).

Returns:

Names of added model map layers

Return type:

list