This post covers the calculations of a Transformed Wetness Index (TWI) from Moderate Resolution Imaging Spectroradiometer (MODIS) reflectance data. The calculations are done for MODIS tiles covering Sub Saharan Africa for the years 2001 to 2018 at 16 day intervals. The downloading and organization of the MODIS data is covered in the previous post. Graphical presentation of some of the results are in the next post.
TWI is a non-linear normalized difference index that uses biophysical vectors representing the soil line and water vectors derived from an orthogonal linear transformation of multi-spectral reflection data. I have used TWI for mapping global tropical wetlands and also for wetland change detection. The advantage of TWI is its high spatial resolution compared to (passive) microwave data. TWI, however, suffers from biases due to both soil and vegetation conditions. In this project I thus use SMAP data to adjust TWI by assimilation as outlined in this post.
Process chain
The principal steps for calculating TWI from reflectance data using Karttur’s GeoImagine Framework include:
Linear transformation
Non-linear normalized difference
Conversion of TWI to percentage
In the Framework a process chain can be built as a series of calls to xml coded instructions. This section contains the calls and the remaining parts of the post details each called xml.
###################################
### MODIS TWI calculations ###
###################################
Linear transformation
The linear transformation converts the band data to biophysical indexes. In Remote Sensing circles this is known as a Tasseled Cap Transformation (TCT). TCTs are, however, usually defined using a fixed matrix. TWI is instead defined from a set of optimized vectors for identifying difference in soil moisture and derived using a Gram-Schmidt orthogonalization. The process for inferring the orthogonal (linear) transformation is LinearTransformMODISRegion:
<?xml version='1.0' encoding='utf-8'?>
<africasubsahara>
<userproj userid = 'karttur' projectid = 'karttur-africasubsahara' tractid= 'karttur-africasubsahara' siteid = '*' plotid = '*' system = 'modis'></userproj>
<period startyear = "1998" endyear = "2018" endmonth ='7' endday = '31' timestep='M'></period>
<!-- tile the original (monthly) TRMM data to the region (karttur-africasubsahara).
The TRMM data must be downloaded and organized
If you set the parameter "asscript" to True (= default),
you have to execute the shell script file as reported by the process,
and then rerun the xml with overwrite set to False to add the layers to the database
-->
<!-- Tile the TRMM data to the MODIS tile standard spatial resolution (463 m) -->
<processx processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '463.313' yres = '463.313' resample='near' asscript='False'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</processx>
<!-- Tile the same data, but to a spatial resolution of 27798.78 m -->
<process processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '27798.78' yres = '27798.78' resample='near' asscript='False' suffix = 'v7-f-m-30km'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</process>
<!-- Tile the same data, but to a , but to a spatial resolution of approx 1 deg (111195.12) -->
<process processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '111195.12' yres = '111195.12' resample='average' asscript='False' suffix = 'v7-f-m-1deg'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</process>
</africasubsahara>
Non-linear normalized difference
The non-linear normalized difference uses scale preserving transformation and rotation to combine two input vectors and produce a foreground (FG) and a background (BG) index. TWI is defined using vectors representing soil brightness and surface wetness, both derived from the Linear transformation. The Non-linear normalized difference transformation to derive TWI is calibrated to generate the largest difference between wet and dry regions. The process for the scale preserving transformation and rotation generating FG and BG is fgbgmodisRegion:
<?xml version='1.0' encoding='utf-8'?>
<africasubsahara>
<userproj userid = 'karttur' projectid = 'karttur-africasubsahara' tractid= 'karttur-africasubsahara' siteid = '*' plotid = '*' system = 'modis'></userproj>
<period startyear = "1998" endyear = "2018" endmonth ='7' endday = '31' timestep='M'></period>
<!-- tile the original (monthly) TRMM data to the region (karttur-africasubsahara).
The TRMM data must be downloaded and organized
If you set the parameter "asscript" to True (= default),
you have to execute the shell script file as reported by the process,
and then rerun the xml with overwrite set to False to add the layers to the database
-->
<!-- Tile the TRMM data to the MODIS tile standard spatial resolution (463 m) -->
<processx processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '463.313' yres = '463.313' resample='near' asscript='False'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</processx>
<!-- Tile the same data, but to a spatial resolution of 27798.78 m -->
<process processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '27798.78' yres = '27798.78' resample='near' asscript='False' suffix = 'v7-f-m-30km'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</process>
<!-- Tile the same data, but to a , but to a spatial resolution of approx 1 deg (111195.12) -->
<process processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '111195.12' yres = '111195.12' resample='average' asscript='False' suffix = 'v7-f-m-1deg'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</process>
</africasubsahara>
Conversion of TWI to percentage
TWI derived from the scale preserving transformation and rotation above is arbitrary scaled, and also non-linearly related to soil-moisture expressed as vol/vol or percent. For comparing TWI with other measures of soil-moisture, usually expressed as vol/vol, TWI needs to be converted to vol/vol, or percentage. Comparing TWI with ground probed soil-moisture I have defined an algorithm for this, and it can be implemented in the Framework using the process twipercentmodisRegion
<?xml version='1.0' encoding='utf-8'?>
<africasubsahara>
<userproj userid = 'karttur' projectid = 'karttur-africasubsahara' tractid= 'karttur-africasubsahara' siteid = '*' plotid = '*' system = 'modis'></userproj>
<period startyear = "1998" endyear = "2018" endmonth ='7' endday = '31' timestep='M'></period>
<!-- tile the original (monthly) TRMM data to the region (karttur-africasubsahara).
The TRMM data must be downloaded and organized
If you set the parameter "asscript" to True (= default),
you have to execute the shell script file as reported by the process,
and then rerun the xml with overwrite set to False to add the layers to the database
-->
<!-- Tile the TRMM data to the MODIS tile standard spatial resolution (463 m) -->
<processx processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '463.313' yres = '463.313' resample='near' asscript='False'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</processx>
<!-- Tile the same data, but to a spatial resolution of 27798.78 m -->
<process processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '27798.78' yres = '27798.78' resample='near' asscript='False' suffix = 'v7-f-m-30km'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</process>
<!-- Tile the same data, but to a , but to a spatial resolution of approx 1 deg (111195.12) -->
<process processid = 'tileRegionToModisAncillary' version = '1.3'>
<overwrite>False</overwrite>
<parameters src_defregid = 'trmm' epsg = '6842' xres = '111195.12' yres = '111195.12' resample='average' asscript='False' suffix = 'v7-f-m-1deg'></parameters>
<srcpath volume = "travel"></srcpath>
<dstpath volume = "travel"></dstpath>
<srccomp>
<trmm-3b43v7-precip source = "trmm" product = "3b43" folder = "rainfall" band = "trmm-3b43v7-precip" prefix = "rainfall" suffix = "v7-f-m">
</trmm-3b43v7-precip>
</srccomp>
</process>
</africasubsahara>
To view the maps and movies created in this post, click the Next button below.