How mhm-ufz/mhm-tools works
mHM-Tools is a command-line and Python toolbox for preparing mHM inputs and evaluating model outputs. Its principal workflow is to build or adapt catchment/setup data, prepare forcings and restart-related files, then assess runs against discharge and gridded observations. The graph preserves the documented capability branches and the sampled evaluation and shared-data layers. Evidence is limited to the README and SOURCE INDEX references; unverified command-to-implementation links are dashed.
Main entry points: _cli CLI commands · gridded_data_evaluation.py Gridded evaluation · file_handler.py Raster and file I/O · discharge_evaluation.py Discharge evaluation
Components 24
User interface
- mhm-tools CLI
src/mhm_tools/_cli/_main.py - CLI commands
src/mhm_tools/_cli
Setup preparation
- Catchment delineation
src/mhm_tools/pre/catchment.py - Setup and restart tools
src/mhm_tools/pre - Forcing preparation
src/mhm_tools/pre/prepare_mhm_forcings.py - Input data formatting
src/mhm_tools/pre
Run evaluation
- Discharge evaluation
src/mhm_tools/post/discharge_evaluation.py - Gridded evaluation
src/mhm_tools/post/gridded_data_evaluation.py - Snow evaluation
src/mhm_tools/post/snow_evaluation.py - Water storage evaluation
src/mhm_tools/post/twsa_evaluation.py - Discharge comparison
src/mhm_tools/post/discharge_eval_comparison.py
Shared data services
- Raster and file I/O
src/mhm_tools/common/file_handler.py - NetCDF utilities
src/mhm_tools/common/netcdf.py - Xarray utilities
src/mhm_tools/common/xarray_utils.py - Grid resolution
src/mhm_tools/common/resolution_handler.py - Metric dispatch
src/mhm_tools/common/metrics/metrics_handler.py - SPAEF metric
src/mhm_tools/common/metrics/spaef.py - Plotting utilities
src/mhm_tools/common/plotter.py - Time utilities
src/mhm_tools/common/time_utils.py - Parallel helpers
src/mhm_tools/common/parallel.py - ESRI grid support
src/mhm_tools/common/esri_grid.py - Logging
src/mhm_tools/common/logger.py - Unit conversions
src/mhm_tools/common/units.py
Other components
- Hydrology user
Connections 32
- Hydrology user → mhm-tools CLI: invokes
- mhm-tools CLI → CLI commands: dispatches
- CLI commands → Catchment delineation: runs delineation
- CLI commands → Setup and restart tools: runs setup tools
src/mhm_tools/_cli/_create_catchment.py - CLI commands → Forcing preparation: runs preparation
- CLI commands → Input data formatting: runs formatting
src/mhm_tools/_cli/_create_catchment.py - CLI commands → Discharge evaluation: runs evaluation
- CLI commands → Gridded evaluation: runs evaluation
src/mhm_tools/_cli/_gridded_data_evaluation.py - CLI commands → Snow evaluation: runs evaluation
- CLI commands → Water storage evaluation: runs evaluation
- Catchment delineation → Raster and file I/O: uses file helpers
src/mhm_tools/pre/catchment.py - Catchment delineation → Grid resolution: uses grid resolution
src/mhm_tools/pre/catchment.py - Catchment delineation → Xarray utilities: uses dataset helpers
src/mhm_tools/pre/catchment.py - Setup and restart tools → Raster and file I/O: reads and writes
src/mhm_tools/pre/create_mhm_restart_from_setup.py - Setup and restart tools → Grid resolution: uses grid resolution
src/mhm_tools/pre/create_mhm_restart_from_setup.py - Setup and restart tools → Xarray utilities: uses dataset helpers
src/mhm_tools/pre/create_mhm_restart_from_setup.py - Discharge evaluation → Gridded evaluation: uses evaluation
src/mhm_tools/post/discharge_evaluation.py - Discharge evaluation → Raster and file I/O: uses file helpers
src/mhm_tools/post/discharge_evaluation.py - Discharge evaluation → Plotting utilities: uses plots
src/mhm_tools/post/discharge_evaluation.py - Discharge evaluation → Xarray utilities: uses dataset helpers
src/mhm_tools/post/discharge_evaluation.py - Gridded evaluation → Metric dispatch: calculates metrics
src/mhm_tools/post/gridded_data_evaluation.py - Gridded evaluation → Plotting utilities: creates plots
src/mhm_tools/post/gridded_data_evaluation.py - Gridded evaluation → Raster and file I/O: uses file helpers
src/mhm_tools/post/gridded_data_evaluation.py - Gridded evaluation → Time utilities: uses time helpers
src/mhm_tools/post/gridded_data_evaluation.py - Snow evaluation → Gridded evaluation: uses evaluation
src/mhm_tools/post/snow_evaluation.py - Water storage evaluation → Gridded evaluation: uses evaluation
src/mhm_tools/post/twsa_evaluation.py - Metric dispatch → SPAEF metric: calculates SPAEF
src/mhm_tools/common/metrics/metrics_handler.py - Raster and file I/O → NetCDF utilities: uses NetCDF helpers
src/mhm_tools/common/file_handler.py - Raster and file I/O → Xarray utilities: uses dataset helpers
src/mhm_tools/common/file_handler.py - Raster and file I/O → ESRI grid support: uses grid helpers
src/mhm_tools/common/file_handler.py - Grid resolution → Raster and file I/O: reads grid files
src/mhm_tools/common/resolution_handler.py - Grid resolution → Xarray utilities: uses coordinate helpers
src/mhm_tools/common/resolution_handler.py