Skip to content

IISD-ELA/PWA-hydro-conditioning-main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

PWA-hydro-conditioning-main

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.

Repository Structure

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

Prerequisites

To be able to run this pipeline, the user must have:

  1. installed Anaconda,
  2. configured Git and GitHub SSH access linked to their GitHub account and enabled Python extension on Visual Studio code,
  3. have familiarity using Windows command line,
  4. and have GDAL installed using the conda install -c conda-forge gdal on command line. You can verify the install with gdalinfo --version.

Setup Instructions

1. Clone this repository and the pwa-tools repository

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.

image

Your terminal should look something like this:

image

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. Install the pwa-tools package

2.1 Make sure you are working in an active conda environment. For example, in my case, the pwa_dev environment is active:

image

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:

image

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

3. Prepare the input data

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. Run the hydroconditioning script

4.1 On Visual Studio Code's welcome page, open the PWA-hydro-conditioning-main folder by clicking "Open folder...":

image

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:

image

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

image

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.

About

Folder for creating hydro-conditioned Prairie watershed datasets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages