天天看點

R語言處理GIMMS NDVI3g資料

GIMMS NDVI3g 資料

植被指數是對植被冠層綠葉中葉綠素吸收的光合有效輻射的輻射度量,是以是該地區生理功能表面綠度水準的良好替代度量。在1980年代初的一系列文章中,康普頓·塔克(Compton J. Tucker)展示了如何利用NOAA的超高分辨率高分辨率輻射計(AVHRR)資料生成的歸一化植被指數(NDVI)來繪制土地覆寫圖并監測植被變化和荒漠化在大陸和全球範圍内。在Web of Science上的簡單搜尋顯示标題或摘要中包含NDVI的5000多篇文章。康普頓·塔克(Compton J.Tucker)在過去30年中,在全球庫存監控和模組化系統(GIMMS)項目的架構内繼續生成NDVI時間序列,并通過不同的AVHRR傳感器精心組裝,并考慮了各種有害影響,例如校準GIMMS NDVI資料集的最新版本橫跨1981年7月至2011年12月,被稱為NDVI3g(來自AVHRR傳感器的第三代GIMMS NDVI)。

注意:此資料集已有更新。最新版本3g.v1跨度為1981年7月至2015年12月。原始版本3g.v0保留在原位置,并且仍可以通路。

下載下傳位址:資料可以直接在這裡下載下傳 https://ecocast.arc.nasa.gov/data/pub/gimms/

R語言下載下傳處理GIMMS NDVI3g資料

這裡介紹一個R語言包gimms,下面介紹一些常用的處理方法。

.nc4格式轉.tif格式

library(\'raster\')
library("gimms","rgdal")

input<- \'G:/ndvi_GIMMS3g/data\'
out<- \'G:/ndvi_GIMMS3g/data_tif\'

for (value in 1981:2015) {

  fn1 <- paste0(input,"/ndvi3g_geo_v1_",value,"_","0712",".nc4")

  print(paste0("正在讀取...%s_%s",value,"0712"))

  ndvi3g <- rasterizeGimms(x = fn1)

  for (variable in 1:12) {

    name <- paste0(out,"/ndvi3g_geo_v1_",value,"_","0712","-",variable,".tif")

    print(paste0("正在處理...%s",name))

    writeRaster(x = ndvi3g[[variable]],filename = name, overwrite=TRUE)

  }

}

for (value in 1982:2015) {
  
  fn1 <- paste0(input,"/ndvi3g_geo_v1_",value,"_","0106",".nc4")
  
  print(paste0("正在讀取...%s_%s",value,"0106"))

  ndvi3g <- rasterizeGimms(x = fn1)
  
  for (variable in 1:12) {
    
    name <- paste0(out,"/ndvi3g_geo_v1_",value,"_","0106","-",variable,".tif")
    
    print(paste0("正在處理...%s",name))
    
    writeRaster(x = ndvi3g[[variable]],filename = name, overwrite=TRUE)
    
  }
  
}
           

最大月合成

library(\'sp\')
library(\'raster\')
library(\'gimms\')
library(\'rgdal\')

input<- \'G:/ndvi_GIMMS3g/data\'
out<- \'G:/ndvi_GIMMS3g/data_mvc\'

for (value in 1981:2015) {

  fn1 <- paste0(input,"/ndvi3g_geo_v1_",value,"_","0712",".nc4")

  print(paste0("正在讀取...%s_%s",value,"0712"))

  ndvi3g <- rasterizeGimms(x = fn1)

  mvc <- monthlyComposite(ndvi3g,indices = monthlyIndices(fn1))

  for (variable in 1:6) {

    mon<- 6+variable

    if(mon<10){

      name <- paste0(out,"/ndvi3g_geo_v1_",value,"_","0712","_0",mon,".tif")

    }else{

      name <- paste0(out,"/ndvi3g_geo_v1_",value,"_","0712","_",mon,".tif")

    }

    print(paste0("正在處理...%s",name))

    writeRaster(x = mvc[[variable]],filename = name, overwrite=TRUE)

  }

}

for (value in 1982:2015) {
  
  fn1 <- paste0(input,"/ndvi3g_geo_v1_",value,"_","0106",".nc4")
  
  print(paste0("正在讀取...%s_%s",value,"0106"))
  
  ndvi3g <- rasterizeGimms(x = fn1)
  
  mvc <- monthlyComposite(ndvi3g,indices = monthlyIndices(fn1))
  
  for (variable in 1:6) {
    
    mon<- variable
    
    if(mon<10){
      
      name <- paste0(out,"/ndvi3g_geo_v1_",value,"_","0712","_0",mon,".tif")
      
    }else{
      
      name <- paste0(out,"/ndvi3g_geo_v1_",value,"_","0712","_",mon,".tif")
      
    }
    
    print(paste0("正在處理...%s",name))
    
    writeRaster(x = mvc[[variable]],filename = name, overwrite=TRUE)
    
  }
  
}