hydromt.MeshModel#
- class hydromt.MeshModel(root: str | None = None, mode: str = 'w', config_fn: str | None = None, data_libs: ~typing.List[str] | None = None, logger=<Logger hydromt.models.model_mesh (WARNING)>)[source]#
Model class Mesh Model for mesh models in HydroMT.
Initialize a MeshModel for distributed models with an unstructured grid.
- __init__(root: str | None = None, mode: str = 'w', config_fn: str | None = None, data_libs: ~typing.List[str] | None = None, logger=<Logger hydromt.models.model_mesh (WARNING)>)[source]#
Initialize a MeshModel for distributed models with an unstructured grid.
Methods
__init__([root, mode, config_fn, data_libs, ...])Initialize a MeshModel for distributed models with an unstructured grid.
build([region, write, opt])Single method to build a model from scratch based on settings in opt.
get_config(*args[, fallback, abs_path])Get a config value at key(s).
read([components])Read the complete model schematization and configuration from model files.
read_config([config_fn])Parse config from file.
read_forcing([fn])Read forcing at <root>/<fn> and add to forcing property.
read_geoms([fn])Read model geometries files at <root>/<fn> and add to geoms property.
read_maps([fn])Read model map at <root>/<fn> and add to maps component.
read_mesh([fn])Read model mesh data at <root>/<fn> and add to mesh property.
read_results([fn])Read results at <root>/<fn> and add to results property.
read_states([fn])Read states at <root>/<fn> and add to states property.
read_staticgeoms()Read gemoetries from disk.
read_staticmaps([fn])Read static model maps at <root>/<fn> and add to staticmaps property.
set_config(*args)Update the config dictionary at key(s) with values.
set_crs(crs)Set the coordinate reference system.
set_forcing(data[, name, split_dataset])Add data to forcing attribute.
set_geoms(geom, name)Add data to the geoms attribute.
set_maps(data[, name, split_dataset])Add raster data to the maps component.
set_mesh(data[, name])Add data to mesh.
set_results(data[, name, split_dataset])Add data to results attribute.
set_root(root[, mode])Initialize the model root.
set_states(data[, name, split_dataset])Add data to states attribute.
set_staticgeoms(geom, name)Set the geometries.
set_staticmaps(data[, name])Add data to staticmaps.
setup_basemaps(*args, **kwargs)setup_config(**cfdict)Update config with a dictionary.
setup_maps_from_raster_reclass(raster_fn, ...)HYDROMT CORE METHOD: Add data variable(s) to maps object by reclassifying the data in
raster_fnbased onreclass_table_fn.setup_maps_from_rasterdataset(raster_fn[, ...])HYDROMT CORE METHOD: Add data variable(s) from
raster_fnto maps object.setup_mesh(region[, res, crs])HYDROMT CORE METHOD: Create an 2D unstructured mesh or reads an existing 2D mesh according UGRID conventions.
setup_mesh_from_raster_reclass(raster_fn, ...)HYDROMT CORE METHOD: Add data variable(s) to mesh object by reclassifying the data in
raster_fnbased onreclass_table_fn.setup_mesh_from_rasterdataset(raster_fn[, ...])HYDROMT CORE METHOD: Add data variable(s) from
raster_fnto mesh object.setup_region(region[, hydrography_fn, ...])Set the region of interest of the model.
test_model_api()Test compliance with HydroMT Model API.
update([model_out, write, opt])Single method to update a model based the settings in opt.
write([components])Write the complete model schematization and configuration to model files.
write_config([config_name, config_root])Write config to <root/config_fn>.
write_data_catalog([root, data_lib_fn, ...])Write the data catalog to data_lib_fn.
write_forcing([fn])Write forcing to netcdf file at <root>/<fn>.
write_geoms([fn])Write model geometries to a vector file (by default GeoJSON) at <root>/<fn>.
write_maps([fn])Write maps to netcdf file at <root>/<fn>.
write_mesh([fn])Write model grid data to a netCDF file at <root>/<fn>.
write_states([fn])Write states to netcdf file at <root>/<fn>.
write_staticgeoms()Write the geometries to disk.
write_staticmaps([fn])Write static model maps to netcdf file at <root>/<fn>.
Attributes
apiReturn all model components and their data types.
boundsReturns model mesh bounds.
configModel configuration.
coordsReturns the coordinates of model staticmaps.
Returns coordinate reference system embedded in region.
dimsReturns spatial dimension names of staticmaps.
forcingModel forcing.
geomsModel geometries.
heightReturns the height of the model staticmaps.
mapsModel maps.
Model static mesh data.
mesh_gdfReturns geometry of mesh as a gpd.GeoDataFrame.
Returns geometry of region of the model area of interest.
resReturns the resolution of the model staticmaps.
resultsModel results.
rootPath to model folder.
shapeReturns the shape of the model staticmaps.
statesModel states.
staticgeomsAccess the geometryes.
staticmapsModel static maps.
transformReturns the geospatial transform of the model staticmaps.
widthReturns the width of the model staticmaps.