Skip to main content

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

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 HBV model work and the role of the different parameters in HBVLAB (which uses a model developed with this HBV 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. and Vis, M. J. P.: Teaching hydrological modeling with a user-friendly catchment-runoff-model software package, Hydrol. Earth Syst. Sci., 16, 3315–3325, https://doi.org/10.5194/hess-16-3315-2012, 2012.

[3] AghaKouchak, A., Nakhjiri, N., and Habib, E.: An educational model for ensemble streamflow simulation and uncertainty analysis, Hydrol. Earth Syst. Sci., 17, 445–452, https://doi.org/10.5194/hess-17-445-2013, 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

hbv_lab-0.1.0.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hbv_lab-0.1.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file hbv_lab-0.1.0.tar.gz.

File metadata

  • Download URL: hbv_lab-0.1.0.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for hbv_lab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d49f9d2070fc23f9d2ddde71ed27925f80468056d2603e554cc09944c5b92875
MD5 71fb7d97b5cf3dd235d2ae245e095627
BLAKE2b-256 757d558ce0e2cfe92f47b45834e25cf6eb4ba4cc7dcd52a75df0262b9fbc86c3

See more details on using hashes here.

File details

Details for the file hbv_lab-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hbv_lab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for hbv_lab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1afc89df29e82ef69971c000a6d66826cff3bb70d9595f6ec1bc04fc46a33925
MD5 9b7006880ab86a005c355580816ccf4e
BLAKE2b-256 ae2c45e6fa9d1f0e7bf26d236adc3fff2fe3a8de41e4944458f683347d58809c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page