dims <- c(time = 100, lat = 5, lon = 4)
temp_cube <- list(
data = array(
runif(prod(dims), min = 15, max = 35),
dim = dims
),
attrs = list(
Variable = list(varName = '2m Temperature')
)
)
class(temp_cube) <- 's2dv_cube'
R0 <- CST_RNoughtIndices(temp_cube, method = "mordecai", mm = NULL,
lon_dim = NULL, lat_dim = NULL, ncores = NULL)
# Caminade method (requires Kramer matrix)
mm <- array(runif(2 * 5 * 4, 0.1, 1.0),
dim = c(2, 4, 5))
names(dim(mm)) <- c("", "lon", "lat")
R0 <- CST_RNoughtIndices(temp_cube, method = "caminade", mm = mm,
lon_dim = "lon", lat_dim = "lat", ncores = NULL)
Run the code above in your browser using DataLab