Skip to main content

Distributed hydrological-model

Project description

GitHub release (latest by date) DOI Binder Python Versions Documentation Status License: GPL v3 pre-commit Language grade: Python

GitHub Clones Say Thanks!

Current build status

All platforms:

Build status codecov GitHub last commit GitHub forks GitHub Repo stars AppVeyor tests (branch)

Github all releases

Profile views

Current release info

Name Downloads Version Platforms
Conda Recipe Conda Downloads Downloads Downloads Downloads PyPI - Downloads GitHub all releases Conda Version PyPI version Anaconda-Server Badge Conda Platforms Join the chat at https://gitter.im/Hapi-Nile/Hapi

Hapi Hapi

Hapi - Hydrological library for Python

Hapi is an open-source Python Framework for building raster-based conceptual distributed hydrological models using HBV96 lumped model & Muskingum routing method at a catchment scale (Farrag & Corzo, 2021), Hapi gives a high degree of flexibility to all components of the model (spatial discretization - cell size, temporal resolution, parameterization approaches and calibration (Farrag et al., 2021)).

1 2

Hapi

Main Features

  • Modified version of HBV96 hydrological model (Bergström, 1992) with 15 parameters in case of considering snow processes, and 10 parameters without snow, in addition to 2 parameters of Muskingum routing method
  • Remote sensing module to download the meteorological inputs required for the hydrologic model simulation (ECMWF)
  • GIS modules to enable the modeler to fully prepare the meteorological inputs and do all the preprocessing needed to build the model (align rasters with the DEM), in addition to various methods to manipulate and convert different forms of distributed data (rasters, NetCDF, shapefiles)
  • Sensitivity analysis module based on the concept of one-at-a-time OAT and analysis of the interaction among model parameters using the Sobol concept ((Rusli et al., 2015)) and a visualization
  • Statistical module containing interpolation methods for generating distributed data from gauge data, some distribution for frequency analysis and Maximum likelihood method for distribution parameter estimation.
  • Visualization module for animating the results of the distributed model, and the meteorological inputs
  • Optimization module, for calibrating the model based on the Harmony search method

The recent version of Hapi (Hapi 1.0.1) integrates the global hydrological parameters obtained by Beck et al., (2016), to reduce model complexity and uncertainty of parameters.

Future work

  • Developing a regionalization method for connection model parameters with some catchment characteristics for better model calibration.
  • Developing and integrate river routing method (kinematic and diffusive wave approximation)
  • Apply the model for large scale (regional/continental) cases
  • Developing a DEM processing module for generating the river network at different DEM spatial resolutions.

For using Hapi please cite Farrag et al. (2021) and Farrag & Corzo (2021)

IHE-Delft sessions

  • In April 14-15 we had a two days session for Masters and PhD student in IHE-Delft to explain the different modules and the distributed hydrological model in Hapi Day 1 , Day 2

References

Farrag, M. & Corzo, G. (2021) MAfarrag/Hapi: Hapi. doi:10.5281/ZENODO.4662170

Farrag, M., Perez, G. C. & Solomatine, D. (2021) Spatio-Temporal Hydrological Model Structure and Parametrization Analysis. J. Mar. Sci. Eng. 9(5), 467. doi:10.3390/jmse9050467 Link

Beck, H. E., Dijk, A. I. J. M. van, Ad de Roo, Diego G. Miralles, T. R. M. & Jaap Schellekens, and L. A. B. (2016) Global-scale regionalization of hydrologic model parameters-Supporting materials 3599–3622. doi:10.1002/2015WR018247.Received

Bergström, S. (1992) The HBV model - its structure and applications. Smhi Rh 4(4), 35.

Rusli, S. R., Yudianto, D. & Liu, J. tao. (2015) Effects of temporal variability on HBV model calibration. Water Sci. Eng. 8(4), 291–300. Elsevier Ltd. doi:10.1016/j.wse.2015.12.002

Installing hapi

Installing hapi from the conda-forge channel can be achieved by:

conda install -c conda-forge hapi

It is possible to list all of the versions of hapi available on your platform with:

conda search hapi --channel conda-forge

Install from Github

to install the last development to time you can install the library from github

pip install git+https://github.com/MAfarrag/HAPI

pip

to install the last release you can easly use pip

pip install HAPI-Nile==1.6.0

Quick start

  >>> import Hapi

other code samples

Naming Convention

PEP8

  • module names: lower case word, preferably one word if not, separate words with underscores (module.py, my_module.py).
  • class names: PascalCase (Model, MyClass).
  • class method/function: CamelCase(getFile, readConfig).should have a verb one them, because they perform some action

======= History

1.3.2 (2022-12-26)

  • remove parameters from the package and retrieve them with the parameter package.

1.3.3 (2022-12-27)

  • use joblib to parallelize reading laterals in hydraulic model

1.3.4 (2022-12-27)

  • merge two function readLaterals and readRRMProgression, rename RRMProgression to routedRRM

1.3.5 (2022-12-27)

  • fix pypi package names in the requirements.txt file for all internal packages
  • fix python version number
  • tests are all passing

1.4.0 (2022-12-27)

  • remove fiona and the reading file exception using fion
  • unify reading results of rainfall-runoff model in the readRRMResults, ReadLaterals, ReadUSHydrographs
  • refactor code and change methods to camelcase
  • add hydrodynamic model 1d config file read function
  • simplify functions with too many parameters using decorator
  • add automatic pypi build and publish github actions

1.5.0 (2023-01-10)

  • hydraulic model can read chunked big zip file
  • fix CI
  • fix missing module (saint venant script and module)

1.6.0 (2023-02-03)

  • all attributes follows snake case naming convention
  • refactor all modules with pre-commit
  • add smoothDikeLevel, getReach and updateReach
  • bump up denpendencies versions
  • move un-necessary functions to serapeum-utils

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

HAPI-Nile-1.6.0.tar.gz (164.3 kB view details)

Uploaded Source

Built Distribution

HAPI_Nile-1.6.0-py3-none-any.whl (184.4 kB view details)

Uploaded Python 3

File details

Details for the file HAPI-Nile-1.6.0.tar.gz.

File metadata

  • Download URL: HAPI-Nile-1.6.0.tar.gz
  • Upload date:
  • Size: 164.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for HAPI-Nile-1.6.0.tar.gz
Algorithm Hash digest
SHA256 e66d971a6724832a1a69714c5622d216482fea7b8fc2227fea1644d829269936
MD5 35b9c431307eb9552ebfd3b83decd251
BLAKE2b-256 1af90a363d6ca0502ba57c967c09bd44dc9124bd84eb4040c91d618a25b3b100

See more details on using hashes here.

File details

Details for the file HAPI_Nile-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: HAPI_Nile-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 184.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for HAPI_Nile-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cd6016278fade8f6608cab24efa62bbf0449a9d44e73757383fc95e3afc4714
MD5 d1c0ae1ec52d98f400ae8b7bdf35307c
BLAKE2b-256 6d355f38258b45ab2fb70cedc82b4be4e298dca3d3ec9f77d227d958ec09bc09

See more details on using hashes here.

Supported by

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