hydromt_delft3dfm.DFlowFMModel.setup_maps_from_raster_reclass#
- DFlowFMModel.setup_maps_from_raster_reclass(raster_fn: str, reclass_table_fn: str, reclass_variables: list, fill_method: str | None = None, reproject_method: str | None = 'nearest', interpolation_method: str | None = 'triangulation', locationtype: str | None = '2d', name: str | None = None, split_dataset: bool | None = True, **kwargs) None [source]#
Add data variable(s) to maps by reclassifying values from
raster_fn
.Reclassification is done bycombining values in
raster_mapping_fn
to spatial layerraster_fn
.The
mapping_variables
rasters are first created by mapping variables values fromraster_mapping_fn
to value in theraster_fn
grid.Adds model layers:
- mapping_variables maps: data from raster_mapping_fn spatially
distributed with raster_fn
- 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 mapping table of raster_fn in data_catalog. Make sure the data type is consistant for a
reclass_variables
including nodata. For example, for roughness, it is common that the data type is float, then use no data value as -999.0.reclass_variables (list) – List of mapping_variables from raster_mapping_fn table to add to mesh. Index column should match values in raster_fn. Available variables: [‘elevtn’, ‘waterlevel’, ‘waterdepth’, ‘pet’, ‘infiltcap’, ‘roughness_chezy’, ‘roughness_manning’, ‘roughness_walllawnikuradse’, ‘roughness_whitecolebrook’]
fill_method (str, optional) – If specified, fills no data values using fill_nodata method. Available methods are {‘linear’, ‘nearest’, ‘cubic’, ‘rio_idw’}.
reproject_method (str, optional) – CRS reprojection method from rasterio.enums.Resampling. By default nearest. Available methods: [‘nearest’, ‘bilinear’, ‘cubic’, ‘cubic_spline’, ‘lanczos’, ‘average’, ‘mode’, ‘gauss’, ‘max’, ‘min’, ‘med’, ‘q1’, ‘q3’, ‘sum’, ‘rms’]
interpolation_method (str, optional) – Interpolation method for DFlow-FM. By default triangulation. Except for waterlevel and waterdepth then the default is mean. When methods other than ‘triangulation’, the relative search cell size will be estimated based on resolution of the raster. Available methods: [‘triangulation’, ‘mean’, ‘nearestNb’, ‘max’, ‘min’, ‘invDist’, ‘minAbs’, ‘median’]
locationtype (str, optional) – LocationType in initial fields. Either 2d (default), 1d or all.
name (str, optional) – Variable name, only in case data is of type DataArray or if a Dataset is added as is (split_dataset=False).
split_dataset (bool, optional) – If data is a xarray.Dataset, either add it as is to maps or split it into several xarray.DataArrays. Default to True.