TimeSeriesAnalysis: NDVI Time Series Extraction and Analysis

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Extract NDVI time series from different data source. Group points or polygon together, compute savitzky-Golay filter. Also exectute a basic analysis (STL decomposition).

Usage

1
2
3
4
5
TimeSeriesAnalysis(shapefile, shapedir, ndvidirectory, region,
    Ystart, Yend, outfile = "TS.txt", outfile2 = "TS.pdf", 
    outfile3 = FALSE, shapeext = "shp", fct = "mean", 
    SGfilter = TRUE, nSG = "5,5", DSG = 0, 
    title = "NDVI time series", type = "VITO_CLIP", nb = NULL)

Arguments

shapefile

name of the shape/kml file with multi-points or polygons from where time series are extracted.
For a shapefile called ‘name.shp’ , shapefile="name".
For a kml file, write the name of the layer.

shapedir

path to the shape/kml file.
For a shapefile, shapedir is the path to the folder containing the shapefile. For example if the directory of the shapefile is ‘C:/Dir/name.shp’, shapefile="C:/Dir/".
For a kml file, shapedir is the full directory of the kml file. For example shapefile="C:/Dir/name.kml".
Please note that paths to files in R can be specified with either "/" or "\\" in Windows OS and "/" in UNIX OS.

ndvidirectory

path to the ndvi images folder (GeoTIFF files).
Please note that paths to files in R can be specified with either "/" or "\\" in Windows OS and with "/" in UNIX OS

region

name of the region, same as in the name of the ndvi images.
Please refer to details section for more information on the nomenclature.

Ystart

starting year of the analysis (in four-digit format).

Yend

ending year of the analysis (in four-digit format).

outfile

name of the file where the time series are saved (extension ".txt").
By default, outfile = " .".

outfile2

file where the seasonal decomposotion of the time serie is saved (extenstion ".pdf"). By default, outfile2="TS.pdf".

outfile3

file where the graphs of the different time serie (stocked) is saved (extenstion ".pdf"). If outfile3=FALSE, graphs are displayed in R (but not saved). By default, outfile3=FALSE

shapeext

extension of the shape/kml file : "shp" for a Esri shapefile or "kml" for a kml file from Google earth .
By default, shapeext = "shp".

fct

function applied while grouping points of a same categorie together : "mean","max" or "min". By default, fct="mean".

SGfilter

TRUE to apply a Savitzky-Golay filter to the time series, FALSE otherwize. By default, SGfilter=TRUE.

nSG

moving window of the Savitzky-Golay filter. By default, nSG="5,5" (symetric windows taking into account 5 points backward and 5 points forward.

DSG

polynomial degree of the function use in the Savitzky-Golay filter. By default, DSG=0.

title

title of the graph (saved in outfile3) By default, title="NDVI time series".

type

type of nomenclature followed by the NDVI images : "VITO_CLIP", "VITO_VGT" or "GIMMS" (see details for more information).
By default, type = "VITO_CLIP". type of nomenclature followed by the NDVI images : "GIMMS", "VITO_VGT", "VITO_CLIP", "TEXT" or "FILES" (see details for more information).
By default, type = "VITO_CLIP".

nb

number of time series plotted in the same graph by the function PlotTS saved in the file outfile3. By default, nb = NULL : will be automatically chosen depending on the number of time series.

Details

More about the variable type :
type=GIMMS : nomenclature from Global Land Cover Facility
[RE][YY][MMM][DDD].[SAT]-VIg.tif

type=VITO_VGT : FreeVGT VITO's nomenclature
NDV_[YYYYMMDD]_[REGION]_Extract.tif

type=VITO_CLIP : nomenclature after clipping the images in a particular region.
[REGION][YYYY]M[MM]P[D].tif

type = FILES : ndvidirectory should contain a file respecting the following format :
N
path\image1.tif
path\image2.tif
...
path\imageN.tif
with N the number of image files.
The list of images should be in chronological order, and include the complete path to the file, unless the files are located in the working directory from which R is run. Only the N first images in the file will be processed. nomenclature after clipping the images in a particular region.

Value

data.frame with the extracted and processed time series.

Author(s)

R. Frelat, B. Gerard

See Also

ExtractFile, ExtractGIMMS, ExtractVGT, ExtractVito, normNDVI, PlotTS, STLperArea

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#local variables
ndvidirectory=paste(system.file("extdata/VITO_Mzimba",
    package="ndvits"), "/", sep="")
region="Mzimba"
Ystart=2004
Yend=2009
shape="SLP_Mzimba"
shapedir=paste(system.file("extdata/shape", package="ndvits"),
    "/", sep="")
outfile = "mzimbaTS.txt"
outfile2 = "MzimbaTS.pdf"

#executing TimeSeriesAnalysis
## Not run: signal = TimeSeriesAnalysis(shape, shapedir, ndvidirectory, region,
     Ystart, Yend, outfile, outfile2)
# Enter "Village" when asked

## End(Not run)

ndvits documentation built on May 2, 2019, 4:47 p.m.