Installation of SPHY
General
SPHY v3.0 can be either be installed as i) a stand-alone application, where the user can run the model throughout the command prompt, or as ii) a an integrated application (plugin) in QGIS, where the model can be run using a Graphical User-Interface (GUI). The GUI has been developed as a plugin in QGIS[7], and has the advantage that changing the model input and output, as well as changing model parameters, is more clear and user-friendly. Furthermore, the use of the plugin allows you to store and visualize your model input and output in the user-friendly and world-wide used QGIS Geographical Information System (GIS), which is in the public domain.The name of this SPHY model plugin is “SphyPlugin” (v1.0), and is compatible with SPHY (v3.0). The installation of the SPHY model plugin is not part of this manual and is described in the SPHY GUIs manual (Terink et al., 2015b).
This manual (Section 4.2) describes the installation of SPHY v3.0 as a stand-alone application.
Installing SPHY as a stand-alone application
In order to install SPHY as a stand-alone application it is required to have a PC with a windows operating system. The software packages that are required to run the SPHY model as stand-alone application are:
Python 3.6, 64-bit
NumPy 1.8.0, 32-bit
PCRaster 4.2.0, 64-bit
SPHY v3.0 source code
These packages need to be installed in the same order as shown above, and the installation of each package is described in the following sections. The Python, NumPy, and PCRaster software packages can also be downloaded from the SPHY model website as zip-files:
The login credentials that are required for downloading software and data can be obtained from:
http://www.sphy.nl/software/download-sphy/
Python 3.6, 64-bit
SPHY requires the installation of the Python[8] programming language. PCRaster has been developed using the Python[9]. Since SPHY v3.0 has been developed using the 64-bit version of PCRaster 4.2.0, it is required to install the 64-bit version of Python 3.6, which can be downloaded from the internet using the link below:
https://www.python.org/downloads/release/python-360/
After downloading Python it can be installed by double clicking the downloaded file. During installation it will be asked where to install Python. You can choose any location that you prefer. As an example to be used in this manual, we have installed Python in the folder:
c:\Python36\
A final installation step includes setting the environmental variables. In order to do this, follow the steps below:
Go to start, then control panel, and type environment in the top-right search window.
Click on “Edit the system environmental variables”.
Click “Environmental Variables” in the bottom-right of this window (Figure 13).
Under system variables, select the Path variable and click “Edit” (Figure 14).
In order let your system know the existence of your Python installation, it is required to add your Python installation folder to the “Path” system variable. This is shown in Figure 15 for our case, which was the c:\Python36 installation folder. It is important to have a semicolon between the system variables.
Finally, click OK and OK again in order to complete the installation of Python.
Numpy 1.8.0 32-bit
Numpy stands for Numerical Python, and is a fundamental package for scientific computing with Python. It has especially been developed to work with raster data (arrays), which is also the basis of the PCRaster dynamic modelling framework in which SPHY has been developed.
SPHY requires a Numpy version that works with the 64-bit version of Python 3.6, which is Numpy 1.8.0 32-bit. This package can be downloaded using the link below:
After downloading the Numpy package, it can be installed by double-clicking on the downloaded file. If Python 3.6 has been installed correctly in the previous step, then the Python installation folder will be found automatically during the installation of Numpy. In our example case this folder was c:\Python36\ (see example Figure 16).
PCRaster 4.2.0 64-bit
SPHY is written in the Python programming language using the PCRaster (Karssenberg et al., 2001; Karssenberg, 2002; Karssenberg et al., 2010; Schmitz et al., 2009, 2013) dynamic modelling framework. PCRaster[10] has been developed at Utrecht University. PCRaster is targeted to the development and deployment of spatio-temporal environmental models. It allows users to develop their own simulation models for applications in environmental sciences, such as e.g. hydrology, ecology, geography, etc.
SPHY v3.0 is based on the 64-bit system architecture, and therefore requires the 64-bit PCRaster v4.2. SPHY v3.0 has been built and thoroughly tested using PCRaster 4.2.0, and it is therefore recommended to download and install this stable version of PCRaster. More information about this version of PCRaster can be found at the link below:
https://pcraster.geo.uu.nl/pcraster-4-2-0/
In order to install PCRaster 4.2.0, it is mandatory to have successfully installed Python 3.6 and Numpy 1.8.0 during the previous two steps (Section 0 and 4.2.2). To install PCRaster 4.2.0 you need to perform the following steps:
Download the PCRaster version using this link:
https://pcraster.geo.uu.nl/pcraster-4-2-0/
Create a new folder on your hard disk where you prefer to install PCRaster. For example: c:\Program Files (x86)\PCRaster42\
Unzip the contents of the file downloaded under 1) to this folder
To let your system recognize the existence of PCRaster, the Environmental Variables need to be updated again. The steps to get to your system Environmental Variables are shown in Section 0, steps 1-4.
It is now required to add the “bin” directory of the extracted PCRaster package to the “Path” system variable (Figure 17). In our example it is the folder: c:\Program Files (x86)\PCRaster42\bin\
Click OK.
The next step involves setting the PYTHONPATH environment variable. In the same system variables window check the existence of a PYTHONPATH variable. If it exists, then edit the variable by adding the path (Figure 18) of the Python directory of the extracted PCRaster package, which is in our example:
c:\Program Files (x86)\PCRaster40\python\
Otherwise click “New” to create it, and add PYTHONPATH as Variable name, and add the Python directory folder as the Variable value.
Click OK and OK to complete the installation of PCRaster.
The successful installation of PCRaster can be tested as follows:
Open a command prompt
Type pcrcalc
You should see the command prompt view as is shown in Figure 19
To test the combination of PCRaster and Python:
Open a command prompt
Type python
This opens the Python interactive console
Type import pcraster
If no errors are shown, then installation has been completed successfully.
Figure 19: Adding the PCRaster bin folder to the Path system variables.
Figure 20: Editing or creating the PYTHONPATH variable for the PCRaster package.
Figure 21: Command prompt view of testing a successful installation of PCRaster after entering the pcrcalc command.
SPHY v3.0 source code
The SPHY v3.0 source code can be obtained from the SPHY model website (http://www.sphy.nl/software/). The source code is available as a zip-file (SPHY3.0.zip) and needs to be extracted to a folder on your hard drive. In our case we created the folder c:\SPHY and unzipped the contents of SPHY3.0.zip to this folder. After unzipping the contents of SPHY3.0.zip to a folder of your preference, installation has been completed successfully. The SPHY model v3.0 source code can be downloaded directly using the link below:
https://www.dropbox.com/sh/4o90lu7h5yhbadu/AADcc5yFzCJL_pVGmJ3jZ2i8a?dl=0
Last updated