Author: Idil Yaktubay, iyaktubay@iisd-ela.org (IISD-ELA)
This repository provides a workflow to hydro-condition Prairie watersheds using the hydro_condition.py
script. It is designed for use with the custom PWA-hydro-conditioning-tools Python package, and requires certain datasets as input.
PWA-hydro-conditioning-main/
├── hydro_condition_py.py # Main script to run the hydro-conditioning pipeline
├── README.md # This documentation
└── .gitignore # File that tells Git to ignore the "Data" folder created by the user
To be able to run this pipeline, the user must have:
- installed Anaconda,
- configured Git and GitHub SSH access linked to their GitHub account and enabled Python extension on Visual Studio code,
- have familiarity using Windows command line,
- and have
GDAL
installed using theconda install -c conda-forge gdal
on command line. You can verify the install withgdalinfo --version
.
1.1 Open the Visual Studio Code app on your desktop. 1.2 Open a new Powershell terminal by using the toolbar on the top left corner.

Your terminal should look something like this:

1.3 Clone this repository to your workspace by running the following command:
git clone https://github.com/IISD-ELA/PWA-hydro-conditioning-main.git
1.4 In the same workspace, clone the pwa-tools repository by running the following command:
git clone https://github.com/IISD-ELA/PWA-hydro-conditioning-tools.git
2.1 Make sure you are working in an active conda environment. For example, in my case, the pwa_dev
environment is active:

2.2 cd into the cloned PWA-hydro-conditioning-tools
folder by running the following command:
cd PWA-hydro-conditioning-tools
Your terminal should now look like this:

2.3 Install the custom pwa-tools
package in editable mode by running the following command. You must install it in editable mode for the pipeline to work correctly.
pip install -e .
2.4 After installation, if the pwa-tools
package was updated in the remote repository, you can locally update the package by uninstalling the package and re-installing it in editing mode:
pip uninstall pwa-tools
pip install -e
Create a Data/
folder inside the PWA-hydro-conditioning-main
folder and download and extract the following zip files into it:
- Watershed of interest based on outlet point from the CLRH Hydrofabrics website (e.g., ID: 05OE006 for Manning Canal)
- Streams dataset of interest from NHN streams website (e.g., ngn_rhn_05oe000_shp_en.zip for Manning Canal)
- Raster DEM(s) of interest from LiDAR DEMs (e.g., Seine & Rat 2016 for Manning Canal)
Your local workspace should now have the following structure:
your-working-directory/
├── PWA-hydro-conditioning-main/
├── hydro_condition.py
├── README.md
├── .gitignore
└── Data
└── ...data files you downloaded...
└── PWA-hydro-conditioning-tools/
└── ...repository contents...
4.1 On Visual Studio Code's welcome page, open the PWA-hydro-conditioning-main
folder by clicking "Open folder...":

4.2 Open up terminal on Visual Studio Code once again if it's not already open and cd into the PWA-hydro-conditioning-main
folder if it's not already there.
4.3 Run the following command to execute the hydro conditioning script. The script will ask you to input your watershed name as well as some file names.
python hydro_condition.py
4.4 Once the script has fully run, you will see the output files under the Data\<watershed name you entered when prompted>\HydroConditioning\Processed
folder:

You can also see any intermediate files in the ...\Interim
folder:

The output files include a depression depths raster .tif, depression depths shapefile, and a zonal statistics file for your watershed by default, as well as a wetland polygons shapefile with statistics (area, total storage, and median depth) if the user chooses to generate it.