# Issue https://earth.bsc.es/gitlab/es/startR/issues/26#note_46926

#Work Station Example 1:
library(startR)
packageVersion("startR") # [1] ‘0.1.1’

repos <- '/esarchive/exp/ecmwf/system5_m1/6hourly/$var$/$var$_$sdate$.nc'

# A Start() call is built with the indices to operate
data <- Start(dat = repos,
              var = 'tas',
              sdate = '20180101',
              ensemble = 'all',
              time = 'all',
              latitude = indices(1:40),
              longitude = indices(1:40),
              retrieve = TRUE)

dim(data)
#      dat       var     sdate  ensemble      time  latitude longitude 
#        1         1         1        51       860        40        40

data[1, 1, 1, 1 : 10, 1 : 5, 1 : 2, 1 : 3]
PlotEquiMap(data[1,1,1,1,1,,], lat = attributes(data)$Variables$common$tas$dim[[2]]$vals, lon = attributes(data)$Variables$common$tas$dim[[1]]$vals)

