δHRH: Hydrological and hydraulic model calibration using SWOT
Authors/Creators
Description
This repository contains the code accompanying the research paper "Hydrological and hydraulic model calibration using SWOT - a framework using coupled differentiable modeling" by Köhn et al. (under review). It provides a joint differentiable hydrological, router and hydraulics model (δHRH) together with the notebooks to train and evaluate it.
The data used in the publication are archived in a separate record: https://doi.org/10.5281/zenodo.24298805. They are not part of this record. Below is a short introduction to using the code; for more detail see the README.
Contents
code/: Python modules and the Jupyter notebooks __publication_training.ipynb and __publication_results.ipynb
LICENSE README.md, THIRD_PARTY_NOTICES.md: licence terms, documentation and attributions
Python environment
No dependencies are distributed with this repository. The required packages are listed in environment.yml and can be installed with conda (Miniconda or Anaconda):
conda env create -f environment.yml,
then conda activate hybrid_ai.
The environment installs a CPU build of PyTorch. For a GPU build, replace the torch line in environment.yml following https://pytorch.org/get-started/locally/.
Model training and evaluation
Training and evaluation are done by following the supplied Jupyter notebooks: __publication_training.ipynb to train a model and __publication_results.ipynb to evaluate it. Both notebooks expect the associated data and trained models, which are available from the data record above, to be downloaded and unpacked into the folders data and trained_models next to the code folder. Path variables should work out of the box on Windows, where they were set up using backslash separators; on Linux or macOS replace them with forward slashes or build the paths with pathlib.
Licence and attribution
see LICENCE file.