hydromt_wflow.WflowSedimentModel#
- class WflowSedimentModel(root: str | None = None, config_filename: str | None = None, mode: str = 'w', data_libs: list | str = [], **catalog_keys)[source]#
The wflow sediment model class, a subclass of WflowBaseModel.
- __init__(root: str | None = None, config_filename: str | None = None, mode: str = 'w', data_libs: list | str = [], **catalog_keys)[source]#
Initialize a model.
- Parameters:
root (str, Path, optional) – Model root, by default the current working directory:
Path.cwd()components (Dict[str, Any], optional) –
Dictionary of components to add to the model, by default None Every entry in this dictionary contains the name of the component as key, and the component object as value, or a dictionary with options passed to the component initializers. If a component is a dictionary, the key ‘type’ should be provided with the name of the component type.
{ "grid": { "type": "GridComponent", "filename": "path/to/grid.nc" } }
mode ({'r','r+','w'}, optional) – read/append/write mode, by default “w”
data_libs (List[str], optional) – List of data catalog configuration files, by default None
region_component (str, optional) – The name of the region component in the components dictionary. If None, the model will can automatically determine the region component if there is only one SpatialModelComponent. Otherwise it will raise an error. If there are no SpatialModelComponent it will raise a warning that region functionality will not work.
**catalog_keys – Additional keyword arguments to be passed down to the DataCatalog.
Methods
__init__([root, config_filename, mode, ...])Initialize a model.
add_component(name, component)Add a component to the model.
build(*[, write])Single method to build a model from scratch based on settings in steps.
clip(region[, inverse_clip, clip_forcing, ...])Clip model to region.
close()Close all components by closing their open files.
from_dict(model_dict)Construct a model with the components and other init arguments in the yaml file located at path.
from_yml(path)Construct a model with the components and other init arguments in the yaml file located at path.
get_component(name)Get a component from the model.
read([config_filename, geoms_folder])Read components from disk.
read_outputs()Read outputs at <root/dir_output>.
set_flwdir([ftype])Parse pyflwdir.FlwdirRaster object parsed from the wflow ldd.
set_states(data[, name])Add data to states.
setup_areamap(area_fn, col2raster[, nodata, ...])Set area map from vector data to save wflow outputs for specific area.
setup_basemaps(region, hydrography_fn[, ...])Build the DEM and flow direction for a Wflow model.
setup_canopymaps(canopy_fn[, output_name])Generate sediments based canopy height maps.
setup_config(data)Set the config dictionary at key(s) with values.
setup_config_output_timeseries(mapname[, ...])Set the default gauge map based on basin outlets.
setup_constant_pars(**kwargs)Generate constant parameter maps for all active model cells.
setup_gauges(gauges_fn[, index_col, ...])Set a gauge map based on
gauges_fndata.setup_grid_from_raster(raster_fn, ...[, ...])Add data variable(s) from
raster_fnto grid object.setup_lulcmaps(lulc_fn, *[, ...])Derive several wflow maps based on landuse-landcover (LULC) data.
setup_lulcmaps_from_vector(lulc_fn, *[, ...])Derive several wflow maps based on vector landuse-landcover (LULC) data.
setup_natural_reservoirs(reservoirs_fn[, ...])Generate maps of natural reservoir areas (lakes) and outlets.
setup_outlets([river_only, toml_output, ...])Set the default gauge map based on basin outlets.
setup_reservoirs(reservoirs_fn[, ...])Generate maps of reservoir areas and outlets.
setup_riverbedsed([bedsed_mapping_fn, ...])Generate sediments based river bed characteristics maps.
setup_rivers(hydrography_fn[, ...])Set all river parameter maps.
setup_riverwidth([predictor, fill, fit, ...])Set the river width parameter based on power-law relationship with a predictor.
setup_soilmaps([soil_fn, usle_k_method, ...])Generate sediments based soil parameter maps.
test_equal(other)Test if two models are equal, based on their components.
update(*[, model_out, write, steps, ...])Single method to update a model based the settings in steps.
upgrade_to_v1_wflow([soil_fn, ...])Upgrade the model to wflow v1 format.
write([config_filename, grid_filename, ...])Write the complete model schematization and configuration to file.
write_data_catalog([root, data_lib_path, ...])Write the data catalog to data_lib_path.
Attributes
basinsReturns a basin(s) geometry as a geopandas.GeoDataFrame.
basins_highresReturns a high resolution basin(s) geometry.
configReturn the config component.
crsReturns coordinate reference system embedded in region.
flwdirReturn the pyflwdir.FlwdirRaster object parsed from wflow ldd.
forcingReturn the forcing component.
geomsReturn the geoms component.
nameoutput_csvReturn the WflowOutputCsvComponent instance.
output_gridReturn the WflowOutputGridComponent instance.
output_scalarReturn the WflowOutputScalarComponent instance.
regionReturn the model's region component.
riversReturn a river geometry as a geopandas.GeoDataFrame.
statesReturn the states component.
staticmapsReturn the staticmaps component.
tablesReturn the WflowTablesComponent instance.
data_catalogDataCatalog for data access
rootModel root