[R-sig-Geo] Processing best quality MODIS pixels only (MODIS package)

Amit Boshale amit.boshale at yahoo.com
Tue May 19 16:54:30 CEST 2015


Hello!
I use MODIS package to smooth MODIS NDVI raster time series. 
Just wanted to try how would it look like if I used the best qulity pixels only.makeWeights function took about two days and resulted in raster stack of zeros. According to MODIS, the best qulity is 0, hence I used 0 as the threshold, is that correct? Is there a multicore version of makeWeights function?
Best,Amit
library("MODIS")path=("E:/NDVI/Indonesia")
#stack ndvi images, following MODIS package example
ndvi = preStack(pattern = "*_NDVI.tif", path = path)
timeInfo <- orgTime(ndvi,nDays=16,begin="2000049",end="2015049",pillow=40)
#Restack evi
ndvi <- preStack(files=ndvi,timeInfo=timeInfo)
#stack Vegtation index quality layers
VIqual <- stack(preStack(path=path, pattern="*_VI_Quality.tif", timeInfo=timeInfo))
bitShift = 2
bitMask = 15 
threshold=0 # based on MODIS documentation, quality 0 is the best
wt <- makeWeights(VIqual,bitShift,bitMask,threshold,decodeOnly=FALSE)
#stack composite day of the year layers
inT <- stack(preStack(path=path, pattern="*_composite_day_of_the_year.tif", timeInfo=timeInfo))
nodes <- 4
library(snow)
beginCluster(nodes)
system.time(whittaker.raster(vi=ndvi, wt=wt, inT=inT, timeInfo=timeInfo, lambda=500))
endCluster()



	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list