# NOT RUN {
# Calculate WOI, modified WOI and LWOI for a random precipitation
# field using an 230x200 array with
# random positive numbers
x <- array(5 + rnorm(230*200), dim = c(230, 200))
s <- c(1,2)
l <- c(3,4)
thres <- 0.1
flat <- 5
WOIres <- WOI (x = x, s = s, l = l, thres = thres, flat = flat,
verbose = TRUE)
# original WOI (Brune et al., 2018)
WOIorig <- WOIres$WOIorig
print(paste("Original WOI:", WOIorig))
# modified WOI
WOI <- WOIres$WOI
print(paste("Modified WOI:", WOI))
# local WOI
LWOI <- WOIres$LWOI
par(mfrow = c(2, 2))
image(LWOI, main = "LWOI")
# Calculate the three components of the
# local wavelet-based organization index with Dual-tree wavelets
LW <- LW(x, thres = thres, Nx = 2^ceiling(log2(max(dim(x)))),
Ny = 2^ceiling(log2(max(dim(x)))), boundaries = "pad")
image(LW$LWsc, main = "LWsc", zlim = 0:1)
image(LW$LWin, main = "LWin", zlim = 0:1)
image(LW$LWai, main = "LWai", zlim = 0:1)
# }
Run the code above in your browser using DataLab