Skip to main content

a package for hydrological methods in civil and enviromental engineering

Project description

hydrocivil: a package for hydrological methods in civil and enviromental engineering

Typical tasks related to water resources and engineering require fast calculations of hydrological phenomena such as: flood hydrographs, flood routing, evapotranspiration, infiltration, among others. With this purpose in mind, hydrocivil is presented as an alternative package to perform calculations that are usually done in tedious spreadsheets in a flexible and adjustable way. The purpose is to give tools to the engineer to calculate hydrologic processes with methods and techniques he/she deems convenient, such as different varieties of synthetic unit hydrographs, synthetic storms or basin geomorphometric parameters. The package is not intended to be a replacement for larger hydrological models (e.g. HEC-HMS), but rather a fast, customizable and automatic alternative for simple multi-basin calculations.

The package is largely oriented to Chilean national standards, however many methods originally come from the USA NCRS National Engineering Handbook. The package is 100% written in English in order to maintain consistency with the syntax and basic classes/functions of the Python language.

Dependencies

Before installing, check your environment for the following packages:

  • numpy, pandas, scipy, matplotlib
  • xarray, rasterio, rioxarray
  • shapely, geopandas
  • networkx

Installation

Currently the package can only be installed via pip:

pip install --force-reinstall --no-deps hydrocivil

Example Use

from hydrocivil.misc import load_example_data
from hydrocivil.watersheds import RiverBasin
from hydrocivil.rain import RainStorm

Compute basin properties

# ---------------------- Load example data (or your own) --------------------- #

# dem = rxr.open_rasterio('/path/to/dem.tif')
# curvenumber = rxr.open_rasterio('path/to/cn.tif')
# rivernetwork = gpd.read_file('path/to/rivers.shp')
# basin_polygon = gpd.read_file('path/to/basin.shp')
basin, rnetwork, dem, cn = load_example_data()

# Create RiverBasin object and compute properties
wshed = RiverBasin('Example', basin, rnetwork, dem, cn, amc='wet')
wshed = wshed.compute_params()
wshed.plot()
<Axes: title={'left': 'Example'}>

png

Create an hypothetical storm

# Create a 100 milimeter, 24 hours duration, SCS type I storm with pulses every 30 minutes
storm = RainStorm('SCS_I24')
storm = storm.compute(timestep=0.5, duration=24, rainfall=100)
# Use SCS method for abstractions with the watershed average curve number
storm = storm.infiltrate(method='SCS', cn=wshed.params.loc['curvenumber'].item())
storm.Hyetograph.plot()
storm.Effective_Hyetograph.plot()
<Axes: >

png

Estimate the basin response (flood hydrograph)

# Compute the basin SCS unit hydrograph for the storm (UH related to the storm timestep)
wshed = wshed.SynthUnitHydro(method='SCS', timestep=storm.timestep)

# Compute the flood hydrograph as the convolution of the design storm with the unit hydrograph
wshed.UnitHydro.convolve(storm.Effective_Hyetograph).plot()
<Axes: >

png

References

@article{NCRS_NEH630,
  title={National Engineering Handbook Part 630 - Hydrology},
  author={Natural Resources Conservation Service, United States Department of Agriculture (USDA)},
  year={}
}

@article{mcarreteras,
  title={Manual de Carreteras},
  author={Dirección de vialidad, Ministerio de Obras Públicas (MOP), Chile},
  year={2022}
}

@article{DGA_modificacioncauces,
  title={Guías metodológicas para presentación y revisión técnica de proyectos de modificación de cauces naturales y artificiales.},
  author={Dirección General de Aguas (DGA), Ministerio de Obras Públicas (MOP), Chile},
  year={2016}
}

@article{DGA_manualcrecidas,
  title={Manual de cálculo de crecidas y caudales mínimos en cuencas sin información fluviométrica},
  author={Dirección general de Aguas (DGA), Ministerio de Obras Públicas (MOP), Chile},
  year={1995},
}

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

hydrocivil-0.5.tar.gz (5.4 MB view details)

Uploaded Source

Built Distribution

hydrocivil-0.5-py3-none-any.whl (5.4 MB view details)

Uploaded Python 3

File details

Details for the file hydrocivil-0.5.tar.gz.

File metadata

  • Download URL: hydrocivil-0.5.tar.gz
  • Upload date:
  • Size: 5.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for hydrocivil-0.5.tar.gz
Algorithm Hash digest
SHA256 60eb0fe7c3a2859dbc6ba1e107d8e17b9c41245aff083a4735d889b0b7dd1367
MD5 59829c7a85ae721157240e5385cf18ce
BLAKE2b-256 e6375dcf3802b12403d47f1aa7ad94a39dc447d7d5739a3635bc6adf69a6b4a3

See more details on using hashes here.

File details

Details for the file hydrocivil-0.5-py3-none-any.whl.

File metadata

  • Download URL: hydrocivil-0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for hydrocivil-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 acce35420272d6f3cb01470e34fd2111b864ecd79a06b50388449d3516aba366
MD5 f7709929f6d4e40f86d6bb3c6351653b
BLAKE2b-256 d64b94e47f6632d6e62e9c7ea4d79dfe1fccff725806f19fb7859eaf673112ea

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