A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

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

README.md

hydra-floods

docs
unittests
License: GPL v3
PyPI version

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.

Quick Start Results

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

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


GitHub Events

Total
Last Year

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 Email 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

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/servir-mekong/hydra-floods

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

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

setup.py pypi
  • simplecmr *
.github/workflows/docs.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/pypi-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/unittests.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
environment.yml conda
  • earthengine-api
  • fire
  • gcsfs
  • gdal
  • geopandas
  • netcdf4
  • numpy
  • pandas
  • pip
  • pyproj
  • pyresample
  • python 3.7.*
  • requests
  • scipy
  • shapely
  • xarray
  • xmltodict
  • yaml
docker/Dockerfile docker
  • continuumio/miniconda3 latest build

Score: 15.424055271615082