{"id":13781124,"url":"https://github.com/Servir-Mekong/hydra-floods","last_synced_at":"2025-05-11T14:34:39.605Z","repository":{"id":41142687,"uuid":"136848932","full_name":"Servir-Mekong/hydra-floods","owner":"Servir-Mekong","description":"HYDrologic Remote sensing Analysis for Floods Python package","archived":false,"fork":false,"pushed_at":"2024-06-19T18:27:37.000Z","size":69975,"stargazers_count":176,"open_issues_count":13,"forks_count":52,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-09T21:14:05.021Z","etag":null,"topics":["earth-engine","flood","google-cloud","near-real-time","remote-sensing","surface-water"],"latest_commit_sha":null,"homepage":"https://servir-mekong.github.io/hydra-floods/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Servir-Mekong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-10T22:16:12.000Z","updated_at":"2025-05-04T20:05:59.000Z","dependencies_parsed_at":"2023-09-21T19:31:31.987Z","dependency_job_id":"29e81c3f-8432-4086-b03e-af085b9b5fd9","html_url":"https://github.com/Servir-Mekong/hydra-floods","commit_stats":{"total_commits":481,"total_committers":13,"mean_commits":37.0,"dds":"0.10395010395010396","last_synced_commit":"400bc206a3141adfeb108db01861504f382eb779"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Servir-Mekong%2Fhydra-floods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Servir-Mekong%2Fhydra-floods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Servir-Mekong%2Fhydra-floods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Servir-Mekong%2Fhydra-floods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Servir-Mekong","download_url":"https://codeload.github.com/Servir-Mekong/hydra-floods/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253382734,"owners_count":21899920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["earth-engine","flood","google-cloud","near-real-time","remote-sensing","surface-water"],"created_at":"2024-08-03T18:01:23.168Z","updated_at":"2025-05-11T14:34:39.579Z","avatar_url":"https://github.com/Servir-Mekong.png","language":"Python","funding_links":[],"categories":["Python API","Segmentation","Climate Change"],"sub_categories":["Packages","Segmentation - Water, coastlines, rivers \u0026 floods","Natural Hazard and Storms"],"readme":"# hydra-floods\n\n[![docs](https://github.com/Servir-Mekong/hydra-floods/workflows/docs/badge.svg)](https://servir-mekong.github.io/hydra-floods)\n![unittests](https://github.com/Servir-Mekong/hydra-floods/workflows/unittests/badge.svg)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![PyPI version](https://badge.fury.io/py/hydrafloods.svg)](https://badge.fury.io/py/hydrafloods)\n\n\n## Introduction\n\nThe Hydrologic Remote Sensing Analysis for Floods (or HYDRAFloods) is an open source Python application for downloading, processing, and delivering surface water maps derived from remote sensing data. The bases behind the tool is to provide sensor agnostic approaches to produce surface water maps. Furthermore, there are workflows that leverage multiple remote sensing dataset in conjunction to provide daily surface water maps for flood application.\n\n### Installation\n\nThe recommended way to get up and started using the `hydrafloods` packages is to install using `pip`:\n\n```\npip install hydrafloods\n```\n\n`pip` should handle some of the basic dependencies such as the Earth Engine Python API that we need for the majority of the functionality. It is planned to add hydrafloods to the conda-forge channel but that is currently not completed.\n\nTo use the `hydrafloods` package successfully, Google Cloud and Earth Engine authentication is necessary. Tointialize the Google Cloud environment and authenticate using your credentials, run the following command:\n\n```\ngcloud init\n```\n\nTo authenticate the Earth Engine Python API with your credentials, run the following:\n\n```\nearthengine authenticate\n```\n\nFor more information on setup and installation of the `hydrafloods` package, please see the [Installation Docs](https://servir-mekong.github.io/hydra-floods/installation/).\n\n## Example\n\nTo highlight a quick example of the `hydrafloods` API and simplicity to produce high-quality surface water maps we provide a quick example of mapping surface water using Sentinel-1 over the confluence of the Mekong and Tonle Sap rivers, which experiences frequent flooding.\n\n```python\n# import the hydrafloods and ee package\nimport hydrafloods as hf\nimport ee\nee.Initialize()\n\n# specify start and end time as well as geographic region to process\nstart_time = \"2019-10-05\"\nend_time =  \"2019-10-06\"\nregion = ee.Geometry.Rectangle([104, 11.5, 106, 12.5 ])\n\n# get the Sentinel-1 collection\n# the hf.dataset classes performs the spatial-temporal filtering for you\ns1 = hf.datasets.Sentinel1(region, start_time, end_time)\n\n# apply a water mapping function to the S1 dataset\n# this applies the \"Edge Otsu\" algorithm from https://doi.org/10.3390/rs12152469\nwater_imgs = s1.apply_func(\n    hf.thresholding.edge_otsu,\n    initial_threshold=-14,\n    thresh_no_data=-20,\n    edge_buffer=300\n)\n\n# take the mode from multiple images\n# since this is just imagery from one day, it will simply mosaic the images\nwater_map = ee.Image(water_imgs.collection.mode())\n\n# export the water map\nhf.geeutils.export_image(\n    water_map,\n    region,\n    \"users/\u003cYOUR_USERNAME\u003e/water_map_example\",\n    scale=30,\n)\n```\n\n_(This script is complete, it should run \"as is\")_\n\nAt the end of the script execution, there will be an [Earth Engine export task](https://developers.google.com/earth-engine/exporting#to-asset) running the process on the EE servers for use later in the EE platform. The resulting surface water image should look like the following figure. It should be noted that `hydrafloods` can scale quickly and easily by simply changing the start or end time and region to process, allowing for processing of surface water maps with minimal effort in terms of coding.\n\n![Quick Start Results](docs/img/quick_start_results.png)\n\n\u003c!-- html code for figure caption --\u003e\n\u003cspan class=\"img_caption\" style=\"display: block; text-align: center; font-size: 14px\"\u003e\n    __Figure 1.__ Sentinel-1 backscatter image (left) and resulting surface water map (right) from 2019-10-05 for a region in Cambodia as in the example.\n\u003c/span\u003e\n\nLearn more about the package throughout the documentation such as [installation](https://servir-mekong.github.io/hydra-floods/installation/), the [algorithms available](https://servir-mekong.github.io/hydra-floods/algorithms/), or setting up the package to run operationally using the [CLI](https://servir-mekong.github.io/hydra-floods/cli/).\n\n## Get in touch\n\n- Report bugs, suggest features or view the source code on [GitHub](https://github.com/servir-mekong/hydra-floods).\n- Contact us through a [Technical Assistance Request](https://servir.adpc.net/services/technical-assistance) and mention \"hydrafloods\"\n\n## Contribute\n\nContributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. Please see the [Contributing Guidelines](https://github.com/servir-mekong/hydra-floods/blob/master/CONTRIBUTING.md) for details on where to contribute and how to get started.\n\n## License\n\n`hydrafloods` is available under the open source [GNU General Public License v3.0](https://github.com/Servir-Mekong/hydra-floods/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FServir-Mekong%2Fhydra-floods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FServir-Mekong%2Fhydra-floods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FServir-Mekong%2Fhydra-floods/lists"}