TrendNCDF {greenbrown}R Documentation

Calculate trends and trend statistics on time series in gridded (raster) data stored in a NetCDF file

Description

This function computes temporal trend and trend breakpoints on multi-temporal raster data that is stored in a NetCDF file. To calculate trends on the values of each grid cell the function Trend is used. Before using these methods on satellite time series (especially NDVI time series) the descriptions and recommendations in Forkel et al. (2013) should be considered. The function applies the function TrendRaster on a NetCDF file and saves the results as NetCDF files. Additionally, several summary raster layers are saved as NetCDF files too. Thus, it can potentially simplify the workflow.

Usage

TrendNCDF(file, start = c(1982, 1), freq = 12, method = "AAT", 
    mosum.pval = 0.05, h = 0.15, breaks = 1, funSeasonalCycle = MeanSeasonalCycle, 
    funAnnual = mean, ...)

Arguments

file

NetCDF file with file extention *.nc

start

beginning of the time series (i.e. the time of the first observation). The default is c(1982, 1), i.e. January 1982 which is the usual start date to compute trends on long-term series of satellite observations of NDVI. See ts for further examples.

freq

The frequency of observations. The default is 12 for monthly observations. Use 24 for bi-monthly observations, 365 for daily observations or 1 for annual observations. See ts for further examples.

method

method to be used for trend calculation with the following options:

  • AAT (default) calculates trends on annual aggregated time series (see TrendAAT for details). This method will be automatically choosen if the time series has a frequency of 1 (e.g. in case of annual time steps). If the time series has a frequency > 1, the time series will be aggregated to annual time steps using the mean.

  • STM fits harmonics to the seasonal time series to model the seasonal cycle and to calculate trends based on a multiple linear regression (see TrendSTM for details).

  • SeasonalAdjusted removes first the seasonal cycle from the time series and calculates the trend on the reaminder series (see TrendSeasonalAdjusted for details).

mosum.pval

Maximum p-value for the OLS-MOSUM test in order to search for breakpoints. If p = 0.05, breakpoints will be only searched in the time series trend component if the OLS-MOSUM test indicates a significant structural change in the time series. If p = 1 breakpoints will be always searched regardless if there is a significant structural change in the time series or not. See sctest for details.

h

minimal segment size either given as fraction relative to the sample size or as an integer giving the minimal number of observations in each segment. See breakpoints for details.

breaks

maximal number of breaks to be calculated (integer number). By default the maximal number allowed by h is used. See breakpoints for details.

funSeasonalCycle

a function to estimate the seasonal cycle of the time series if SeasonalAdjusted is selected as method. An own function can be defined to estimate the seasonal cycle which has to return the seasonal cycle as a time series of class ts. Currently two approaches are part of this package:

funAnnual

function to aggregate time series to annual values if AAT is selected as method. The default function is the mean (i.e. trend calculated on mean annual time series). See TrendAAT for other examples

...

Details

The maximum number of breakpoints should be specified in this function. If breaks=0 no breakpoints will be computed. If breaks=1 one breakpoint can be detected at maximum per grid cell. In this case the result will be reported for two time series segments (SEG1 before the breakpoint, SEG2 after the breakpoint). Some of the trend methods are very slow. Applying them on multi-temporal raster datasets can take some time. Especially the methods that work on the full temporal resolution time series (STM and SeasonalAdjusted) are slower than the method AAT. Especially if breakpoints are computed the computations take longer. The computation of breakpoints can be suppressed by choosing breaks=0. For large rasters it is recommended to first split the raster dataset in several tiles and to compute the trends on each tile separately. The use of a high performance computing infrastructure it also advantageous. All methods work with missing observations (for example missing NDVI observation in winter months with snow cover). Missing observation have to be flagged with NA. All time steps have to be included in the RasterBrick for trend analysis. If complete time steps are missing, they need to be included as layers (filled with NA values) in the RasterBrick to form a continuous time series.

Value

The function saves several NetCDF files in directory on disc. The files are created based on the filename of the input file:

Author(s)

Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]

References

Forkel, M., N. Carvalhais, J. Verbesselt, M. Mahecha, C. Neigh and M. Reichstein (2013): Trend Change Detection in NDVI Time Series: Effects of Inter-Annual Variability and Methodology. - Remote Sensing 5.

See Also

TrendRaster, Trend, TrendClassification, TrendLongestSEG, TrendSegmentsRaster, NamesTrendRaster


[Package greenbrown version 2.4.3 Index]