Setting up environment for DCO Demo Analysis

Mac Environment

1.1) Install Anaconda

  • Navigate to the continuum website and download the python 2.7 Mac version of Anaconda, if not already installed.
  • In terminal, where the downloaded anaconda source code is stored, type:
bash Anaconda2-4.1.1-MacOSX-x86_64.sh
  • Select yes to all of the prompts.
  • Edit your .bash_profile to include the anaconda bin path in the PATH directory.
export PATH="/your_annaconda_path/anaconda2/bin:$PATH
  • To update the PATH in terminal type:
source ~/.bash_profile

1.2) Install pyGPlates

  • Navigate to the pyGPlates page and download pygplates_rev12_python_MacOS64.zip.
  • Unzip the contents of this file in a safe and memorable location.
  • Once again, edit your .bash_profile, this time including the path of the PyGPlates package in your PYTHONPATH:
PYTHONPATH=your_dependencies_folder/pygplates_rev12_python27_MacOS64:PYTHONPATH
  • In terminal, type the following:
source ~/.bash_profile

1.3) Install GMT5 (stable)

  • We recommend you install the stable version of GMT5 using MacPorts. If you do not have MacPorts installed, instructions can be found here.
  • Given you have MacPorts installed, to install gmt5  stable version in terminal type:
sudo port install gmt5

1.4) Build GMT5 (development)

A development version of GMT5 must be installed (during the development of this analysis a bug was found in the tool grdtrack. This tool was fixed in the development version. We advise you use the GMT5 stable version for all other functions called in this analysis.  In cases where the fixed version of grdtrack is required, the analysis will call upon the GMT5 development version.

The next steps have been taken from http://gmt.soest.hawaii.edu/projects/gmt/wiki/BuildingGMT

svn checkout svn://gmtserver.soest.hawaii.edu/gmt5/trunk gmt5-dev
  • In the source tree of the gmt build files, copy cmake/ConfigUserTemplate.cmake to cmake/ConfigUser.cmake and edit the file accordingly:
set (GMT_BINDIR "bin")             #gmt executables will be stored next to the build files in a folder called bin
set (GSHHG_ROOT <path to gshhg>)   #path to the GSHHG downloaded in the previous step
set (DCW_ROOT <path to dcw>)       #path to the DCW downloaded in the previous step
  • In terminal, do the following:
cd <path to>/gmt_build_direc
mkdir build
cd build
cmake ..
make
make install

1.5) Download Demo Analysis

1.6) Fix global variables in script (IMPORTANT)

  • Navigate to the folder DCO_Subduction_Analysis and open the file DCO_subductionzone_analysis.sh in text editor of your choosing.
  • Find the line within the global variables of DCO_subductionzone_analysis.sh:
gmt_developement_directory='<GMT_Developement_Build_Path_Reqired>'
  • Change <GMT_Developement_Build_Path_Reqired> to your gmt development build path. Make sure a ‘/’ character proceeds the directory path i.e. gmt_developement_directory=’/Users/sam/Documents/GMT_Dev/gmt5-dev/bin/’

1.7) Map all file dependencies in DCO_Demo_Analysis.sh

  • Within the DCO_Demo_Analysis.sh the path variables will required the correct path to each file. The to age and from ages will need to be set as well.
#Make sure all arguments are enclose in double quotes

#DCO Subduction Zone Analysis variable paths
rotfiles="<Rotation_File_Paths>" 
model_features="<Model_Features_Paths>" 
carbonate="<Carbonate_Features_Path>"
COB="<COB_Features_Path>"
fromage="<From_Age>"
toage="<To_Age>"
prefix="DCO_Subduction_Analysis"

#DCO Crust Analysis variable paths
rotfiles="<Rotation_File_Paths>"
model_features="<Model_Features_Paths>"
sediment_grids="<Sediment_Grid_Path>"
age_grids="<Age_Grid_Path>" 
fromage="<From_Age>"
toage="<To_Age>"
prefix="DCO_Crust_Analysis"

1.8) Run analysis

  • Navigate to the analysis bundle in terminal and type the following lines:
chmod +x DCO_Demo_Analysis.sh
./DCO_Demo_Analysis.sh

 

Linux or Windows

In the case that you using a windows computer, we recommend you set up a virtual machine to host Ubunutu 15.10 (Wily). Virtual Box is a popular choice for a virtual machine. Ubuntu 15.10 (Wily) is the latest version of Ubuntu that PyGPlates is available to. Once you have your Ubuntu 15.10 (Wily) virtual machine set up, you are ready for the follow steps. (Take note of whether your Ubuntu VM is a 32 bit or 64 bit OS)

2.1) Install PyGPlates

  • Navigate to the PyGPlates page and download pygplates-ubuntu-wiley _1.5_1_i386.deb for 32bit OS or pygplates-ubuntu-wiley _1.5_1_amd64.deb for a 62 bit OS.
  • Open the .deb file and click Install. After installation is complete, check that pygplates in installed in the directory /usr/lib/pygpaltes/revision12
  • You need to append your pyGPlates installation path to your PythonPath.
  • Using a text editor of your choosing open your .bashrc file and add the following line:
export PYTHONPATH="/usr/lib/pygplates/revision12:$PYTHONPATH"
  • Following the edit in terminal, type:
source ~/.bashrc

2.2) Build GMT5 (Stable)

You need to build a stable version of GMT 5 from source. The next steps have been taken from http://gmt.soest.hawaii.edu/projects/gmt/wiki/BuildingGMT

  • Install the development dependencies with the following lines in terminal:
sudo apt-get install subversion build-essential cmake libnetcdf-dev libgdal1-dev libfftw3-dev libpcre3-dev liblapack-dev
sudo apt-get install GraphicsMagick
sudo apt-get install texlive texlive-latex-extra
sudo apt-get install python-sphinx
  • Download the latest stable GMT5 build gmt-5.2.1-src.tar.gz from http://gmt.soest.hawaii.edu/projects/gmt/wiki/Download
  • Unzip the contents of this file in a secure easy to remember folder.
  • Download GSHHG (coastlines, rivers, and political boundaries; filename: gshhg-gmt-x.x.x.tar.gz) from the download page or ftp://ftp.soest.hawaii.edu/gshhg and extract the files. Place this in an isolated easy to remember folder i.e. ‘GMT_Dependencies’.
  • Download DCW (country polygons; filename: dcw-gmt-x.x.x.tar.gz) from the download page or ftp://ftp.soest.hawaii.edu/dcw and extract the files. Ideally store this file in the same location as GSHHG.
  • In the source tree of the gmt build files, copy cmake/ConfigUserTemplate.cmake to cmake/ConfigUser.cmake and edit the file accordingly:
set (CMAKE_INSTALL_PREFIX /opt/gmt)    #gmt executables will be stored Ubuntu's main path directories
set (GSHHG_ROOT <path to gshhg>)       #path to the GSHHG downloaded in the previous step
set (DCW_ROOT <path to dcw>)           #path to the DCW downloaded in the previous step
  • In terminal, do the following:
cd <path to>/gmt_build_direc
mkdir build
cd build
cmake ..
make
make install

2.3) Build GMT5 (Developement)

A development version of GMT5 must be installed (during the development of this analysis a bug was found in the tool grdtrack, this tool was fixed though in the development version. This GMT version is unstable and unsafe to use for all other functions called in this analysis.  In cases where the fixed version of grdtrack is required, the analysis will call upon the GMT5 development version)

svn checkout svn://gmtserver.soest.hawaii.edu/gmt5/trunk gmt5-dev
  • In the source tree of gmt5-dev, copy cmake/ConfigUserTemplate.cmake to cmake/ConfigUser.cmake and edit the file accordingly:
set (GMT_BINDIR "bin")           #gmt executables will be stored next to the build files in a folder called bin
set (GSHHG_ROOT <path to gshhg>) #path to the GSHHG downloaded in the previous steps
set (DCW_ROOT <path to dcw>)     #path to the DCW downloaded in the previous steps
  • Again in terminal do the following:
cd <path to>/gmt5-dev
mkdir build
cd build
cmake ..
make
make install
  • A new folder called bin should be created, containing all of the GMT tools.

2.4) Download Demo Analysis

  • Download demo analysis from the DCO portal page  (URL to be supplied) , place the bundle in directory of your choosing

2.5) Fix global variables in script (IMPORTANT)

  • Navigate to the folder DCO_Subduction_Analysis and open the file DCO_subductionzone_analysis.sh in text editor of your choosing.
  • Find the line within the global variables of DCO_subductionzone_analysis.sh :
gmt_developement_directory='<GMT_Developement_Build_Path_Reqired>'
  • Change <GMT_Developement_Build_Path_Reqired> to your gmt development build path. Make sure a ‘/’ character proceeds the directory path i.e. gmt_developement_directory=’/Users/sam/Documents/GMT_Dev/gmt5-dev/bin/’

2.6) Map all file dependencie in DCO_Demo_Analysis.sh

  • Within the DCO_Demo_Analysis.sh script the path variables will required the correct path to each file. The to age and from ages will need to be set as well.
#Make sure all arguments are enclose in double quotes

#DCO Subduction Zone Analysis variable paths
rotfiles="<Rotation_File_Paths>" 
model_features="<Model_Features_Paths>" 
carbonate="<Carbonate_Features_Path>"
COB="<COB_Features_Path>"
fromage="<From_Age>"
toage="<To_Age>"
prefix="DCO_Subduction_Analysis"

#DCO Crust Analysis variable paths
rotfiles="<Rotation_File_Paths>"
model_features="<Model_Features_Paths>"
sediment_grids="<Sediment_Grid_Path>"
age_grids="<Age_Grid_Path>" 
fromage="<From_Age>"
toage="<To_Age>"
prefix="DCO_Crust_Analysis"

2.7) Run analysis

  • Navigate to the analysis bundle in terminal and type the following lines:
chmod +x DCO_Demo_Analysis.sh
./DCO_Demo_Analysis.sh

 

Leave a Comment