Jaume Ramon (51ce706e) at 14 Dec 19:21
added error for sorted members, which cannot be used because hindca...
Jaume Ramon (644756c7) at 13 Dec 15:54
added hcst-fcst for Interpolation, Intbc, Intlr and LogisticReg and...
Now, for different cases there are different coordinates classes:
repos <- "/esarchive/exp/ecmwf/system5_m1/monthly_mean/$var$_f6h/$var$_$sdate$.nc"
repos2 <- "/esarchive/exp/ecmwf/system4_m1/monthly_mean/$var$_f6h/$var$_$sdate$.nc"
data3 <- Start(dat = list(list(name = 'system4_m1', path = repos2),
list(name = 'system5_m1', path = repos)),
var = c('tas', 'sfcWind'),
sdate = '20170101',
ensemble = indices(1),
time = indices(1:3),
lat = indices(1:4),
lon = indices(1:4),
synonims = list(lat = c('lat', 'latitude'),
lon = c('lon', 'longitude')),
return_vars = list(time = 'sdate',
longitude = 'dat',
latitude = 'dat'),
metadata_dims = c('dat', 'var'),
retrieve = T
)
exp_start <- as.s2dv_cube(data3)
exp_start$dims
# dat var sdate ensemble time lat lon
# 2 2 1 1 3 4 4
> dim(exp_start$coords$var)
NULL
> dim(exp_start$coords$dat)
NULL
> dim(exp_start$coords$ensemble)
NULL
> dim(exp_start$coords$sdate)
NULL
> dim(exp_start$coords$lat)
lat
4
> dim(exp_start$coords$time)
sdate time
1 3
> dim(lonlat_prec$coords$dataset)
NULL
> dim(lonlat_prec$coords$member)
NULL
> dim(lonlat_prec$coords$sdate)
NULL
> dim(lonlat_prec$coords$ftime)
NULL
> dim(lonlat_prec$coords$lat)
[1] 4
> dim(lonlat_prec$coords$lon)
[1] 4
To standarize the coordinates classes in s2dv_cube
we can do:
Also, this development could be also done in CSTooos::s2dv_cube function and CSTools::CST_InsertDim.
What do you prefer?
Thanks for the clarification @erifarov . Sorry it was a bit silly, but wanted to be sure of this change.
Jaume Ramon (64ce1afe) at 11 Dec 16:42
from attrs to coords
Jaume Ramon (6c74e570) at 11 Dec 16:42
from attrs to coords
Jaume Ramon (d1d19f0f) at 11 Dec 16:41
from attrs to coords
Jaume Ramon (600c3383) at 11 Dec 16:41
from attrs to coords
Jaume Ramon (169eca4b) at 11 Dec 16:40
from attrs to coords
It is true that the attribute indice is indicating me that they correspond to indices (you also mention this in one comment above) but I would expect they were returning the same output.
Now, for different cases there are different coordinates classes:
repos <- "/esarchive/exp/ecmwf/system5_m1/monthly_mean/$var$_f6h/$var$_$sdate$.nc"
repos2 <- "/esarchive/exp/ecmwf/system4_m1/monthly_mean/$var$_f6h/$var$_$sdate$.nc"
data3 <- Start(dat = list(list(name = 'system4_m1', path = repos2),
list(name = 'system5_m1', path = repos)),
var = c('tas', 'sfcWind'),
sdate = '20170101',
ensemble = indices(1),
time = indices(1:3),
lat = indices(1:4),
lon = indices(1:4),
synonims = list(lat = c('lat', 'latitude'),
lon = c('lon', 'longitude')),
return_vars = list(time = 'sdate',
longitude = 'dat',
latitude = 'dat'),
metadata_dims = c('dat', 'var'),
retrieve = T
)
exp_start <- as.s2dv_cube(data3)
exp_start$dims
# dat var sdate ensemble time lat lon
# 2 2 1 1 3 4 4
> dim(exp_start$coords$var)
NULL
> dim(exp_start$coords$dat)
NULL
> dim(exp_start$coords$ensemble)
NULL
> dim(exp_start$coords$sdate)
NULL
> dim(exp_start$coords$lat)
lat
4
> dim(exp_start$coords$time)
sdate time
1 3
> dim(lonlat_prec$coords$dataset)
NULL
> dim(lonlat_prec$coords$member)
NULL
> dim(lonlat_prec$coords$sdate)
NULL
> dim(lonlat_prec$coords$ftime)
NULL
> dim(lonlat_prec$coords$lat)
[1] 4
> dim(lonlat_prec$coords$lon)
[1] 4
To standarize the coordinates classes in s2dv_cube
we can do:
Also, this development could be also done in CSTooos::s2dv_cube function and CSTools::CST_InsertDim.
What do you prefer?
Hi ,
Let me ask for a small inconsistency that I found, just to make sure you are aware of this.
I print different latitude values depending on whether I use s2dv_cube()
or as.s2dv_cube()
to transform an startR_array into a s2dv_cube object.
library(CSTools)
library(startR)
lonmin <- -11.5
lonmax <- 5.35
latmin <- 35.1
latmax <- 44.1
sdates_fcst <- c('20230201', '20230401')
fcst <- startR::Start(dat = '/esarchive/exp/ecmwf/system51c3s/monthly_mean/$var$_f6h/$var$_$sdate$.nc',
var = 'tas', time = indices(1), member = 'all', sdate = sdates_fcst,
lat = values(list(latmin, latmax)), lat_reorder = Sort(decreasing = FALSE),
lon = values(list(lonmin, lonmax)), lon_reorder = CircularSort(-180, 180),
synonims = list(var = c('var','variable'), lon = c('lon', 'longitude'),
lat = c('lat', 'latitude'), member = c('member','ensemble')),
return_vars = list(lat = 'dat', lon = 'dat'),
num_procs = 1, retrieve = TRUE)
fcst1 <- s2dv_cube(fcst, lat = attr(fcst, "Variables")$dat1$lat, lon = attr(fcst, "Variables")$dat1$lon,
source_files = attr(fcst, "Files")[1,1,])
fcst2 <- as.s2dv_cube(fcst)
# return latitude values
fcst1$coords$lat
#[1] 1 2 3 4 5 6 7 8 9
#attr(,"indices")
#[1] TRUE
fcst2$coords$lat
#[1] 35.5 36.5 37.5 38.5 39.5 40.5 41.5 42.5 43.5
Is it normal? Thanks!!
Jaume
Jaume Ramon (72405abd) at 29 Nov 17:24
corrected coords by attrs for lat lon values
... and 1 more commit
Jaume Ramon (346ae35c) at 29 Nov 12:29
corrected $coords by $attrs for latitudes and longitudes
Jaume Ramon (26aa8418) at 29 Nov 12:28
corrected $coords by $attrs for latitudes and longitudes
Jaume Ramon (f54e1dd1) at 29 Nov 12:27
corrected $coords by $attrs for latitudes and longitudes
Jaume Ramon (92bea648) at 29 Nov 12:26
corrected $coords by $attrs for latitudes and longitudes
Jaume Ramon (9e94f143) at 29 Nov 12:25
corrected $coords by $attrs for latitudes and longitudes