rsat_smoothing_images | R Documentation |
apply_ima
is the implementation of a spatio-temporal method
called Interpolation of Mean Anomalies(IMA) for gap filling and smoothing
satellite data \insertCitemilitino2019interpolationrsat.
smoothing_images
is the implementation of a spatio temporal method
called image mean anomaly (IMA) for gap filling and smoothing satellite
data \insertCitemilitino2019interpolationrsat.
rsat_smoothing_images(x, method, ...)
## S4 method for signature 'rtoi,character'
rsat_smoothing_images(
x,
method,
product = "ALL",
satellite = "ALL",
stage = "ALL",
variable = "ALL",
test.mode = FALSE,
...
)
## S4 method for signature 'SpatRaster,character'
rsat_smoothing_images(x, method, ...)
x |
|
method |
character argument. Defines the method used for processing the images, e.a. "IMA". |
... |
arguments for nested functions:
|
product |
character argument. The name of the product to
be processed. Check the name of the parameter with |
satellite |
character argument. The name of the satellite to
be processed. Check the name of the parameter with
|
stage |
character argument. The name of the processed stage
of the data. Check the name of the parameter with
|
variable |
character argument.The name of the variable to
be processed. Check the name of the parameter with
|
test.mode |
logical argument. If |
This filling/smoothing method was developed by
\insertCitemilitino2019interpolation;textualrsat. IMA fills the gaps
borrowing information from an adaptable temporal neighborhood. Two
parameters determine the size of the neighborhood; the number of days
before and after the target image (nDays
) and the number of previous
and subsequent years (nYears
). Both parameters should be adjusted
based on the temporal resolution of the of the time-series of images. We
recommend that the neighborhood extends over days rather than years, when
there is little resemblance between seasons. Also, cloudy series may require
larger neighborhoods.
IMA gives the following steps; (1) creates a representative image from the
temporal neighborhood of the target image (image to be filled/smoothed) e.g.,
doing the mean, median, etc. for each pixel's time-series (fun
), (2)
the target and representative images are subtracted giving an image of
anomalies, (3) the anomalies falling outside the quantile limits
(aFilter
) are considered outliers and therefore removed, (4) it
aggregates the anomaly image into a coarser resolution (fact
) to
reveal potential spatial dependencies, (5) the procedure fits a spatial
model (thin plate splines or TPS) to the anomalies which is then used to
interpolate the values at the original resolution, and (6) the output
is the sum of the interpolated anomalies and the average image.
a RastespatRaster
with the filled/smoothed images.
militino2019interpolationrsat
## Not run:
## Smooth data in rtoi
library(rsat)
require(terra)
# create a copy of pamplona in temp file
file.copy(from=system.file("ex/PamplonaDerived",package="rsat"),
to=tempdir(),
recursive = TRUE)
# load example rtoi
pamplona <- read_rtoi(file.path(tempdir(),"PamplonaDerived"))
rsat_smoothing_images(pamplona,
method = "IMA",
variable="NDVI"
)
rsat_list_data(pamplona)
# get smoothed
smoothed <- rsat_get_SpatRaster(pamplona,p="mod09ga",v="NDVI",s="IMA")
plot(smoothed)
# get original
original <- rsat_get_SpatRaster(pamplona,p="mod09ga",v="NDVI",s="variables")
plot(original)
plot(smoothed[[1]]-original[[1]])
## smooth user defined SpatRaster dataset
require(terra)
data(ex.ndvi.navarre)
# load an example of NDVI time series in Navarre
ex.ndvi.navarre <- rast(ex.ndvi.navarre)
# the raster stack with the date in julian format as name
plot(ex.ndvi.navarre)
# smoothin and fill all the time series
tiles.mod.ndvi.filled <- rsat_smoothing_images(ex.ndvi.navarre,
method = "IMA"
)
# show the filled images
plot(tiles.mod.ndvi.filled)
# plot comparison of the cloud and the filled images
tiles.mod.ndvi.comp <- c(
ex.ndvi.navarre[[1]], tiles.mod.ndvi.filled[[1]],
ex.ndvi.navarre[[2]], tiles.mod.ndvi.filled[[2]]
)
plot(tiles.mod.ndvi.comp)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.