compare_raster_space: Compare Spatial Consistency of Two Rasters

Description Usage Arguments Value Author(s) References Examples

Description

Analysis of the spatial consistency (agreement) of two Raster-class objects with dimensions x (lon), y (lat), z (time). The analysis is performed layer by layer. At a given z, an entire layer is extracted in in the two rasters and the two layers are compared using a set of statistics. This results in a time serie for each computed statistic, depicting the temporal profile (seasonality) of the spatial coherence (agreement) between the two datasets.

Usage

1

Arguments

x

A Raster-class object. Better be a RasterBrick, for faster computing

y

Another Raster-class object to compare with the first one

lc

An optional raster object giving classes for which separate statistics are retrieved

stats

A character vector with one or more of the following: 'missing', 'cor', 'ax', 'ay', 'bx', 'by', 'ac','acu', 'acs', 'mbe', 'rmsd', 'rmspd', 'rmpdu', 'rmpds','mpdpu','mpdps'. See details The stats arguments can take one or more of the following values (see Ji and Gallo, 2006):

  • missing Number of missing values in the x and y raster

  • cor Correlation coefficient

  • ax Intercept of the Geometric Mean Functional Relationship (GMFR) model x = a + by

  • ay Intercept of the GMFR model y = a + bx

  • bx Coefficient of the GMFR model x = a + by

  • by Coefficient of the GMFR model y = a + bx

  • ac Agreement Coefficient

  • acu Unsystematic Agreement Coefficient

  • acs Systematic Agreement Coefficient

  • mbe Mean Bias Error

  • rmsd Root Mean Square Deviation

  • rmspd Root Mean Square Deviation in percentage of mean y

  • rmpdu Unsystematic Square Root of Mean Product-difference

  • rmpds Systematic Square Root of Mean Product-difference

  • mpdpu Proportion of the unsystematic differences over the total difference

  • mpdps Proportion of the systematic differences over the total difference

Value

an array of statistics with 1st dimension corresponding to layers in input rasters, 2nd dimension to stats and optional 3rd dimension to classes defined by lc

Author(s)

Antoine Stevens

References

Ji, L., and Gallo, K. (2006). An Agreement Coefficient for Image Comparison. Photogrammetric Engineering & Remote Sensing 72, 823-833. Meroni, M., Atzberger, C., Vancutsem, C., Gobron, N., Baret, F., Lacaze, R., Eerens, H., and Leo, O. (2013). Evaluation of Agreement Between Space Remote Sensing SPOT-VEGETATION fAPAR Time Series. IEEE Transactions on Geoscience and Remote Sensing 51, 1951-1962. Meroni M., Fasbender D., Balaghi et al. (2015). Testing VGT data continuity between SPOT and PROBA-V missions for operational yield forecasting in North African countries. JRC Technical Report, 28 p.

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
33
34
35
36
37
38
39
## Not run: 
# Let's compare VGT and PROBA-V instruments during their overlaping period
# (October 2013 - March 2014)
# Don't forget to provide in copernicus_options() your user and password details
# for COPERNICUS data portal before running this
# e.g. : copernicus_options(user = "Smith", password = "hello")
# First, get data for NDVI_1km_V1
fn_SPOT <- download_copernicus(product = 'NDVI_1km_V1', begin = '2013-10-01', end = '2014-03-31',
                     tileH = 19, tileV = 4)
# and NDVI_1km_V2 ...
fn_PROBA <- download_copernicus(product = 'NDVI_1km_V2', begin = '2013-10-01', end = '2014-03-31',
                     tileH = 19, tileV = 4)
# Extract NDVI, export to tif
f_SPOT <-extract_copernicus(fn_SPOT,job = "product_comparison",layers = 2)
f_PROBA <-extract_copernicus(fn_PROBA,job = "product_comparison",layers = 1)

# Convert to  rasterBrick
f_SPOT <- sub('\\.h5','_NDVI.tif',f_SPOT)
f_PROBA <- sub('\\.h5','_NDVI.tif',f_PROBA)
SPOT  <- writeRaster(stack(f_SPOT),filename = rasterTmpFile())
PROBA  <- writeRaster(stack(f_PROBA),filename = rasterTmpFile())
# Compare their spatial consistency
# by land cover class
# Create a fake LC map
lc <- raster(SPOT)
values(lc) <- as.numeric(cut(1:ncell(lc), 3))
cs <- compare_raster_space(SPOT,PROBA,lc)
str(cs)
# plot the three classes
# get correlation coeff
r <- cs[,"cor",]
# get acquisition dates
d <- scan_file_copernicus(names(SPOT))$Date
plot(d,r[,1],type = "l",xlab = "", ylab = "Correlation coefficient",ylim=c(0,1))
lines(d,r[,2],col = "red")
lines(d,r[,3],col = "blue")
legend("bottomright",lty = 1, legend = paste0("class ", 1:3), col = c("black","red","blue"))

## End(Not run)

antoinestevens/copernicus documentation built on May 10, 2019, 12:23 p.m.