Skip to content

Improve as.s2dv_cube

Some improvements needed:

  • Add $attrs$time_frequency
  • as.s2dv_cube don't recognise dates when they are not in format Date:

Example

library(CSTools)
path_exp <- paste0('/esarchive/exp/meteofrance/system6c3s/monthly_mean/',
                   '$var$_f6h/$var$_$sdate$.nc')

sdates <- sapply(1993:2012, function(x) paste0(x, '0501'))

lonmax <- 60.5
lonmin <- -19
latmax <- 79.5
latmin <- 0
exp <- CST_Start(dat = path_exp,
                 var = 'sfcWind',
                 ensemble = indices(1:9),
                 sdate = sdates,
                 time = indices(1:3),
                 latitude = values(list(latmin, latmax)),
                 latitude_reorder = Sort(decreasing = TRUE), 
                 longitude = values(list(lonmin, lonmax)),
                 longitude_reorder = CircularSort(0, 360),
                 synonims = list(longitude = c('lon', 'longitude'),
                                 latitude = c('lat', 'latitude')),
                 return_vars = list(latitude = NULL, 
                 longitude = NULL, time = 'sdate'),
                 retrieve = TRUE)

# from startR object
dates <- attributes(exp1)$Variables$common$time
dim(dates)
Edited by Eva Rifà