HYDRAFloods
An open source Python application for downloading, processing, and delivering surface water maps derived from remote sensing data.
https://github.com/servir-mekong/hydra-floods
Category: Climate Change
Sub Category: Natural Hazard and Storm
Keywords
earth-engine flood google-cloud near-real-time remote-sensing surface-water
Last synced: about 4 hours ago
JSON representation
Repository metadata
HYDrologic Remote sensing Analysis for Floods Python package
- Host: GitHub
- URL: https://github.com/servir-mekong/hydra-floods
- Owner: Servir-Mekong
- License: gpl-3.0
- Created: 2018-06-10T22:16:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-19T18:27:37.000Z (10 months ago)
- Last Synced: 2025-04-25T14:07:14.662Z (2 days ago)
- Topics: earth-engine, flood, google-cloud, near-real-time, remote-sensing, surface-water
- Language: Python
- Homepage: https://servir-mekong.github.io/hydra-floods/
- Size: 66.7 MB
- Stars: 175
- Watchers: 14
- Forks: 51
- Open Issues: 13
- Releases: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
README.md
hydra-floods
Introduction
The 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.
Installation
The recommended way to get up and started using the hydrafloods
packages is to install using pip
:
pip install hydrafloods
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.
To 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:
gcloud init
To authenticate the Earth Engine Python API with your credentials, run the following:
earthengine authenticate
For more information on setup and installation of the hydrafloods
package, please see the Installation Docs.
Example
To 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.
# import the hydrafloods and ee package
import hydrafloods as hf
import ee
ee.Initialize()
# specify start and end time as well as geographic region to process
start_time = "2019-10-05"
end_time = "2019-10-06"
region = ee.Geometry.Rectangle([104, 11.5, 106, 12.5 ])
# get the Sentinel-1 collection
# the hf.dataset classes performs the spatial-temporal filtering for you
s1 = hf.datasets.Sentinel1(region, start_time, end_time)
# apply a water mapping function to the S1 dataset
# this applies the "Edge Otsu" algorithm from https://doi.org/10.3390/rs12152469
water_imgs = s1.apply_func(
hf.thresholding.edge_otsu,
initial_threshold=-14,
thresh_no_data=-20,
edge_buffer=300
)
# take the mode from multiple images
# since this is just imagery from one day, it will simply mosaic the images
water_map = ee.Image(water_imgs.collection.mode())
# export the water map
hf.geeutils.export_image(
water_map,
region,
"users/<YOUR_USERNAME>/water_map_example",
scale=30,
)
(This script is complete, it should run "as is")
At the end of the script execution, there will be an Earth Engine export task 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.
Learn more about the package throughout the documentation such as installation, the algorithms available, or setting up the package to run operationally using the CLI.
Get in touch
- Report bugs, suggest features or view the source code on GitHub.
- Contact us through a Technical Assistance Request and mention "hydrafloods"
Contribute
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. Please see the Contributing Guidelines for details on where to contribute and how to get started.
License
hydrafloods
is available under the open source GNU General Public License v3.0.
Owner metadata
- Name: SERVIR-Mekong
- Login: Servir-Mekong
- Email: [email protected]
- Kind: organization
- Description: SERVIR-Mekong
- Website: http://servir.adpc.net
- Location: Bangkok, thailand
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/18582762?v=4
- Repositories: 44
- Last ynced at: 2024-03-27T11:56:36.672Z
- Profile URL: https://github.com/Servir-Mekong
GitHub Events
Total
- Watch event: 13
- Fork event: 3
Last Year
- Watch event: 13
- Fork event: 3
Committers metadata
Last synced: 7 days ago
Total Commits: 482
Total Committers: 13
Avg Commits per committer: 37.077
Development Distribution Score (DDS): 0.106
Commits in past year: 3
Committers in past year: 2
Avg Commits per committer in past year: 1.5
Development Distribution Score (DDS) in past year: 0.333
Name | Commits | |
---|---|---|
kmarkert | k****t@g****m | 431 |
ArjenHaag | A****g | 14 |
MayerT1 | 4****1 | 12 |
Biplov Bhandari | b****5@g****m | 5 |
Ate | p****e@g****m | 4 |
jayh | j****n@u****u | 4 |
verseve | w****d@g****m | 3 |
loaner | l****r@S****v | 2 |
kmarkert | l****r@S****l | 2 |
John Dilger | j****r@g****m | 2 |
Farrukh Chishtie | 3****e | 1 |
Nyein Soe Thwal | n****l@g****m | 1 |
kaileymohamed | k****d@o****m | 1 |
Committer domains:
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 36
Total pull requests: 17
Average time to close issues: 5 months
Average time to close pull requests: 6 days
Total issue authors: 18
Total pull request authors: 8
Average comments per issue: 2.61
Average comments per pull request: 0.53
Merged pull request: 15
Bot issues: 0
Bot pull requests: 0
Past year issues: 3
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: 2 days
Past year issue authors: 3
Past year pull request authors: 2
Past year average comments per issue: 0.67
Past year average comments per pull request: 0.5
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- KMarkert (9)
- mickymags (7)
- ArjenHaag (4)
- kaileymohamed (2)
- lg760411 (1)
- devapatel3 (1)
- dangeol (1)
- hardreddata (1)
- s-boeck (1)
- biplovbhandari (1)
- mn5hk (1)
- elbeejay (1)
- SOutmani (1)
- JustinWenzhaoLi (1)
- aaraney (1)
Top Pull Request Authors
- KMarkert (5)
- biplovbhandari (4)
- jdilger (2)
- elbeejay (2)
- Tjalling-dejong (1)
- nst11 (1)
- kaileymohamed (1)
- ArjenHaag (1)
Top Issue Labels
- Stale (9)
- enhancement (8)
- bug (8)
- docs (7)
- question (6)
- wontfix (1)
- help wanted (1)
- feature (1)
- good first issue (1)
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 2,040 last-month
- Total dependent packages: 1
- Total dependent repositories: 2
- Total versions: 62
- Total maintainers: 1
pypi.org: hydrafloods
HYDrologic Remote sensing Analysis for Floods
- Homepage: http://github.com/servir-mekong/hydra-floods
- Documentation: https://hydrafloods.readthedocs.io/
- Licenses: GNU GPL v3.0
- Latest release: 2023.10.14 (published over 1 year ago)
- Last Synced: 2025-04-26T14:34:51.552Z (1 day ago)
- Versions: 62
- Dependent Packages: 1
- Dependent Repositories: 2
- Downloads: 2,040 Last month
-
Rankings:
- Stargazers count: 6.089%
- Forks count: 6.144%
- Dependent packages count: 7.306%
- Average: 8.534%
- Downloads: 11.335%
- Dependent repos count: 11.793%
- Maintainers (1)
Dependencies
- simplecmr *
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- earthengine-api
- fire
- gcsfs
- gdal
- geopandas
- netcdf4
- numpy
- pandas
- pip
- pyproj
- pyresample
- python 3.7.*
- requests
- scipy
- shapely
- xarray
- xmltodict
- yaml
- continuumio/miniconda3 latest build
Score: 15.424055271615082