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

Description Usage Arguments Details Value References Examples

Description

genSmoothingCovIMA runs the image mean anomaly (IMA) algorithm with covariates \insertCitemilitino2018improvingRGISTools.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
genSmoothingCovIMA(
  rStack,
  cStack,
  Img2Process = NULL,
  nDays = 3,
  nYears = 1,
  r.dates,
  fact = 5,
  fun = mean,
  aFilter = c(0.05, 0.95),
  snow.mode = FALSE,
  out.name = "out",
  ...
)

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.

cStack

a RasterStack class argument containing a time series of covariates.

Img2Process

a vector class 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.

r.dates

a vector argument containing the dates of the layers in rstack

fact

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

fun

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

aFilter

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

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 filled/smoothed images when saved in the Hard Disk Drive (HDD).

...

arguments for nested functions:

  • AppRoot the path where the filled/smoothed time series of images are saved as GTiff.

Details

This filling/smoothing method was developed by \insertCitemilitino2018improving;textualRGISTools. This technique decomposes a time series of images into a new series of mean and anomaly images. The procedure applies the filling/smoothing algorithm with covariates 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

militino2018improvingRGISTools

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 
set.seed(0)
# load example ndvi and dem data of Navarre
data(ex.ndvi.navarre)
data(ex.dem.navarre)
# plot example data
genPlotGIS(ex.ndvi.navarre)
genPlotGIS(ex.dem.navarre)

# distorts 5% of the original ndvi data by 
# altering 50% its values
for(x in c(2,5)){
  aux <- sampleRandom(ex.ndvi.navarre[[x]],
                      ncell(ex.ndvi.navarre) * 0.05,
                      cells = TRUE,
                      na.rm = TRUE)
  ex.ndvi.navarre[[x]][aux[,1]] <- aux[,2] * 1.5
}
genPlotGIS(ex.ndvi.navarre)

# smoothing the image using the DEM as covariate
smth.ndvi <- genSmoothingCovIMA(rStack = ex.ndvi.navarre,
                                cStack = ex.dem.navarre,
                                Img2Process = c(2))
# plot the distorted 1, smoothed 1, 
# distorted 5, smoothed 5 images
plot(stack(ex.ndvi.navarre[[2]],
                 smth.ndvi[[1]],
                 ex.ndvi.navarre[[5]],
                 smth.ndvi[[2]]))

## End(Not run)

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