This page gives an overview of how to use the hillslope length driver (LH_Driver.cpp) and it’s companion (LH_Driver_RAW.cpp) to quickly generate hillslope length data for a series of basins, along with other basin average metrics within a larger DEM file.
For appliactions considering landscapes at geomorphic (millenial) timescales use the main driver, for event scale measurements use the RAW driver. All instructions on this page will work for either driver. For convenicence it will refer only to LH_Driver.cpp but either driver can be used.
This code is used to to produce the data for Grieve et al. (in prep.)
Here is a quick overview of how to set up and run the code, if you have done it before:
This driver file will combine several LSDRaster Functions in order to generate as complete a range of basin average and hillslope length metrics as possible. The tool will generate:
This code is for research purposes and is under continuous development, so we cannot guarantee a bug-free experience!
See the other docs on this site for help with loading data into the correct format and general help with using this suite of software: Getting data into LSDTopoToolbox
The raw DEM to be analysed should be named <prefix>_DEM.flt
A binary mask of floodplains which can be used to ensure that analysis only occurs on the hillslopes. Should be named <prefix>_FloodPlain.flt
Channel heads can be extracted using the steps outlined in Calculating channel heads using the DrEICH algorithm and the resulting channel head file should be named <prefix>_CH.flt and be placed in the same directory as the DEM.
The surface fitting window size can be constrained using the steps outlined in Selecting A Window Size for Surface Fitting. This should be performed to ensure the correct parameter values are selected.
The code is compiled using the provided makefile, LH_Driver.make and the command:
make -f LH_Driver.make
Which will create the binary file, LH_Driver.out to be executed.
The driver is run with six arguments:
The syntax on a unix machine is as follows:
./LH_Driver.out <path to data files> <Prefix> <Window Radius> <Stream order> <Floodplain Switch> <Switch to write rasters>
And a complete example (your path and filenames may vary):
./LH_Driver.out /home/s0675405/DataStore/LH_tests/ Oregon 6 2 1 0
The final outputs are stored in a series of files, which are written to the data folder supplied as an argument.
<Prefix>_Paper_Data.txt
This file contains all of the basin average values for each basin in the following format:
BasinID HFR_mean HFR_median HFR_stddev HFR_stderr HFR_Nvalues HFR_range HFR_min HFR_max SA_binned_LH SA_Spline_LH LH_Density Area Basin_Slope_mean Basin_Slope_median Basin_Slope_stddev Basin_Slope_stderr Basin_Slope_Nvalues Basin_Slope_range Basin_Slope_min Basin_Slope_max Basin_elev_mean Basin_elev_median Basin_elev_stddev Basin_elev_stderr Basin_elev_Nvalues Basin_elev_Range Basin_elev_min Basin_elev_max Aspect_mean CHT_mean CHT_median CHT_stddev CHT_stderr CHT_Nvalues CHT_range CHT_min CHT_max EStar RStar HT_Slope_mean HT_Slope_median HT_Slope_stddev HT_Slope_stderr HT_Slope_Nvalues HT_Slope_range HT_Slope_min HT_Slope_max HT_relief_mean HT_relief_median HT_relief_stddev HT_relief_stderr HT_relief_Nvalues HT_relief_range HT_relief_min HT_relief_max
These files can be analysied using a series of python routines located here and the original figures for Grieve et al. (in prep) can be reproduced using code stored here.
<Prefix>_HilltopData.csv
This file contains hillslope metrics calculated for every hilltop pixel in the dataset which was routed successfully to a stream pixel. The file format is as follows:
X,Y,hilltop_id,S,R,Lh,BasinID,StreamID,HilltopSlope,DivergentCountFlag,PlanarCountFlag,E_Star,R_Star,EucDist
These files can be analysied using a series of python routines located here and the original figures for Grieve et al. (in prep) can be reproduced using code stored here.
<easting>_<northing>_trace.txt
If the trace creation switch is set to true a large number of files fill be created with this filename in a given directory. These files follow the format:
easting northing DivergentCountFlag length PlanarCountFlag E_Star R_Star EucDist
These files can be processed using the accompanying python script, trace_process_1_1.py, to produce a shapefile of the traces, this file can be found here.
Output Raster Data
If the output switch is set to 1 a series of rasters representing intermediate processing steps will be written to the supplied path. These files are as follows: