Learn R Programming

calcWOI (version 1.0.3)

WOI: Calculates WOI, modified WOI and LWOI

Description

This function calculates the wavelet-based organization index (WOI) as defined in Brune et al. (2018), a modified version of WOI and the local WOI using DaubExPhase4 wavelet.

Usage

WOI(x = x, s = c(1, 3), l = c(4, 7), thres = 0.1, flat = 25,
    verbose = FALSE, periodic = FALSE)

Arguments

x

2D numeric array with dimensions larger than 16 x 16. dim(x)[1] has not to be equal to dim(x)[1], but NA and/or NaN are not allowed.

s

Vector (length 2) of smallest small convective scale and largest small convective scale. Default: s = c(1, 3).

l

Vector (length 2) of smallest large convective scale and largest large convective scale. Default: l = c(4, 7).

thres

0 or a positive number. Threshold for rain rate. Default is 0.1 mm/h, because we calculate LWOI only for grid points, where rain rate is >= 0.1 mm/h.

flat

The number of grid points at each side, which should be smoothed lineraly. Default is 25. For quadratic arrays with dimension 2^n x 2^n boundaries are not smoothed and flat is a dummy variable.

verbose

If TRUE, the function prints progress statements and calculation time. Default is FALSE.

periodic

If TRUE, the field x is already of size 2^n x 2^n and has perdiodic boundaries. Default is FALSE.

Value

This functions returns a list with follwing elements:

WOI1orig

Original WOI1 (but calculated with DaubExPhase4).

WOI2orig

Original WOI2 (but calculated with DaubExPhase4).

WOI3orig

Original WOI3 (but calculated with DaubExPhase4).

WOIorig

Original WOI (but calculated with DaubExPhase4).

WOI1

Modified WOI1.

WOI2

Modified WOI2.

WOI3

Modified WOI3.

WOI

Modified WOI.

LWOI1

2D array of LWOI1.

LWOI2

2D array of LWOI2.

LWOI3

2D array of LWOI3.

LWOI

2D array of LWOI.

s

Smallest and largest small convective scale.

l

Smallest and largest large convective scale.

flat

The number of grid points at each side, which are smoothed.

quad

TRUE or FALSE, if the ingoing array is quadratic and 2^n x 2^n.

thres

Threshold of LWOI calculation.

RR

Ingoing array.

ts

Computation time in seconds.

Warning

This function calculates WOI/LWOI only for arrays up to 2048 x 2048. Minimum size is 16 x 16.

References

Brune, S., Kapp, F., & Friederichs, P. (2018). A wavelet-based analysis of convective organization in ICON large-eddy simulations. Quarterly Journal of the Royal Meteorological Society, 144(717), 2812-2829.

Examples

Run this code
# NOT RUN {
# Random array of dim 350 x 300
x <- array((rnorm(350*300)), dim = c (350, 300))
s <- c(1, 2)
l <- c(3, 4)
thres <- 0.1
flat <- 25
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(1, 2))
image(WOIres$RR, main = "Rain")
image(LWOI, main = "LWOI")
# }

Run the code above in your browser using DataLab