Map floods with Sentinel-1 radar images. We replicate in this package the work
Project description
Dask based Flood Mapping
Map floods with Sentinel-1 radar images. We replicate in this package the work
of Bauer-Marschallinger et al. (2022)[^1] on the TU Wien Bayesian-based
flood mapping algorithm. This implementation is entirely based on
dask and data access via
STAC with
odc-stac. The algorithm requires
three pre-processed input datasets stored and accessible via STAC at the Earth
Observation Data Centre For Water Resources Monitoring (EODC). It is foreseen
that future implementations can also use data from other STAC catalogues. This
notebook explains how microwave backscattering can be used to map the extent of
a flood. The workflow detailed in this
notebook
forms the backbone of this package. For a short overview of the Bayesian decision
method for flood mapping see this
ProjectPythia book.
Installation
To install the package, do the following:
pip install dask-flood-mapper
Usage
Storm Babet hit the Denmark and Northern coast of Germany at the 20th of October 2023 Wikipedia. Here an area around Zingst at the Baltic coast of Northern Germany is selected as the study area.
Local Processing
Define the time range and geographic region in which the event occurred.
time_range = "2022-10-11/2022-10-25"
bbox = [12.3, 54.3, 13.1, 54.6]
Use the flood module and calculate the flood extent with the Bayesian decision
method applied tp Sentinel-1 radar images. The object returned is a
xarray with lazy loaded Dask arrays. To
get the data in memory use the compute method on the returned object.
from dask_flood_mapper import flood
flood.decision(bbox=bbox, datetime=time_range).compute()
Distributed Processing
It is also possible to remotely process the data at the EODC Dask Gateway with the added benefit that we can then process close to the data source without requiring rate-limiting file transfers over the internet.
For ease of usage of the Dask Gateway install the
eodc package besides the dask-gateway
package. Also, see the
EODC documentation.
pip install dask-gateway eodc
# or use pipenv
# git clone https://github.com/interTwin-eu/dask-flood-mapper.git
# cd dask-flood-mapper
# pipenv sync -d
However differences in versions client- and server-side can cause problems. Hence, the most convenient way to successively use the EODC Dask Gateway is Docker. To do this clone the GitHub repository and use the docker-compose.yml.
git clone https://github.com/interTwin-eu/dask-flood-mapper.git
cd dask-flood-mapper
docker compose up
Copy and paste the generated URL to launch Jupyter Lab in your browser. Here one can run the below code snippets or execute the notebook about remote processing.
from eodc.dask import EODCDaskGateway
from eodc import settings
from rich.prompt import Prompt
settings.DASK_URL = "http://dask.services.eodc.eu"
settings.DASK_URL_TCP = "tcp://dask.services.eodc.eu:10000/"
Connect to the gateway (this requires an EODC account).
your_username = Prompt.ask(prompt="Enter your Username")
gateway = EODCDaskGateway(username=your_username)
Create a cluster.
[!CAUTION] Per default no worker is spawned, therefore please use the widget to add/scale Dask workers in order to enable computations on the cluster.
cluster_options = gateway.cluster_options()
cluster_options.image = "ghcr.io/eodcgmbh/cluster_image:2025.4.1"
cluster = gateway.new_cluster(cluster_options)
client = cluster.get_client()
cluster
Map the flood the same way as we have done when processing locally.
flood.decision(bbox=bbox, datetime=time_range).compute()
User Interface
It is also possible to run the workflow in an user-friendly interface, as shown below:
Firstly, install the extra packages with:
pip install dask-flood-mapper[app]
Then, to access it, simplify run the in terminal the command:
floodmap
It will open the GUI in the web browser.
Authors
Martin Schobben, Thais Beham, Clay Harrison
Contributors
Contributing Guidelines
Please find the contributing guidelines in the specific file CONTRIBUTING.md.
Automated Delivery
This repository holds a container image to be used for running Dask based flood
mapping on the EODC Dask Gateway. Use the URL
ghcr.io/intertwin-eu/dask-flood-mapper:latest to specify the image.
docker pull ghcr.io/intertwin-eu/dask-flood-mapper:latest
Credits
Credits go to EODC (https://eodc.eu) for developing the infrastructure and the management of the data required for this workflow. This work has been supported as part of the interTwin project (https://www.intertwin.eu). The interTwin project is funded by the European Union Horizon Europe Programme - Grant Agreement number 101058386.
Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union Horizon Europe/Horizon 2020 Programmes. Neither the European Union nor the granting authorities can be held responsible for them.
License
This repository is covered under the MIT License.
Literature
[^1]: Bauer-Marschallinger, Bernhard, Senmao Cao, Mark Edwin Tupas, Florian Roth, Claudio Navacchi, Thomas Melzer, Vahid Freeman, and Wolfgang Wagner. Satellite-Based Flood Mapping through Bayesian Inference from a Sentinel-1 SAR Datacube. Remote Sensing 14, no. 15 (January 2022): 3673. https://doi.org/10.3390/rs14153673.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dask_flood_mapper-0.1.3.tar.gz.
File metadata
- Download URL: dask_flood_mapper-0.1.3.tar.gz
- Upload date:
- Size: 198.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42840825ea0e6796299a01c470f41d313f4531b3ab93e53b057abc51725c192b
|
|
| MD5 |
5052237c9cb38d3d697fe0079de8fc93
|
|
| BLAKE2b-256 |
5a61892df645ae22190fd7a0b649f4877033a69ffef66bd49a5c8a577c02c800
|
Provenance
The following attestation bundles were made for dask_flood_mapper-0.1.3.tar.gz:
Publisher:
pypi.yml on interTwin-eu/dask-flood-mapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dask_flood_mapper-0.1.3.tar.gz -
Subject digest:
42840825ea0e6796299a01c470f41d313f4531b3ab93e53b057abc51725c192b - Sigstore transparency entry: 204830787
- Sigstore integration time:
-
Permalink:
interTwin-eu/dask-flood-mapper@275742801c36bbe2d61a1bafc5dc0efc02b832f5 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/interTwin-eu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@275742801c36bbe2d61a1bafc5dc0efc02b832f5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dask_flood_mapper-0.1.3-py3-none-any.whl.
File metadata
- Download URL: dask_flood_mapper-0.1.3-py3-none-any.whl
- Upload date:
- Size: 216.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c86baeb326eb2fe95a91126c7ffdd781de52b8296707413cc351ddbb53329dde
|
|
| MD5 |
01b731835663d0c96a3c34887c85f3f3
|
|
| BLAKE2b-256 |
c0027897c517598f46c4d17de61174d0b5433339ebc267b25bbe88119985e2c0
|
Provenance
The following attestation bundles were made for dask_flood_mapper-0.1.3-py3-none-any.whl:
Publisher:
pypi.yml on interTwin-eu/dask-flood-mapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dask_flood_mapper-0.1.3-py3-none-any.whl -
Subject digest:
c86baeb326eb2fe95a91126c7ffdd781de52b8296707413cc351ddbb53329dde - Sigstore transparency entry: 204830789
- Sigstore integration time:
-
Permalink:
interTwin-eu/dask-flood-mapper@275742801c36bbe2d61a1bafc5dc0efc02b832f5 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/interTwin-eu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@275742801c36bbe2d61a1bafc5dc0efc02b832f5 -
Trigger Event:
release
-
Statement type: