Next: Demos, Previous: Boundary Definition File, Up: Usage [Contents][Index]
slope.py
slope.py
is an interactive program that is able to derive
local gradient information from elevation data and user input. The
program reads the elevation data from the file topography.txt,
which must be located in the working directory. To start the program
the command is:
./slope.py
The program responds with a request for user input:
Locate markers (m), plot channel profile (p), save profile (s) or exit (q):
The derivation of the local gradient is a two-stage process. Firstly, a series of markers are placed on opposite sides of the feature of interest. For example, for a channel feature, markers are placed along the channel on either side. Secondly, a best-fit curve is fitted to the data. A plot is displayed and the gradient printed to standard output. Optionally, the one-dimensional elevation data may be saved to an output file.
A detailed description of the options follows:
Locate markers. slope.py
opens a window that displays a
contour plot of the elevation data on the left hand side and a contour
plot of the derived slope on the right hand side. The axes are labeled
by cell index number. A legend to the side of each plot shows the range
of contour values.
The user is required to identify marker locations by positioning the mouse pointer within the elevation plot and pressing the SPACE key. The markers are entered in pairs, one on either side of the feature of interest. To finish the sequence of marker pairs, the user is required to move the mouse pointer to a position outside the elevation plot and press the q key.
Plot channel profile. slope.py
constructs a straight line
between each pair of markers and calculates the location of the minimum
elevation value along each line. These locations form a channel
“centre-line”. slope.py
then uses a best-fit procedure to
plot a straight line through the centre-line elevation data. A new
window opens to show the centre-line data and the best-fit line. The
gradient and intercept of the best-fit line are printed to standard
output.
Save profile. The channel centre-line data is written to the file 1D.txt. The file is formatted in the FullSWOF xyz format.
Quit slope.py
.
Next: Demos, Previous: Boundary Definition File, Up: Usage [Contents][Index]