# NOT RUN {
# load in time series raster data
data(tura)
# run bfm on a pixel of known (x,y) location
bfm <- bfmPixel(tura, cell=c(820900, 831340), start=c(2005, 1))
print(bfm$cell) # check the corresponding cell index
# get bfm results for a pixel of known cell index
targcell <- 4064
bfm <- bfmPixel(tura, cell=targcell, start=c(2005, 1))
plot(bfm$bfm)
# try another monitoring period
bfm <- bfmPixel(tura, cell=targcell, start=c(2009, 1))
plot(bfm$bfm)
# try again using only ETM+ data (Landsat 7)
bfm <- bfmPixel(tura, cell=1068, start=c(2005, 1), sensor="ETM+")
plot(bfm$bfm)
# }
# NOT RUN {
# run bfm on a pixel chosen from the plot window
plot(tura, 6) # a cloudless scene from 2001
bfm <- bfmPixel(tura, start=c(2005, 1), sensor="ETM+", interactive=TRUE)
plot(bfm$bfm)
print(targcell <- bfm$cell) # store cell index for follow-up analysis
## change the model parameters
# 1. harmonic order
bfm <- bfmPixel(tura, cell=targcell, start=c(2005, 1), sensor="ETM+", order=3)
plot(bfm$bfm)
# 2. no trend
bfm <- bfmPixel(tura, cell=targcell, start=c(2005, 1), sensor="ETM+", order=3, formula=response~harmon)
plot(bfm$bfm)
# 3. trend only
bfm <- bfmPixel(tura, cell=targcell, start=c(2005, 1), sensor="ETM+", formula=response~trend)
plot(bfm$bfm)
# }
Run the code above in your browser using DataLab