genSmoothingIMA: Fill data gaps and smooth outliers in a time series of...

Description Usage Arguments Details Value References Examples

View source: R/genSmoothingIMA.R

Description

genSmoothingIMA is the implementation of a spatio temporal method called image mean anomaly (IMA) for gap filling and smoothing satellite data \insertCitemilitino2019interpolationRGISTools.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
genSmoothingIMA(
  rStack,
  Img2Fill = NULL,
  nDays = 3,
  nYears = 1,
  fact = 5,
  fun = mean,
  r.dates,
  aFilter = c(0.05, 0.95),
  only.na = FALSE,
  factSE = 8,
  predictSE = FALSE,
  snow.mode = FALSE,
  out.name = "outname",
  ...
)

Arguments

rStack

a RasterStack class argument containing a time series of satellite images. Layer names should contain the date of the image in "YYYYJJJ" format.

Img2Fill

a vector argument defining the images to be filled/smoothed.

nDays

a numeric argument with the number of previous and subsequent days that define the temporal neighborhood.

nYears

a numeric argument with the number of previous and subsequent years that define the temporal neighborhood.

fact

a numeric argument with an aggregation factor of the anomalies before the interpolation.

fun

a function used to aggregate the image of anomalies. Both mean (default) or median are acceptted.

r.dates

a vector argument containing the dates of the layers in rstack

aFilter

a vector with the lower and upper quantiles that define the outliers of the anomalies. Ex. c(0.05,0.95).

only.na

logical argument. If TRUE only fills the NA values. FALSE by default.

factSE

the fact used in the standard error prediction.

predictSE

calculate the standard error instead the prediction.

snow.mode

logical argument. If TRUE, the filling process will be parallelized using the 'raster' package.

out.name

the name of the folder containing the smoothed/filled images when saved in the Hard Disk Device (HDD).

...

arguments for nested functions:

  • AppRoot the path where the filled/smoothed time series of images will be saved in GTiff format.

Details

This filling/smoothing method was developed by \insertCitemilitino2019interpolation;textualRGISTools. This technique decomposes a time series of images into a new series of mean and anomaly images. The procedure applies the smoothing algorithm over the anomaly images. The procedure requires a proper definition of a temporal neighbourhood for the target image and aggregation factor.

Value

a RasterStack with the filled/smoothed images.

References

\insertRef

militino2019interpolationRGISTools

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# load an example of NDVI time series in Navarre
data(ex.ndvi.navarre)
# the 2 images to be filled and the neighbourhood
genPlotGIS(ex.ndvi.navarre)

# filled images
tiles.mod.ndvi.filled  <- genSmoothingIMA(ex.ndvi.navarre,
                               Img2Fill = c(1),
                               only.na=TRUE)
# show the filled images
genPlotGIS(tiles.mod.ndvi.filled)
# plot comparison of the cloud and the filled images
tiles.mod.ndvi.comp <- stack(ex.ndvi.navarre[[1]], tiles.mod.ndvi.filled[[1]],
                             ex.ndvi.navarre[[2]], tiles.mod.ndvi.filled[[2]])
genPlotGIS(tiles.mod.ndvi.comp, layout=c(2, 2))

## End(Not run)

RGISTools documentation built on July 2, 2020, 3:58 a.m.