An intuitive, object-oriented and user-friendly Python implementation of a lumped conceptual HBV hydrological model for educational and research purposes.
Project description
HBV_Lab (Python implementation of a lumped conceptual HBV model)
HBV is a simple conceptual hydrological model that simulates the main hydrological processes related to snow, soil, groundwater, and routing [1]. There are many software packages and off-the-shelf products that implement different versions of it [2] [3].
I've been experimenting with the model lately and—in an endeavour to better understand the logic behind it—I decided to implement my own version—in Python, following an intuitive object-oriented programming approach.
This versioin implements the snow, soil, response and routing routines—controled by 14 calibratable parameters as shown below. In addition to calibration and uncertainty analysis modules.
parameters = {
'snow': ['TT', 'CFMAX', 'SFCF', 'CFR', 'CWH'],
'soil': ['FC', 'LP', 'BETA'],
'response': ['K0', 'K1', 'K2', 'UZL', 'PERC']
'routing' : [ 'MAXBAS'],
}
This can be flexibly used for different modelling tasks, but can also be used in a classroom setup—to explain hydrological concepts (processes, calibration, uncertainty analysis, etc.).
Get Started
Install the Package
pip install HBV_Lab or
! pip install HBV_Lab
How to Use
It is very intuitive—you create a model like an object which has attributes (data, parameters, initial conditions, etc.) that you can assign and access. The object also performs functions (calibration, uncertainty estimation, save, load, etc.)
from HBV_Lab import HBVModel
model = HBVModel()
model.load_data("pandas dataframe")
model.set_parameters(params)
model.run()
model.calibrate()
model.evaluate_uncertainity()
model.plot_results()
model.save_results()
model.save_model("path")
model.load_model("path")
Tutorial
Start by following a simple case study in the notebook: quick_start_guide.ipynb
Play with HBV
Get a feeling of how the model works and the role of the different parameters in HBVLAB—a playground that uses a model developed with this implementation.
References
[1] Bergström, S., & Forsman, A. (1973). Development of a conceptual deterministic rainfall-runoff model. Hydrology Research, 4, 147-170.
[2] Seibert, J., & Vis, M. J. P. (2012). Teaching hydrological modeling with a user-friendly catchment-runoff-model software package. Hydrology and Earth System Sciences, 16(9), 3315-3325. doi:10.5194/hess-16-3315-2012
[3] AghaKouchak, A., Nakhjiri, N., & Habib, E. (2013). An educational model for ensemble streamflow simulation and uncertainty analysis. Hydrology and Earth System Sciences, 17(2), 445-452. doi:10.5194/hess-17-445-2013
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hbv_lab-0.2.3.tar.gz.
File metadata
- Download URL: hbv_lab-0.2.3.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2eeb631168c6a4f997ed11a283896f1a187975b0958fd731d5072b794bd5043f
|
|
| MD5 |
a6f0308d8df80f957744d55d22097c80
|
|
| BLAKE2b-256 |
fb45ffee78d01ba108d345e93d0ea37107d0612443cf34f56e1f5ac52891fc95
|
File details
Details for the file hbv_lab-0.2.3-py3-none-any.whl.
File metadata
- Download URL: hbv_lab-0.2.3-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89f1eb4c2c69c0e18bf43977afb11c78778c7c303d27131b6d590babf5ecb145
|
|
| MD5 |
05d102d26709c2cabd681004e9bf3f3d
|
|
| BLAKE2b-256 |
b3f36d6903d00ba5cf3dc9bd1755a07ba9f33244b6493e025ebd31e98b29f5c3
|