From e1d5df9185e72dfc00aa96eaac07362034797082 Mon Sep 17 00:00:00 2001 From: allabres Date: Thu, 18 Aug 2022 17:57:18 +0200 Subject: [PATCH 1/2] Add new file --- CST_Load_devel_from_s2dv.R | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 CST_Load_devel_from_s2dv.R diff --git a/CST_Load_devel_from_s2dv.R b/CST_Load_devel_from_s2dv.R new file mode 100644 index 0000000..5eea05e --- /dev/null +++ b/CST_Load_devel_from_s2dv.R @@ -0,0 +1,10 @@ +CST_Load_s2dv <- function (...) { + library(s2dv) # Load + library(utils) + library(zeallot) + library(CSTools) # as.s2dv_cube + + exp <- Load(...) + result <- as.s2dv_cube(exp) + result +} -- GitLab From 539e647ec1d29763441bcfadfbcace029f260fe6 Mon Sep 17 00:00:00 2001 From: allabres Date: Thu, 18 Aug 2022 18:34:59 +0200 Subject: [PATCH 2/2] Update CST_Load_devel_from_s2dv.R --- CST_Load_devel_from_s2dv.R | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CST_Load_devel_from_s2dv.R b/CST_Load_devel_from_s2dv.R index 5eea05e..9175e7b 100644 --- a/CST_Load_devel_from_s2dv.R +++ b/CST_Load_devel_from_s2dv.R @@ -8,3 +8,31 @@ CST_Load_s2dv <- function (...) { result <- as.s2dv_cube(exp) result } + + +# example of use +# +# path_ERA5prlr_CDS <- list(path = '/esarchive/recon/ecmwf/era5land/$STORE_FREQ$_mean/$VAR_NAME$_f1h/$VAR_NAME$_$YEAR$$MONTH$.nc') +# +# year_in <- 2010 +# year_fi <- 2013 +# month_in <- 1 +# month_fi <- 12 +# +# sdates <- paste0(year_in:year_fi, '0101') +# +# source("https://earth.bsc.es/gitlab/nperez/Flor/-/raw/allabres-master-patch-42702/CST_Load_devel_from_s2dv.R") +# +# loaded_obs <- CST_Load_s2dv(var = 'prlr', +# exp = NULL, +# obs = list(path_ERA5prlr_CDS), +# sdates = sdates, +# lonmax = 353, lonmin = 352.25, +# latmax = 41.75, latmin = 41, +# storefreq = 'monthly', +# leadtimemin = month_in, leadtimemax = month_fi, +# output = "lonlat") +# +#> dim(loaded_obs$data) +#dataset member sdate ftime lat lon +# 1 1 4 12 8 8 -- GitLab