# OptiDamTool
   
 
[](https://codecov.io/gh/debpal/OptiDamTool)
[](https://github.com/debpal/OptiDamTool/actions/workflows/linting.yml) [](https://github.com/debpal/OptiDamTool/actions/workflows/typing.yml) [](https://github.com/debpal/OptiDamTool/actions/workflows/testing.yml)





## About
`OptiDamTool` is a Python package designed for analytics and decision-making in dam management. Conceptualized and released on May 29, 2025, the package offers tools for modeling and analyzing hydrological flow across a network of connected dams.
Leveraging functionalities from the open-source [GeoAnalyze](https://github.com/debpal/GeoAnalyze) package, `OptiDamTool` provides classes that that assist users in preparing inputs for simulating water erosion and sediment transport, and supports decision-making in dam network deployment aimed at environmental sustainability.
## Classes
### `OptiDamTool.WatemSedem`
Provides tools to prepare inputs for the [WaTEM/SEDEM](https://github.com/watem-sedem) model, which simulates soil erosion, sediment transport capacity, and sediment delivery to stream networks at the watershed scale. While this class includes built-in methods for generating most required inputs, it is still recommended to consult the `GeoAnalyze` documentation for any geospatial operations not covered by its methods.
* Converts Digital Elevation Model (DEM) data into the stream files required for the WaTEM/SEDEM model with the `river routing = 1` extension enabled.
* Extends input rasters beyond the model region and fills NoData cells with valid values, as WaTEM/SEDEM does not support NoData.
* Performs reprojection, clipping, resolution rescaling, and reclassification of rasters.
* Processes open-source [Esri land cover data](https://livingatlas.arcgis.com/landcover/).
* Generates a land management factor raster from land cover inputs.
* Computes the product of soil erodibility and rainfall erosivity factors.
* Converts raster files to the Idrisi raster format, with the `.rst` file extension.
* Generates effective upstream drainage area polygons for selected dam locations within a stream network.
### `OptiDamTool.Network`
Offers methods for establishing hydrological and sedimentation flow connectivity between dams using the stream network.
* Identifies connectivity between adjacent upstream and downstream dams.
* Computes the controlled upstream drainage areas for selected dam locations within a stream network.
* Estimates sediment inflow to dams based on controlled upstream drainage areas.
* Simulates storage dynamics of individual dams in a system due to sedimentation, using a mass balance approach.
* Generates updated dam location points and their corresponding controlled drainage polygons when dams become inactive
during system-wide storage dynamics simulation.
### `OptiDamTool.Analysis`
Provides methods for analyzing simulation outputs and generating insights.
* Integrates sediment delivery to stream segments.
* Generates stream shapefiles with comprehensive information of each segment's drainage area and sediment input.
* Summarizes total sediment dynamics for the model region.
* Assigns a Coordinate Reference System and the default `GTiff` driver to output Idrisi raster files from a WaTEM/SEDEM simulation.
### `OptiDamTool.Visual`
Provides methods for visualizing simulation outputs.
* Creates a figure showing dam locations along the stream path.
* Generates a figure showing the annual remaining storage of each dam in the system at the beginning of the year.
* Generates a figure showing the annual sediment trapping percentage by each dam in the system, relative to the total sediment input across all stream segments during the year.
* Produces a figure showing dam system-level statistics, including controlled drainage area, remaining storage, sediment trapped, and sediment released.
The examples below show typical outputs produced by these visualization methods:
<div align="center">
<img src="https://github.com/debpal/OptiDamTool/raw/main/docs/_static/dam_location_in_stream.png" width="40%">
<img src="https://github.com/debpal/OptiDamTool/raw/main/docs/_static/dam_remaining_storage.png" width="60%">
<img src="https://github.com/debpal/OptiDamTool/raw/main/docs/_static/dam_trapped_sediment.png" width="60%">
<img src="https://github.com/debpal/OptiDamTool/raw/main/docs/_static/system_statistics.png" width="60%">
</div>
## Installation
To install, use pip:
```bash
pip install OptiDamTool
```
## Quickstart
A brief example of how to start:
```python
import OptiDamTool
watemsedem = OptiDamTool.WatemSedem()
network = OptiDamTool.Network()
```
## Documentation
For detailed information, see the [documentation](https://optidamtool.readthedocs.io/en/latest/).
## Support
If this project has been helpful and you'd like to contribute to its development, consider sponsoring with a coffee! Support will help maintain, improve, and expand this open-source project, ensuring continued valuable tools for the community.
[](https://www.buymeacoffee.com/debasish_pal)
Raw data
{
"_id": null,
"home_page": null,
"name": "OptiDamTool",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "Erosion, Sedimentation, Hydrologic modeling, Dam management, Optimization, Decision support",
"author": null,
"author_email": "Debasish Pal <bestdebasish@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ba/c7/89ddcd4ae73abf868e6cf16b044db404306c6d065e04c84282044d08990c/optidamtool-0.4.4.tar.gz",
"platform": null,
"description": "# OptiDamTool\r\n\r\n\r\n   \r\n\r\n \r\n [](https://codecov.io/gh/debpal/OptiDamTool) \r\n\r\n[](https://github.com/debpal/OptiDamTool/actions/workflows/linting.yml) [](https://github.com/debpal/OptiDamTool/actions/workflows/typing.yml) [](https://github.com/debpal/OptiDamTool/actions/workflows/testing.yml) \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n## About\r\n\r\n`OptiDamTool` is a Python package designed for analytics and decision-making in dam management. Conceptualized and released on May 29, 2025, the package offers tools for modeling and analyzing hydrological flow across a network of connected dams.\r\n\r\n\r\nLeveraging functionalities from the open-source [GeoAnalyze](https://github.com/debpal/GeoAnalyze) package, `OptiDamTool` provides classes that that assist users in preparing inputs for simulating water erosion and sediment transport, and supports decision-making in dam network deployment aimed at environmental sustainability.\r\n\r\n## Classes\r\n\r\n### `OptiDamTool.WatemSedem`\r\n\r\nProvides tools to prepare inputs for the [WaTEM/SEDEM](https://github.com/watem-sedem) model, which simulates soil erosion, sediment transport capacity, and sediment delivery to stream networks at the watershed scale. While this class includes built-in methods for generating most required inputs, it is still recommended to consult the `GeoAnalyze` documentation for any geospatial operations not covered by its methods.\r\n\r\n* Converts Digital Elevation Model (DEM) data into the stream files required for the WaTEM/SEDEM model with the `river routing = 1` extension enabled.\r\n* Extends input rasters beyond the model region and fills NoData cells with valid values, as WaTEM/SEDEM does not support NoData.\r\n* Performs reprojection, clipping, resolution rescaling, and reclassification of rasters.\r\n* Processes open-source [Esri land cover data](https://livingatlas.arcgis.com/landcover/).\r\n* Generates a land management factor raster from land cover inputs.\r\n* Computes the product of soil erodibility and rainfall erosivity factors.\r\n* Converts raster files to the Idrisi raster format, with the `.rst` file extension.\r\n* Generates effective upstream drainage area polygons for selected dam locations within a stream network.\r\n\r\n\r\n### `OptiDamTool.Network` \r\nOffers methods for establishing hydrological and sedimentation flow connectivity between dams using the stream network.\r\n\r\n* Identifies connectivity between adjacent upstream and downstream dams.\r\n* Computes the controlled upstream drainage areas for selected dam locations within a stream network.\r\n* Estimates sediment inflow to dams based on controlled upstream drainage areas.\r\n* Simulates storage dynamics of individual dams in a system due to sedimentation, using a mass balance approach.\r\n* Generates updated dam location points and their corresponding controlled drainage polygons when dams become inactive\r\n during system-wide storage dynamics simulation.\r\n\r\n\r\n### `OptiDamTool.Analysis` \r\nProvides methods for analyzing simulation outputs and generating insights.\r\n\r\n* Integrates sediment delivery to stream segments.\r\n* Generates stream shapefiles with comprehensive information of each segment's drainage area and sediment input.\r\n* Summarizes total sediment dynamics for the model region.\r\n* Assigns a Coordinate Reference System and the default `GTiff` driver to output Idrisi raster files from a WaTEM/SEDEM simulation.\r\n\r\n\r\n### `OptiDamTool.Visual` \r\nProvides methods for visualizing simulation outputs.\r\n\r\n\r\n* Creates a figure showing dam locations along the stream path.\r\n* Generates a figure showing the annual remaining storage of each dam in the system at the beginning of the year.\r\n* Generates a figure showing the annual sediment trapping percentage by each dam in the system, relative to the total sediment input across all stream segments during the year.\r\n* Produces a figure showing dam system-level statistics, including controlled drainage area, remaining storage, sediment trapped, and sediment released.\r\n\r\n\r\n\r\nThe examples below show typical outputs produced by these visualization methods:\r\n\r\n\r\n<div align=\"center\">\r\n <img src=\"https://github.com/debpal/OptiDamTool/raw/main/docs/_static/dam_location_in_stream.png\" width=\"40%\">\r\n <img src=\"https://github.com/debpal/OptiDamTool/raw/main/docs/_static/dam_remaining_storage.png\" width=\"60%\">\r\n <img src=\"https://github.com/debpal/OptiDamTool/raw/main/docs/_static/dam_trapped_sediment.png\" width=\"60%\">\r\n <img src=\"https://github.com/debpal/OptiDamTool/raw/main/docs/_static/system_statistics.png\" width=\"60%\">\r\n</div>\r\n\r\n\r\n\r\n## Installation\r\n\r\nTo install, use pip:\r\n\r\n```bash\r\npip install OptiDamTool\r\n```\r\n\r\n\r\n## Quickstart\r\nA brief example of how to start:\r\n\r\n```python\r\nimport OptiDamTool\r\nwatemsedem = OptiDamTool.WatemSedem()\r\nnetwork = OptiDamTool.Network()\r\n```\r\n\r\n\r\n## Documentation\r\n\r\nFor detailed information, see the [documentation](https://optidamtool.readthedocs.io/en/latest/).\r\n\r\n## Support\r\n\r\nIf this project has been helpful and you'd like to contribute to its development, consider sponsoring with a coffee! Support will help maintain, improve, and expand this open-source project, ensuring continued valuable tools for the community.\r\n\r\n\r\n[](https://www.buymeacoffee.com/debasish_pal)\r\n\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package for analytics in dam management workflows.",
"version": "0.4.4",
"project_urls": {
"Documentation": "https://optidamtool.readthedocs.io/en/latest/",
"Homepage": "https://github.com/debpal/OptiDamTool"
},
"split_keywords": [
"erosion",
" sedimentation",
" hydrologic modeling",
" dam management",
" optimization",
" decision support"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d55ded1e3be7172f5cd78bd2ef83314a08aadaaa48f1109973972b4a0eaa4893",
"md5": "f6a0ebdcc9aadc8602b807fae7878244",
"sha256": "67c0bfdbd48e105310a5aae4286c515fc80fc3f0daf641df7b423a9a01a12158"
},
"downloads": -1,
"filename": "optidamtool-0.4.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f6a0ebdcc9aadc8602b807fae7878244",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 33328,
"upload_time": "2025-08-16T08:50:22",
"upload_time_iso_8601": "2025-08-16T08:50:22.199398Z",
"url": "https://files.pythonhosted.org/packages/d5/5d/ed1e3be7172f5cd78bd2ef83314a08aadaaa48f1109973972b4a0eaa4893/optidamtool-0.4.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bac789ddcd4ae73abf868e6cf16b044db404306c6d065e04c84282044d08990c",
"md5": "ce5a75f51fc48a8a33581a41d12f0798",
"sha256": "8389f3bbab6543e45ac6812dddae855786d91b40709ab33177bf2ad5a7fcadea"
},
"downloads": -1,
"filename": "optidamtool-0.4.4.tar.gz",
"has_sig": false,
"md5_digest": "ce5a75f51fc48a8a33581a41d12f0798",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 35186,
"upload_time": "2025-08-16T08:50:23",
"upload_time_iso_8601": "2025-08-16T08:50:23.474016Z",
"url": "https://files.pythonhosted.org/packages/ba/c7/89ddcd4ae73abf868e6cf16b044db404306c6d065e04c84282044d08990c/optidamtool-0.4.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-16 08:50:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "debpal",
"github_project": "OptiDamTool",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "optidamtool"
}