Skip to content

Introduction

This sections introduces the yield reduction caused by soil erosion. The terrain suitability assessment is fully implemented based on GAEZ v4 model documentation with an updated algorithm according to GAEZ methodology. The assessment is implemented based on terrain slope condition, and rainfall intensity. The overview of Module V: Terrain Constraints is shown in the figure below.

In v2.3, users are required to provide the terrain constraint factors as excel sheet instead of python script mode.

Figure: Overview of Module V: Terrain Constraints Alt text


Mandatory Settings

Initialization of M5 Object Class Creation

Firstly, an object class TerrainConstraints must be delcared.

M4 terrain constraint object class creation
from pyaez import TerrainConstraints
terrain = TerrainConstraints.TerrainConstraints()

Input

Arguments Description Unit Data Type
None - - -

Output

Arguments Description Unit Data Type
None - - -

Importing Terrain Reduction Parmaeter Excel Sheets

Two separated excel files of terrain reduction factors must be prepared, corresponding to rainfed and irrigated conditions, before importing into the object class. The setting is explained in Data Preparation.

Once the preparation is done, the following function can be executed.

M4 terrain constraint object class creation
terrain.importTerrainReductionSheet(irr_file_path, rain_file_path)

Input

Arguments Description Unit Data Type
irr_file_path Full file path of terrain constraints excel file for irrigated condition - String
rain_file_path Full file path of terrain constraints excel file for rainfed condition - String

Output

Arguments Description Unit Data Type
None - - -

Importing Climate and Slope Data

This function allows users to set up monthly/daily precipitation and terrain percent slope data. Make sure the precipitation has 12 layers for monthly or 365/366 for daily data.

Import climate and slope
terrain.setClimateTerrainData(precipitation, slope)

Input

Arguments Description Unit Data Type
precipitation Daily/Monthly total precipitation mm/day 3D-NumPy Array
slope Percent Slope % 2D-NumPy Array

Output

Arguments Description Unit Data Type
None - - -

Calculate Fournier Index

This functions calculates Fournier Index (FI), a index to quantify the rainfall intensity. FI represents a simple index indicating the potential of soil erosion based on monthly precipitation.

Calculate FI
terrain.calculateFI()

Input

Arguments Description Unit Data Type
None - - -

Output

Arguments Description Unit Data Type
None - - -

Optional Settings

Setting the Study Area Mask

This function is set up as an optional step which set up the mask layer as input which reduces the computation time outside the pixels of considerations.

Mask Layer Setting
# Set up mask for the study area (country, regional, or local)
terrain.setStudyAreaMask(admin_mask, no_data_value)
Arguments Description Unit Data Format
admin_mask Mask Layer/Region of Interest Binary(0,1)/Categorical(1,2,...) 2D NumPy Array
no_data_value Value of mask layer to skip calculation Mask value from the layer. Integer

__

Major Functionalites

Applying Terrain Constraints

Once all the mandatory settings are done, users can run this function which executes the terrain-related yield reduction factors.

Import climate and slope
yld_out = terrain.applyTerrainConstraints(yield_in, irr_or_rain)

Input

Arguments Description Unit Data Type
yield_in Yield before applying the terrain-related reduction factor. (Either irrigated or rainfed). kg/ha 2D-NumPy Array
irr_or_rain I for irrigated, R for rainfed - String

Output

Arguments Description Unit Data Type
yld_out Terrain adjusted yield map. Same as yield_in 2D-NumPy Array

Terrain Suitability Map (Fc5)

This function returns the terrain suitability map (fc5) after applying the terrain constraint function. Based on the setting from applyTerrainConstraints, the fc5 map can be representative for either rainfed or irrigated. Fc5 values ranges from 0 (Not Suitable) to 1 (Very Suitable).

Get Fc5 map
fc5_map = terrain.getTerrainReductionFactor()

Input

Arguments Description Unit Data Type
None - - -

Output

Arguments Description Unit Data Type
fc5 Terrain reduction factor - 2D-NumPy Array

Fournier Index (FI)

This function extracts the Fournier Index (FI) map after the execution of calculateFI function.

Get FI
fi = terrain.getFI()

Input

Arguments Description Unit Data Type
None - - -

Output

Arguments Description Unit Data Type
fi Fournier Index - 2D-NumPy Array