hydrocivil


Namehydrocivil JSON
Version 0.3 PyPI version JSON
download
home_pageNone
Summarya package for hydrological methods in civil and enviromental engineering
upload_time2024-10-21 00:36:29
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 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.

## Installation

Currently the package can only be installed via pip:

```shell
pip install --force-reinstall hydrocivil
```

## Example Use

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

#### Compute basin properties

```python
# ---------------------- 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('RioGomez', basin, rnetwork, dem, cn)
wshed = wshed.compute_params()
wshed.plot()
```

    <Axes: title={'left': 'Example'}>

![png](image/wshed_plot_outputexample.png)Create an hypothetical storm

```python
# 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](image/example_storm.png)

#### Estimate the basin response (flood hydrograph)

```python
# 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](image/example_hydrograph.png)

## References

```bib
@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},
}

```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "hydrocivil",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Lucas Glasner <lgvivanco96@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2a/73/cc45fd537ff86aac74c69544d8127e20aa59454e83990ae9fe44084677df/hydrocivil-0.3.tar.gz",
    "platform": null,
    "description": "## hydrocivil: a package for hydrological methods in civil and enviromental engineering\r\n\r\nTypical 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.\r\n\r\nThe 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.\r\n\r\n## Installation\r\n\r\nCurrently the package can only be installed via pip:\r\n\r\n```shell\r\npip install --force-reinstall hydrocivil\r\n```\r\n\r\n## Example Use\r\n\r\n```python\r\nfrom hydrocivil.misc import load_example_data\r\nfrom hydrocivil.watersheds import RiverBasin\r\nfrom hydrocivil.rain import RainStorm\r\n```\r\n\r\n#### Compute basin properties\r\n\r\n```python\r\n# ---------------------- Load example data (or your own) --------------------- #\r\n\r\n# dem = rxr.open_rasterio('/path/to/dem.tif')\r\n# curvenumber = rxr.open_rasterio('path/to/cn.tif')\r\n# rivernetwork = gpd.read_file('path/to/rivers.shp')\r\n# basin_polygon = gpd.read_file('path/to/basin.shp')\r\nbasin, rnetwork, dem, cn = load_example_data()\r\n\r\n# Create RiverBasin object and compute properties\r\nwshed = RiverBasin('RioGomez', basin, rnetwork, dem, cn)\r\nwshed = wshed.compute_params()\r\nwshed.plot()\r\n```\r\n\r\n    <Axes: title={'left': 'Example'}>\r\n\r\n![png](image/wshed_plot_outputexample.png)Create an hypothetical storm\r\n\r\n```python\r\n# Create a 100 milimeter, 24 hours duration, SCS type I storm with pulses every 30 minutes\r\nstorm = RainStorm('SCS_I24')\r\nstorm = storm.compute(timestep=0.5, duration=24, rainfall=100)\r\n# Use SCS method for abstractions with the watershed average curve number\r\nstorm = storm.infiltrate(method='SCS', cn=wshed.params.loc['curvenumber'].item())\r\nstorm.Hyetograph.plot()\r\nstorm.Effective_Hyetograph.plot()\r\n```\r\n\r\n    <Axes: >\r\n\r\n![png](image/example_storm.png)\r\n\r\n#### Estimate the basin response (flood hydrograph)\r\n\r\n```python\r\n# Compute the basin SCS unit hydrograph for the storm (UH related to the storm timestep)\r\nwshed = wshed.SynthUnitHydro(method='SCS', timestep=storm.timestep)\r\n\r\n# Compute the flood hydrograph as the convolution of the design storm with the unit hydrograph\r\nwshed.UnitHydro.convolve(storm.Effective_Hyetograph).plot()\r\n```\r\n\r\n    <Axes: >\r\n\r\n![png](image/example_hydrograph.png)\r\n\r\n## References\r\n\r\n```bib\r\n@article{NCRS_NEH630,\r\n  title={National Engineering Handbook Part 630 - Hydrology},\r\n  author={Natural Resources Conservation Service, United States Department of Agriculture (USDA)},\r\n  year={}\r\n}\r\n\r\n@article{mcarreteras,\r\n  title={Manual de Carreteras},\r\n  author={Direcci\u00f3n de vialidad, Ministerio de Obras P\u00fablicas (MOP), Chile},\r\n  year={2022}\r\n}\r\n\r\n@article{DGA_modificacioncauces,\r\n  title={Gu\u00edas metodol\u00f3gicas para presentaci\u00f3n y revisi\u00f3n t\u00e9cnica de proyectos de modificaci\u00f3n de cauces naturales y artificiales.},\r\n  author={Direcci\u00f3n General de Aguas (DGA), Ministerio de Obras P\u00fablicas (MOP), Chile},\r\n  year={2016}\r\n}\r\n\r\n@article{DGA_manualcrecidas,\r\n  title={Manual de c\u00e1lculo de crecidas y caudales mi\u0301nimos en cuencas sin informacio\u0301n fluviome\u0301trica},\r\n  author={Direcci\u00f3n general de Aguas (DGA), Ministerio de Obras P\u00fablicas (MOP), Chile},\r\n  year={1995},\r\n}\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "a package for hydrological methods in civil and enviromental engineering",
    "version": "0.3",
    "project_urls": {
        "Homepage": "https://github.com/lucasglasner/hydrocivil",
        "Issues": "https://github.com/lucasglasner/hydrocivil/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "446522248320e1f53841ef436c10d93bcc3c97245e10038cc3e05610e4e60135",
                "md5": "25ed06cd4dcd5baaf3c389ea93a48f46",
                "sha256": "54a1c28ca274749c59d8f780c1227f4645aff3049f94ebcd3610e827f9bb1438"
            },
            "downloads": -1,
            "filename": "hydrocivil-0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "25ed06cd4dcd5baaf3c389ea93a48f46",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5388960,
            "upload_time": "2024-10-21T00:35:56",
            "upload_time_iso_8601": "2024-10-21T00:35:56.767084Z",
            "url": "https://files.pythonhosted.org/packages/44/65/22248320e1f53841ef436c10d93bcc3c97245e10038cc3e05610e4e60135/hydrocivil-0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2a73cc45fd537ff86aac74c69544d8127e20aa59454e83990ae9fe44084677df",
                "md5": "7dfad6bf39015fc7b74da2d83d7cb3ec",
                "sha256": "e33f6e771575a812d233c58282cecbae2126002af1df69acc219076af6fc414b"
            },
            "downloads": -1,
            "filename": "hydrocivil-0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "7dfad6bf39015fc7b74da2d83d7cb3ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5339367,
            "upload_time": "2024-10-21T00:36:29",
            "upload_time_iso_8601": "2024-10-21T00:36:29.202896Z",
            "url": "https://files.pythonhosted.org/packages/2a/73/cc45fd537ff86aac74c69544d8127e20aa59454e83990ae9fe44084677df/hydrocivil-0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-21 00:36:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lucasglasner",
    "github_project": "hydrocivil",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "hydrocivil"
}
        
Elapsed time: 0.80068s