temp <- NULL
temp$data <- array(rnorm(100, mean = 300, sd = 5),
c(member = 5, sdate = 3, time = 214, longitude = 2, latitude = 5))
temp$coords <- list(latitude = c(35, 40, 45, 50, 55), longitude = c(-5, 0))
variableT <- list(varName = 'tas',
metadata = list(tas = list(units = 'K', long_name = '2m Temperature')))
temp$attrs <- list(Variable = variableT,
Datasets = 'synthetic',
when = Sys.time())
Dates <- c(seq(as.Date("2000-05-01"), as.Date("2000-11-30"), by = 'day'),
seq(as.Date("2001-05-01"), as.Date("2001-11-30"), by = 'day'),
seq(as.Date("2002-05-01"), as.Date("2002-11-30"), by = 'day'))
dim(Dates) <- c(sdate = 3, time = 214)
temp$attrs$Dates <- Dates
class(temp) <- "s2dv_cube"
DL <- CST_DayLength(temp)
DL_summer <- CST_DayLength(temp, start = list(21, 6), end = list(21, 9))
Run the code above in your browser using DataLab