Getting Started#

This page contains minimal info to get you up and flooding with floodsr. For more detailed information, see the User Guide. For common questions, see FAQ.

What Is floodsr?#

floodsr is a flood-depth resolution enhancement tool. Or a super-resolution (SR) tool in machine-speak. It takes a low-resolution depth raster as input and reconstructs higher-resolution output, using terrain (DEM) context.

Downloading test data#

Before running commands, it’s nice to have some data to play with. If you don’t have your own data yet, you can download a test tile from the project.

To download manually, browse to this release and download the assets into your current working directory.

Alternatively, bash users with curl can run:

curl -L -O https://github.com/cefect/floodsr/releases/download/v0.0.3/hires002_dem.tif -O https://github.com/cefect/floodsr/releases/download/v0.0.3/lowres032.tif

Use#

Here we give a quick intro on setting up a model and using it to enhance a flood raster.

Install#

floodsr was designed as a CLI-first Python package, so we recommend installing with pipx to ensure environment isolation:

pipx install floodsr

For more detailed installation instructions, see Installation.

Model Setup#

Before using the machine-learning backend, we need to fetch the model weights. This only needs to be done once, and the weights will be cached for future runs.

List available model versions:

floodsr models list

You should see ResUNet_16x_DEM in the list, which is the only model currently available.

Fetch a model by version into the default cache:

floodsr models fetch ResUNet_16x_DEM

Now you’re ready to enhance some flood rasters!

Enhance to High Resolution#

The primary tool in floodsr is the tohr command or to high resolution. This ingests a low-resolution flood hazard raster and a high-resolution DEM. This high-resolution DEM can either be specified as a local file or fetched from the HRDEM Mosaic data source (for locations in Canada of course).

To enhance to high resolution, fetching the DEM from the HRDEM Mosaic, try:

floodsr tohr --in lowres032.tif --fetch-hrdem

Alternatively, specify your own local DEM file:

floodsr tohr --in lowres032.tif --dem hires002_dem.tif

For more details, see the User Guide.