This repo was created for the following peer-reviewed manuscript:
Wu, Q., Lane, C.R., Wang, L., Vanderhoof, M.K., Christensen, J.R., & Liu, H. (2018). Efficient Delineation of Nested Depression Hierarchy in Digital Elevation Models for Hydrological Analysis Using Level-Set Methods. Journal of the American Water Resources Association (under review)
This tutorial assumes that you have used conda before. Please follow the conda user guide to install conda if necessary.
Please create an environment from the provided environment.yml file using the following command:
conda env create -f environment.yml
The command above will create a conda environment named levelset
. If you want to remove the levelset conda environment, use the following command:
conda remove --name levelset --all
Clone this repo and create a PyCharm project using the repo folder. Set the Python interpreter to your conda env path (e.g., ~/anaconda3/envs/levelset/bin/python
)
Open the Python script level_set/slicing.py and change the following parameters if needed.
# set input files
in_dem = "../data/CLSA_LiDAR.tif"
in_sink = "../data/CLSA_Sink.tif"
# parameters for level set method
min_size = 2000 # minimum number of pixels as a depression
min_depth = 0.3 # minimum depression depth
interval = 0.2 # slicing interval, top-down approach
# set output directory
out_dir = "../result"
Run the Python script level_set/slicing.py. By default, results will be saved under the result
folder under the project root directory.
The images below show working examples of the level set method for delineating nested depressions in the Cottonwood Lake Study Area (CLSA), North Dakota. More test datasets (e.g., the Pipestem watershed in the Prairie Pothole Region of North Dakota) can be downloaded from http://gishub.org/2018-JAWRA-Data
The following example was conducted on a 64-bit Linux machine with a quad-core Intel i7-7700 CPU and 16 GB RAM. The average running time of the algorithm for this DEM was 0.75 seconds.