Our code for E*R* analysis can be found in our GitHub repository. This repository contains code for extracting channel networks, generating hillslope length data and processing this topographic data into a form which can be used to generate E* R* relationships.
First navigate to the folder where you will keep the GitHub repository. In this example it is called /home/LSDTT_repositories. To navigate to this folder in a UNIX terminal use the cd command:
$ cd /home/LSDTT_repositories/You can use the command pwd to check you are in the right folder. Once you are in this folder, you can clone the repository from the GitHub website:
$ pwd
/home/LSDTT_repositories/
$ git clone https://github.com/LSDtopotools/LSDTT_Hillslope_Analysis.gitNavigate to this folder again using the cd command:
$ cd LSDTT_Hillslope_Analysis/If you don’t want to use git, you can download a zipped version of the code:
$ pwd
/home/LSDTT_repositories/
$ wget https://github.com/LSDtopotools/LSDTT_Hillslope_Analysis/archive/master.zip
$ gunzip master.zip|
Note
|
GitHub zips all repositories into a file called master.zip,
so if you previously downloaded a zipper repository this will overwrite it.
|
In addition to the topographic analysis code, some python code is provided to handle the generation of the E* R* data and its visualization. This code is stored in a separate GitHub repository which can be checked out in the same manner as before. It is a good idea to place the python code into a separate directory to avoid confusion later on.
$ pwd
/home/LSDTT_repositories/
$ git clone https://github.com/sgrieve/ER_Star.gitNavigate to this folder again using the cd command:
$ cd ER_STAR/or if you prefer to avoid git:
$ pwd
/home/LSDTT_repositories/
$ wget https://github.com/LSDtopotools/LSDTopoTools_ER_STAR/archive/master.zip
$ gunzip master.zip|
Important
|
The python code has a number of dependences which you should check prior to trying to run the code, as it could give confusing error messages. |
For the code to run correctly the following packages must be installed with a version number greater than or equal to the version number listed below. The code has only been tested on Python 2.7 using the listed versions of these packages, so if you experience unexpected behavior on a higher version, try installing the specified version.
- matplotlib
-
Version 1.43
- numpy
-
Verision 1.9.2
- scipy
-
Version 0.16.0
- uncertainties
-
Version 2.4.6
To test if you have a package installed, launch python at the terminal and try to import each package in turn. For example, to test if we have numpy installed:
$ python
Python 2.7.6 (default, Jun 22 2015, 18:00:18)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>If importing the package does nothing, that means it has worked, and we can now check the version of numpy
>>> numpy.__version__
>>> '1.9.2'In this case my version of numpy is new enough to run Plot_ER_Data.py without any problems. Repeat this test for each of the 4 packages and if any of them are not installed or are too old a version, it can be installed by using pip at the unix terminal or upgraded by using the --upgrade switch.
$ sudo pip install <package name>
$ sudo pip install --upgrade <package name>We have provided some example datasets which you can use in order to test this algorithm. In this tutorial we will work using a LiDAR dataset and accompanying channel heads from Gabilan Mesa, California. You can get it from our ExampleTopoDatasets repository using wget and we will store the files in a folder called data:
$ pwd
/home/data
$ wget https://github.com/LSDtopotools/ExampleTopoDatasets/raw/master/gabilan.bil
$ wget https://github.com/LSDtopotools/ExampleTopoDatasets/raw/master/gabilan.hdr
$ wget https://github.com/LSDtopotools/ExampleTopoDatasets/raw/master/gabilan_CH.bil
$ wget https://github.com/LSDtopotools/ExampleTopoDatasets/raw/master/gabilan_CH.hdrThis dataset is already in the preferred format for use with LSDTopoTools (the ENVI bil format). However the filenames are not structured in a manner which the code expects. Both the hillslope length driver and the E*R* driver expect files to follow the format <prefix>_<filetype>.bil so we should rename these four files to follow this format.
$ pwd
/home/so675405/data
$ mv gabilan.bil gabilan_DEM.bil
$ mv gabilan.hdr gabilan_DEM.hdr
$ mv gabilan_CH.bil gabilan_DEM_CH.bil
$ mv gabilan_CH.hdr gabilan_DEM_CH.hdr
$ ls
gabilan_DEM.bil gabilan_DEM_CH.bil gabilan_DEM_CH.hdr gabilan_DEM.hdrNow the prefix for our data is gabilan and we are ready to look at the code itself.