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. For an interactive walkthrough, see Tutorial 1.

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 command-line interface (CLI)-first Python package, so we recommend installing with pipx to ensure environment isolation:

pipx install floodsr

For more detailed installation instructions, see Installation. After install, a quick sanity check is:

floodsr doctor

Model Setup#

floodsr currently exposes both a downloaded machine-learning model (ResUNet_16x_DEM) and a built-in rules-based model (CostGrow_Terrain). List the available model versions with:

floodsr models list

For the machine-learning backend, fetch the weights once and reuse them from cache:

floodsr models fetch ResUNet_16x_DEM

CostGrow_Terrain does not require downloaded weights, but it does require the extended install with PCRaster. See Installation if you want to use that model.

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

To run the built-in CostGrow model explicitly, use the same command with a model version:

floodsr tohr --in lowres032.tif --dem hires002_dem.tif --model-version CostGrow_Terrain

For more details, see the User Guide.