Archive for the ‘ecosystem model’ Category

Large-scale vegetation-rainfall correlations in Africa

Weather and climatic variability affect vegetation on continental scales. Intuitively, healthy vegetation is greener. A quantitative index of “greenness” called Normalised Difference Vegetation Index (NDVI) was developed by NASA.  The index takes values between 0 and 1. NDVI is related to the fraction of photosynthetically active radiation absorbed by the vegetation canopy. It is a powerful tool in vegetation monitoring.

Quantifying the relationship between weather and vegetation on a regional scale is a statistical problem which requires long time-series of NDVI. GIMMS is a 25 year (1981-2006) NDVI dataset based on inputs from a sequence of NOAA weather satellites carrying AVHRR radiometers. The GIMMS team removed satellite drift, calibration effects etc.[1] Of course NDVI has a complex spatial variation which is related to variations in vegetation cover type, not to weather variations. To isolate the impact of weather variations, it makes sense to “standardize” NDVI. Vegetation Condition Index (VCI) is:

latex VCI=\frac{NDVI \; \:-\; \:NDVI_{min}}{NDVI_{max}-NDVI_{min}}

For example, NDVImin might refer to the minimum local May NDVI value observed during 1981-2006. A tropical rainforest and a semi-arid region have very different NDVI, but both may have VCI close to 1 during a favourable period.

The maps below show the correlation between VCI and 3-month Standardized Precipitation Index (SPI3) computed for Africa by calendar month. GIMMS 8km NDVI was upscaled to 200km to match the scale of gridded monthly climate datasets for precipitation (GPCP).[2] The red areas correspond to areas of high correlation between VCI and SPI3. Vegetation in these areas responsive to rainfall variations on a 3-month timescale. A striking feature  is the line high correlation in the Sahel region. Vegetation in the Sahel is highly sensitive to drought. Southern Africa is also highly rainfall sensitive during Dec-May. It is impressive that the combination of datasets of very different origins (GPCP and GIMMS) produces spatially and temporally consistent information.

Sensitivity of Vegetation to Precipitation 1981-2006


R code snippets

Most of the effort is in pre-processing the climate and NDVI data so that they share the same projection, grid, time coordinate etc. GDAL and the interp() function from the akima package were used for this purpose. Eventually we end up with SPI3 and VCI data represented by N × T matrices where N = Nx ×Ny is the dimension of the spatial maps and T is the number of observations. From there,  SPI3 and VCI maps were organized by calendar month,

vci.m <- lapply(seq(1:12),function(m) vci[,seq(from=m, to=T, by=12)])
spi3.m <- lapply(seq(1:12), function(m) spi3[,seq(from=m, to=T, by=12)])

Correlation maps between VCI and SPI3  for each calendar month are obtained from,

corr.maps <- lapply(seq(1:12),function(m) sapply(seq(1:N), function(i) cor( vci.m[[m]][i,],spi3.m[[m]][i,]) ))

Finally the above map table was produced using spplot() from the sp package with overlays from the maps package.

[1]  Tucker, C.J., J.E. Pinzon, and M.E. Brown (2004), Global Inventory Modeling and Mapping Studies, NA94apr15b.n11-VIg, 2.0, Global Land Cover Facility, University of Maryland, College Park, Maryland, 04/15/1994.

[2] SG: Adler, R.F., G.J. Huffman, A. Chang, R. Ferraro, P. Xie, J. Janowiak, B. Rudolf, U. Schneider, S. Curtis, D. Bolvin, A. Gruber, J. Susskind, P. Arkin, 2003: The Version 2 Global Precipitation Climatology Project (GPCP) Monthly Precipitation Analysis (1979-Present). J. Hydrometeor., 4,1147-1167.

Mapping Biomes

Recently (2008) the European Space Agency produced GlobCover (ESA GlobCover Project, led by MEDIAS-France), the highest resolution (300m) global land cover map to date. GlobCover uses 21 primary land cover classes and many more sub-classes. Land cover classification (LCC) schemes divide the earth into biomes. Biomes are the simplest way to classify vegetation which can be applied globally. LCC makes sense because the boundaries between different ecosystems (ecotones) are sharp. However, definitions vary and there is no agreed standard set of biomes.[1]

GlobCover Example

Puntarenas is a province on the pacific coast of Costa Rica.  The province has a typical mix of tropical land cover. This includes some spectacular examples of Pacific Rainforest, notably on the Osa Peninsula. Puntarenas has an area of ≈ 11,000 sq. km or about 120,000 GlobCover pixels.

13 land cover types are present in the GlobCover map below. The barplot on the right shows the total amounts present in each class.



The GlobCover legend (above) has mixed land cover classes, where more than one biome occurs  inside a map pixel. This is especially true in the man-made biomes (agriculture) . For example, there are three cropland land cover types depending on the relative amounts of other vegetation present.

GlobCover map making in R

R is a programming language, not a specialised geographic information system (GIS) such as GRASS or commercial packages. However applications of R to spatial problems is a growth industry.[2]

A GlobCover map similar to the above can be produced for any area of interest. The Geospatial Data Abstraction Library (GDAL) should be installed on your system. FWTools is the place to go. You also need R packages sp and rgdal installed. The regional GLOBCOVER map for Central America can be downloaded from ESA here. GlobCover is in GeoTiff format i.e. a Tiff image file which contains georeferencing information. The following GDAL command (from command line, or run from R using shell) creates a 4° x 4° submap centred on Costa Rica.

gdalwarp GLOBCOVER_200412_200606_V2.2_CentralAmerica_Reg.tif -te -86 8 -82 12 costaRica.tif

costaRica.tif is read into R using the rgdal package:

costa <- readGDAL("costaRica.tif")

costa has class SpatialGridDataFrame, which is a class defined in the package sp (loaded when rgdal is loaded).

Administative boundaries for Costa Rica were obtained from Global Administrative Areas (see Revolution R blog post)

con <- url("")

Costa Rican provinces are now contained in the object gadm of class SpatialPolygonsDataFrame. The boundaries of Puntarenas province (excluding Cocos Island) are extracted as follows:

temp <- SpatialPolygons(list(temp),proj4string=CRS(proj4string(gadm)))
punt.sp <- SpatialPolygonsDataFrame(temp, data.frame(cbind(2,2), row.names=c("puntarenas")))  # puntarenas

The overlay() method  is used to extract the land cover map puntarenas from costa:

puntarenas <- costa
puntarenas.overlay <- overlay(costa,punt.sp)  # 1 in interior of puntarenas polygons, 0 outside
puntarenasband1 <- costaband1*puntarenas.overlay

Unfortunately overlay() is rather slow, because it applies to the entire raster. Eventually puntarenas appears as a SpatialGridDataFrame which can be plotted using standard R tools such as image().

The code needed to generate the above plot is here.


[1] For example, the International Biosphere-Geosphere Programme (IGBP) land cover legend used 17 biomes. The University of Maryland map used 14 biomes. At much lower resolution, numerical weather forecasting models such as US National Center for Climate Prediction Global Forecasting System (NCEP-GFS) also use alternative schemes.


[2] Roger S. Bivand, Edzer J. Pebesma, and Virgilio Gómez-Rubio. Applied Spatial Data Analysis with R. Springer, New York, 2008