SkillAgentSearch skills...

WaporTranslator

Python module for calculating Climate, Drought, Food Security, Irrigation, and Water Productivity indicators mostly based on the FAO's WaPOR datasets.

Install / Use

/learn @TimHessels/WaporTranslator
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

WaporTranslator

Usage of the WaPOR dataset for calculating Food Production, Water Productivity, Climate, Drought, and Irrigation Indicators


<a name="Content"></a>0. Content

  1. Content
  2. About WaPOR
  3. Introduction WaporTranslator
  4. Installation Anaconda
  5. Installation QGIS
  6. Installation WaporTranslator
    1. Method 1: Install WaporTranslator automatically
      1. Step 1: Download WaporTranslator
      2. Step 2: Run installation file
    2. Method 2: Install WaporTranslator manually
      1. Step 1: Download watertools, WaporAPI, and WaporTranslator
      2. Step 2: Install all the python modules
        1. Method 1: conda
        2. Method 2: pip
        3. Method 3: wheel
        4. Method 4: python file
  7. Add Environment Variables
  8. Required Accounts for WaporTranslator
    1. Account 1: WaPOR
    2. Account 2: NASA
  9. Run WaporTranslator
    1. Step 1: Open Anaconda prompt
    2. Step 2. Activate python environment
    3. Step 3. Run WaporTranslator LEVEL 1
    4. Step 4. Run WaporTranslator LEVEL 2
    5. Step 5. Run WaporTranslator LEVEL 3
  10. LANDSAF option as input
  11. WaporTranslator Indicators

<a name="chapter1"></a>1. About WAPOR

WaPOR is an open accessible near real time database that use satellite information to monitor different agricultural related parameters like Evapotranspiration, Net Primary Production, and Gross Biomass Water Productivity. At the moment, version 2.0 has been launced on the 17th of June 2019 whole Africa with a spatial resolution of 250 meters for a dekadal timescale. The main riverbasins are covered on a 100m grid, and some parts have even a spatial resolution of 30m. All the dataset area available since 2009 and runs till near real time.


<a name="chapter2"></a>2. Introduction WaporTranslator

The WaporTranslator is a python based module, that mainly uses WaPOR data in combination with GLDAS, MODIS, LANDSAF, SoilGrids and SRTM data to calculate multiple indicators for Food Production, Water Productivity, Climate, Drought, and Irrigation.

The tool is made on a 64-bits Windows 10 computer using python 3.7. For calculating large areas, make sure your computer has enough RAM (minimum of 16Gb working memory). For smaller areas a 8Gb RAM would be sufficient.

Limitation: Due to the limitation in solar input, the model is now forced to include a recent year within the analyses. This means that if LANDSAF is used as solar input, the "End_Year" parameter cannot be smaller than 2016 and for KNMI option (default) as solar input this parameter cannot be smaller than 2017.


<a name="chapter3"></a>3. Installation Anaconda

There are several packages available, which include python. Recommended for the WaporTranslator is to use the python package within Anaconda. The great advantage of using the standard Anaconda package is that most of the common used modules are included within the package and also an IDE is included (Spyder). Alternatively, these modules can be installed separately by the user if a not Anaconda is preferred.

A main advantage of this Anaconda package is the easy installation of the python modules that are included within the Anaconda library. The whole overview of python modules that are already installed or are included in the Anaconda library can be seen here.

The Anaconda executable can be downloaded from: https://www.anaconda.com/distribution/. It is recommended to download the 64-bits version, this will increase the calculation capacity enormously. However, be sure that your computer/laptop is a **64-bits computer/laptop. Otherwise, install the 32-bits version.

The WaporTranslator python module is programmed in python version 3.7 on a Windows 10 operating system.

After downloading Anaconda you can run the installation of Anaconda by double-click the executable file and follow the automatic installation steps. Choose a logical location for the Anaconda main directory, a logical location is a directory without spaces and preferably near the root folder (C: or D:), the default place is the user folder (C:\Users\username). In the remaining of this document this directory will be called $HOME.

The Anaconda package also includes Spyder, which is the IDE (Integrated Development Environment). This is a layout for writing and running python scripts.


<a name="chapter4"></a>4. Installation QGIS

In order to run all the WaporTranslator functions, there are some necessary executables for running the whole tool properly. For reprojections of the dataset the GDAL functions are required.

The GDAL package is a geoprocessing toolbox that is also included in QGIS. The easiest way to get this GDAL package is to install QGIS Standalone version on your computer.

To make python able to find all the properties of the different projections a required environment variable must be checked and created if needed. Search within the environment variable if the GDAL_DATA variable name exists. If this variable already exists, there is no need to create this variable again. If not, this variable must be created by yourself. For more explanation about how to add an environment user variable go to the Add Environment Variable chapter within this manual.

If QGIS is installed, the folder with projections information can be found somewhere here “$HOME\Program Files\QGIS x.xx\share\gdal”. create the following environment variable (do not place a semi column at the end of the variable value):

GDAL_DATA >> $HOME\Program Files\QGIS x.xx\share\gdal


<a name="chapter5"></a>5. Installation WaporTranslator

There are two options to install the WaporTranslator. Method 1 is to use the installation file that is located in the WaporTranslator package. This will create a new python environment that can run the WaporTranslator functions. Method 2 describes how to install the tool manually. Both methods will be further described step by step in the remaining of this chapter:


<a name="chapter5_1"></a>5.1 Method 1: Install WaporTranslator automatically:

To install the WaporTranslator automatically the following steps are needed:

  • Step 1: Download WaporTranslator
  • Step 2: Run installation file

The steps mentioned above will be described one by one below.

<a name="chapter5_1_1"></a>Step 1: Download WaporTranslator

Download the WaporTranslator by clicking on the "Clone or download" button located on the top right of the following page: www.github.com/TimHessels/WaporTranslator.

After downloading, subtract the data and change the name from "WaporTranslator-master" into "WaporTranslator".

<a name="chapter5_1_2"></a>Step 2: Run installation file

This method can only be performed if Anaconda is installed. Otherwise the installation has to be done manually as described in the manual installation. Open the windowsOS.yml file (located in the WaporTranslator folder) in a text editor program and change the last line defining the path to the location of Anaconda on your operating system. The default is set on C:\Username\Anaconda3\envs\env_waportranslator, do not forget to replace the 'Username' with the location of your $HOME folder where Anaconda3 folder is located (leave Anaconda3\envs\env_waportranslator on the end of this line).

If you forgot the $HOME folder, you can search by opening the Command Prompt and type:

dir Anaconda3 /AD /s

After saving the windowsOS.yml file, navigate to the folder where this .yml file is located by opening Anaconda prompt and type:

cd C:\PATH\TO\DIRECTORY\WaporTranslator

The next step will install all the required modules for the WaporTranslator within a new python environment called env_waportranslator. The installation can be started by typing the following command in the Anaconda prompt:

conda env create -f windowsOS.yml

If no error is shown, the installation was succesful. If not, try Method 2 to install manually the specified modules that gave the errors during the automated process.

After installation, copy and paste the complete "WaporTranslator" folder within the site-packages location of the new created python environment within the Anaconda3 folder ($HOME\Anaconda3\envs\env_waportranslator\Lib\site-packages).


<a name="chapter5_2"></a>5.2 Method 2, Install WaporTranslator manually:

To install the WaporTranslator manually the following steps are required:

  • Step 1: Download WaporTranslator, watertools, and WaporAPI
  • Step 2: Install required python modules

The steps mentioned above will be described one by one below.

If during the installation not a new python environment is created the path $HOME\Anaconda3\envs\env_waportranslator\Lib\site-packages will not exists and all the modules will be installed in $HOME\Anaconda3\Lib\site-packages or in the environment name created by yourself. If in the remaining of this manual $HOME\Anaconda3\envs\env_waportranslator\Lib\site-packages is mentioned, you have to go to: $HOME\Anaconda3\Lib\site-packages or if you created an environment by yourself: $HOME\Anaconda3\envs\NAME_OF_YOUR_ENVIRONMENT\Lib\site-packages.

<a name="chapter5_2_1"></a>Step 1: Download

View on GitHub
GitHub Stars13
CategoryDevelopment
Updated1y ago
Forks5

Languages

Python

Security Score

75/100

Audited on Nov 16, 2024

No findings