hydromt.MeshModel.setup_maps_from_rasterdataset#

MeshModel.setup_maps_from_rasterdataset(raster_fn: str | Path | Dataset, variables: List | None = None, fill_method: str | None = None, name: str | None = None, reproject_method: str | None = None, split_dataset: bool | None = True, rename: Dict | None = None) List[str]#

HYDROMT CORE METHOD: Add data variable(s) from raster_fn to maps object.

If raster is a dataset, all variables will be added unless variables list is specified.

Adds model layers:

  • raster.name maps: data from raster_fn

Parameters:
  • raster_fn (str, Path, xr.Dataset) – Data catalog key, path to raster file or raster xarray data object.

  • variables (list, optional) – List of variables to add to maps from raster_fn. By default all.

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

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

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

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

  • rename (dict, optional) – Dictionary to rename variable names in raster_fn before adding to maps {‘name_in_raster_fn’: ‘name_in_maps’}. By default empty.

Returns:

Names of added model map layers

Return type:

list