From 8b132385c63266b5a024a997ee10a03518ba2db5 Mon Sep 17 00:00:00 2001 From: aho Date: Tue, 13 Dec 2022 07:58:00 +0100 Subject: [PATCH 01/12] Adapt to new as.s2dv_cube() --- modules/Loading/Loading.R | 6 ++++-- modules/Loading/Loading_decadal.R | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/Loading/Loading.R b/modules/Loading/Loading.R index 8d54d63d..93eadea7 100644 --- a/modules/Loading/Loading.R +++ b/modules/Loading/Loading.R @@ -4,7 +4,9 @@ source("/esarchive/scratch/vagudets/repos/csoperational/R/get_regrid_params.R") source("modules/Loading/dates2load.R") source("modules/Loading/check_latlon.R") source("tools/libs.R") - +#TODO: remove these two lines when new as.s2dv_cube() is in CSTools +source('https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-new_s2dv_cube/R/as.s2dv_cube.R') +source('https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-new_s2dv_cube/R/zzz.R') load_datasets <- function(recipe) { @@ -203,7 +205,7 @@ load_datasets <- function(recipe) { # Obtain dates and date dimensions from the loaded hcst data to make sure # the corresponding observations are loaded correctly. - dates <- hcst$Dates$start + dates <- hcst$attrs$Dates dim(dates) <- dim(Subset(hcst$data, along=c('dat', 'var', 'latitude', 'longitude', 'ensemble'), diff --git a/modules/Loading/Loading_decadal.R b/modules/Loading/Loading_decadal.R index 8046344b..394d29ff 100644 --- a/modules/Loading/Loading_decadal.R +++ b/modules/Loading/Loading_decadal.R @@ -11,8 +11,9 @@ source("modules/Loading/helper_loading_decadal.R") source("modules/Loading/dates2load.R") source("modules/Loading/check_latlon.R") source("tools/libs.R") -## TODO: Remove once the fun is included in CSTools -source("tools/tmp/as.s2dv_cube.R") +#TODO: remove these two lines when new as.s2dv_cube() is in CSTools +source('https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-new_s2dv_cube/R/as.s2dv_cube.R') +source('https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-new_s2dv_cube/R/zzz.R') #==================================================================== @@ -275,7 +276,7 @@ load_datasets <- function(recipe) { # Get from startR_cube # dates <- attr(hcst, 'Variables')$common$time # Get from s2dv_cube - dates <- hcst$Dates$start + dates <- hcst$attrs$Dates dates_file <- sapply(dates, format, '%Y%m') dim(dates_file) <- dim(dates) @@ -358,7 +359,6 @@ load_datasets <- function(recipe) { obs <- as.s2dv_cube(obs) ) - #------------------------------------------- # Step 4. Verify the consistance between data #------------------------------------------- -- GitLab From cc0be2e9f75bd786a97b3aff0cdb0f48c5f5c3d7 Mon Sep 17 00:00:00 2001 From: aho Date: Tue, 13 Dec 2022 08:14:53 +0100 Subject: [PATCH 02/12] Correct time attributes --- tests/testthat/test-decadal_daily_1.R | 12 ++++++------ tests/testthat/test-decadal_monthly_1.R | 10 +++++----- tests/testthat/test-decadal_monthly_2.R | 10 +++++----- tests/testthat/test-decadal_monthly_3.R | 10 +++++----- tests/testthat/test-seasonal_daily.R | 10 +++++----- tests/testthat/test-seasonal_monthly.R | 10 +++++----- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tests/testthat/test-decadal_daily_1.R b/tests/testthat/test-decadal_daily_1.R index c9833d2b..264371f7 100644 --- a/tests/testthat/test-decadal_daily_1.R +++ b/tests/testthat/test-decadal_daily_1.R @@ -72,7 +72,7 @@ dim(data$fcst$data), c(dat = 1, var = 1, sday = 1, sweek = 1, syear = 2, time = 90, latitude = 7, longitude = 11, ensemble = 3) ) expect_equal( -dim(data$hcst$Dates$start), +dim(data$hcst$attrs$Dates), c(sday = 1, sweek = 1, syear = 3, time = 90) ) # hcst data @@ -111,23 +111,23 @@ tolerance = 0.0001 # time value expect_equal( -(data$hcst$Dates$start)[1], +(data$hcst$attrs$Dates)[1], as.POSIXct("1991-01-01 12:00:00", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[2], +(data$hcst$attrs$Dates)[2], as.POSIXct("1992-01-01 12:00:00", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[5], +(data$hcst$attrs$Dates)[5], as.POSIXct("1992-01-02 12:00:00", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[1, 1, 3, 90], +(data$hcst$attrs$Dates)[1, 1, 3, 90], as.POSIXct("1993-03-31 12:00:00", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[1, 1, 2, 90], +(data$hcst$attrs$Dates)[1, 1, 2, 90], as.POSIXct("1992-03-30 12:00:00", tz = 'UTC') ) diff --git a/tests/testthat/test-decadal_monthly_1.R b/tests/testthat/test-decadal_monthly_1.R index 5cf1922e..249bcc6e 100644 --- a/tests/testthat/test-decadal_monthly_1.R +++ b/tests/testthat/test-decadal_monthly_1.R @@ -91,7 +91,7 @@ dim(data$fcst$data), c(dat = 1, var = 1, sday = 1, sweek = 1, syear = 1, time = 3, latitude = 5, longitude = 4, ensemble = 2) ) expect_equal( -dim(data$hcst$Dates$start), +dim(data$hcst$attr$Dates), c(sday = 1, sweek = 1, syear = 4, time = 3) ) expect_equal( @@ -110,19 +110,19 @@ c(281.7395, 294.2467), tolerance = 0.0001 ) expect_equal( -(data$hcst$Dates$start)[1], +(data$hcst$attrs$Dates)[1], as.POSIXct("1991-11-16", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[2], +(data$hcst$attrs$Dates)[2], as.POSIXct("1992-11-16", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[5], +(data$hcst$attrs$Dates)[5], as.POSIXct("1991-12-16 12:00:00", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[10], +(data$hcst$attrs$Dates)[10], as.POSIXct("1993-01-16 12:00:00", tz = 'UTC') ) diff --git a/tests/testthat/test-decadal_monthly_2.R b/tests/testthat/test-decadal_monthly_2.R index 4dd72ebf..7e9f74b4 100644 --- a/tests/testthat/test-decadal_monthly_2.R +++ b/tests/testthat/test-decadal_monthly_2.R @@ -73,7 +73,7 @@ dim(data$fcst$data), c(dat = 1, var = 1, sday = 1, sweek = 1, syear = 2, time = 14, latitude = 8, longitude = 5, ensemble = 3) ) expect_equal( -dim(data$hcst$Dates$start), +dim(data$hcst$attrs$Dates), c(sday = 1, sweek = 1, syear = 3, time = 14) ) #expect_equal( @@ -109,19 +109,19 @@ tolerance = 0.0001 ) expect_equal( -(data$hcst$Dates$start)[1], +(data$hcst$attrs$Dates)[1], as.POSIXct("1990-11-16", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[2], +(data$hcst$attrs$Dates)[2], as.POSIXct("1991-11-16", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[5], +(data$hcst$attrs$Dates)[5], as.POSIXct("1991-12-16 12:00:00", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[10], +(data$hcst$attrs$Dates)[10], as.POSIXct("1991-02-15", tz = 'UTC') ) diff --git a/tests/testthat/test-decadal_monthly_3.R b/tests/testthat/test-decadal_monthly_3.R index 7535e8dc..042f2055 100644 --- a/tests/testthat/test-decadal_monthly_3.R +++ b/tests/testthat/test-decadal_monthly_3.R @@ -66,7 +66,7 @@ dim(data$hcst$data), c(dat = 1, var = 1, sday = 1, sweek = 1, syear = 4, time = 3, latitude = 25, longitude = 16, ensemble = 3) ) expect_equal( -dim(data$hcst$Dates$start), +dim(data$hcst$attrs$Dates), c(sday = 1, sweek = 1, syear = 4, time = 3) ) # hcst data @@ -87,19 +87,19 @@ tolerance = 0.0001 ) expect_equal( -(data$hcst$Dates$start)[1], +(data$hcst$attrs$Dates)[1], as.POSIXct("2016-04-16", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[2], +(data$hcst$attrs$Dates)[2], as.POSIXct("2017-04-16", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[5], +(data$hcst$attrs$Dates)[5], as.POSIXct("2016-05-16 12:00:00", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[12], +(data$hcst$attrs$Dates)[12], as.POSIXct("2019-06-16", tz = 'UTC') ) diff --git a/tests/testthat/test-seasonal_daily.R b/tests/testthat/test-seasonal_daily.R index 5b771d77..89686ad3 100644 --- a/tests/testthat/test-seasonal_daily.R +++ b/tests/testthat/test-seasonal_daily.R @@ -61,7 +61,7 @@ dim(data$obs$data), c(dat = 1, var = 1, sday = 1, sweek = 1, syear = 4, time = 31, latitude = 4, longitude = 4, ensemble = 1) ) expect_equal( -dim(data$obs$Dates$start), +dim(data$obs$attrs$Dates), c(sday = 1, sweek = 1, syear = 4, time = 31) ) expect_equal( @@ -80,19 +80,19 @@ c(280.1490, 298.2324), tolerance = 0.0001 ) expect_equal( -(data$hcst$Dates$start)[1], +(data$hcst$attrs$Dates)[1], as.POSIXct("1993-12-01 18:00:00 UTC", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[2], +(data$hcst$attrs$Dates)[2], as.POSIXct("1994-12-01 18:00:00 UTC", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[5], +(data$hcst$attrs$Dates)[5], as.POSIXct("1993-12-02 18:00:00 UTC", tz = 'UTC') ) expect_equal( -(data$obs$Dates$start)[10], +(data$obs$attrs$Dates)[10], as.POSIXct("1994-12-03 11:30:00 UTC", tz = 'UTC') ) diff --git a/tests/testthat/test-seasonal_monthly.R b/tests/testthat/test-seasonal_monthly.R index 86feedfb..2052bfab 100644 --- a/tests/testthat/test-seasonal_monthly.R +++ b/tests/testthat/test-seasonal_monthly.R @@ -88,7 +88,7 @@ dim(data$fcst$data), c(dat = 1, var = 1, sday = 1, sweek = 1, syear = 1, time = 3, latitude = 3, longitude = 3, ensemble = 51) ) expect_equal( -dim(data$hcst$Dates$start), +dim(data$hcst$attrs$Dates), c(sday = 1, sweek = 1, syear = 4, time = 3) ) expect_equal( @@ -107,19 +107,19 @@ c(284.7413, 299.6219), tolerance = 0.0001 ) expect_equal( -(data$hcst$Dates$start)[1], +(data$hcst$attrs$Dates)[1], as.POSIXct("1993-12-01", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[2], +(data$hcst$attrs$Dates)[2], as.POSIXct("1994-12-01", tz = 'UTC') ) expect_equal( -(data$hcst$Dates$start)[5], +(data$hcst$attrs$Dates)[5], as.POSIXct("1994-01-01", tz = 'UTC') ) expect_equal( -(data$obs$Dates$start)[10], +(data$obs$attrs$Dates)[10], as.POSIXct("1995-02-14", tz = 'UTC') ) -- GitLab From 50a70879ce2171fd5c97f035f641e6c4d623e423 Mon Sep 17 00:00:00 2001 From: aho Date: Tue, 13 Dec 2022 08:20:45 +0100 Subject: [PATCH 03/12] Correct s2dv_cube list name --- tests/testthat/test-decadal_daily_1.R | 2 +- tests/testthat/test-decadal_monthly_1.R | 2 +- tests/testthat/test-decadal_monthly_2.R | 2 +- tests/testthat/test-decadal_monthly_3.R | 2 +- tests/testthat/test-seasonal_daily.R | 2 +- tests/testthat/test-seasonal_monthly.R | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-decadal_daily_1.R b/tests/testthat/test-decadal_daily_1.R index 264371f7..400b864d 100644 --- a/tests/testthat/test-decadal_daily_1.R +++ b/tests/testthat/test-decadal_daily_1.R @@ -53,7 +53,7 @@ class(data$obs), ) expect_equal( names(data$hcst), -c("data", "lon", "lat", "Variable", "Datasets", "Dates", "when", "source_files", "load_parameters") +c("data", "dims", "coords", "attrs") ) expect_equal( names(data$hcst), diff --git a/tests/testthat/test-decadal_monthly_1.R b/tests/testthat/test-decadal_monthly_1.R index 249bcc6e..69b51b06 100644 --- a/tests/testthat/test-decadal_monthly_1.R +++ b/tests/testthat/test-decadal_monthly_1.R @@ -72,7 +72,7 @@ class(data$obs), ) expect_equal( names(data$hcst), -c("data", "lon", "lat", "Variable", "Datasets", "Dates", "when", "source_files", "load_parameters") +c("data", "dims", "coords", "attrs") ) expect_equal( names(data$hcst), diff --git a/tests/testthat/test-decadal_monthly_2.R b/tests/testthat/test-decadal_monthly_2.R index 7e9f74b4..c0860fd4 100644 --- a/tests/testthat/test-decadal_monthly_2.R +++ b/tests/testthat/test-decadal_monthly_2.R @@ -54,7 +54,7 @@ class(data$obs), ) expect_equal( names(data$hcst), -c("data", "lon", "lat", "Variable", "Datasets", "Dates", "when", "source_files", "load_parameters") +c("data", "dims", "coords", "attrs") ) expect_equal( names(data$hcst), diff --git a/tests/testthat/test-decadal_monthly_3.R b/tests/testthat/test-decadal_monthly_3.R index 042f2055..c1e9a8af 100644 --- a/tests/testthat/test-decadal_monthly_3.R +++ b/tests/testthat/test-decadal_monthly_3.R @@ -55,7 +55,7 @@ class(data$obs), ) expect_equal( names(data$hcst), -c("data", "lon", "lat", "Variable", "Datasets", "Dates", "when", "source_files", "load_parameters") +c("data", "dims", "coords", "attrs") ) expect_equal( names(data$hcst), diff --git a/tests/testthat/test-seasonal_daily.R b/tests/testthat/test-seasonal_daily.R index 89686ad3..cf403a47 100644 --- a/tests/testthat/test-seasonal_daily.R +++ b/tests/testthat/test-seasonal_daily.R @@ -46,7 +46,7 @@ class(data$obs), ) expect_equal( names(data$hcst), -c("data", "lon", "lat", "Variable", "Datasets", "Dates", "when", "source_files", "load_parameters") +c("data", "dims", "coords", "attrs") ) expect_equal( names(data$hcst), diff --git a/tests/testthat/test-seasonal_monthly.R b/tests/testthat/test-seasonal_monthly.R index 2052bfab..e8b661b6 100644 --- a/tests/testthat/test-seasonal_monthly.R +++ b/tests/testthat/test-seasonal_monthly.R @@ -69,7 +69,7 @@ class(data$obs), ) expect_equal( names(data$hcst), -c("data", "lon", "lat", "Variable", "Datasets", "Dates", "when", "source_files", "load_parameters") +c("data", "dims", "coords", "attrs") ) expect_equal( names(data$hcst), -- GitLab From 908dcf20f92d79372fa3ceaee5a849c758ba8f0a Mon Sep 17 00:00:00 2001 From: aho Date: Tue, 13 Dec 2022 08:33:52 +0100 Subject: [PATCH 04/12] Correct time attributes --- modules/Loading/Loading_decadal.R | 4 ++-- modules/Saving/Saving.R | 20 ++++++++++---------- modules/Visualization/Visualization.R | 6 +++--- tools/data_summary.R | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/Loading/Loading_decadal.R b/modules/Loading/Loading_decadal.R index 394d29ff..d8715ba8 100644 --- a/modules/Loading/Loading_decadal.R +++ b/modules/Loading/Loading_decadal.R @@ -378,8 +378,8 @@ load_datasets <- function(recipe) { } # time attribute - if (!identical(format(hcst$Dates$start, '%Y%m'), - format(obs$Dates$start, '%Y%m'))) { + if (!identical(format(hcst$attrs$Dates, '%Y%m'), + format(obs$attrs$Dates, '%Y%m'))) { error(recipe$Run$logger, "hcst and obs don't share the same time.") stop() diff --git a/modules/Saving/Saving.R b/modules/Saving/Saving.R index 961bacee..e49e9781 100644 --- a/modules/Saving/Saving.R +++ b/modules/Saving/Saving.R @@ -183,7 +183,7 @@ save_forecast <- function(data_cube, # } # Generate vector containing leadtimes - dates <- as.PCICt(ClimProjDiags::Subset(data_cube$Dates$start, 'syear', 1), + dates <- as.PCICt(ClimProjDiags::Subset(data_cube$attrs$Dates, 'syear', 1), cal = calendar) if (fcst.horizon == 'decadal') { # Method 1: Use the first date as init_date. But it may be better to use the real initialized date (ask users) @@ -216,7 +216,7 @@ save_forecast <- function(data_cube, syears <- seq(1:dim(data_cube$data)['syear'][[1]]) # expect dim = [sday = 1, sweek = 1, syear, time] - syears_val <- lubridate::year(data_cube$Dates$start[1, 1, , 1]) + syears_val <- lubridate::year(data_cube$attrs$Dates[1, 1, , 1]) for (i in syears) { # Select year from array and rearrange dimensions fcst <- ClimProjDiags::Subset(data_cube$data, 'syear', i, drop = T) @@ -318,7 +318,7 @@ save_observations <- function(data_cube, # Generate vector containing leadtimes ## TODO: Move to a separate function? - dates <- as.PCICt(ClimProjDiags::Subset(data_cube$Dates$start, 'syear', 1), + dates <- as.PCICt(ClimProjDiags::Subset(data_cube$attrs$Dates, 'syear', 1), cal = calendar) if (fcst.horizon == 'decadal') { # Method 1: Use the first date as init_date. But it may be better to use the real initialized date (ask users) @@ -339,7 +339,7 @@ save_observations <- function(data_cube, syears <- seq(1:dim(data_cube$data)['syear'][[1]]) ## expect dim = [sday = 1, sweek = 1, syear, time] - syears_val <- lubridate::year(data_cube$Dates$start[1, 1, , 1]) + syears_val <- lubridate::year(data_cube$attrs$Dates[1, 1, , 1]) for (i in syears) { # Select year from array and rearrange dimensions fcst <- ClimProjDiags::Subset(data_cube$data, 'syear', i, drop = T) @@ -390,7 +390,7 @@ save_observations <- function(data_cube, fcst.sdate <- data_cube$load_parameters$dat1$file_date[[1]][i] fcst.sdate <- as.Date(paste0(fcst.sdate, "01"), '%Y%m%d') } else { - fcst.sdate <- as.Date(data_cube$Dates$start[i]) + fcst.sdate <- as.Date(data_cube$attrs$Dates[i]) } } @@ -485,7 +485,7 @@ save_metrics <- function(skill, calendar <- archive$System[[global_attributes$system]]$calendar # Generate vector containing leadtimes - dates <- as.PCICt(ClimProjDiags::Subset(data_cube$Dates$start, 'syear', 1), + dates <- as.PCICt(ClimProjDiags::Subset(data_cube$attrs$Dates, 'syear', 1), cal = calendar) if (fcst.horizon == 'decadal') { @@ -592,7 +592,7 @@ save_corr <- function(skill, calendar <- archive$System[[global_attributes$system]]$calendar # Generate vector containing leadtimes - dates <- as.PCICt(ClimProjDiags::Subset(data_cube$Dates$start, 'syear', 1), + dates <- as.PCICt(ClimProjDiags::Subset(data_cube$attrs$Dates, 'syear', 1), cal = calendar) if (fcst.horizon == 'decadal') { init_month <- archive$System[[recipe$Analysis$Datasets$System$name]]$initial_month @@ -691,7 +691,7 @@ save_percentiles <- function(percentiles, store.freq <- recipe$Analysis$Variables$freq calendar <- archive$System[[global_attributes$system]]$calendar # Generate vector containing leadtimes - dates <- as.PCICt(ClimProjDiags::Subset(data_cube$Dates$start, 'syear', 1), + dates <- as.PCICt(ClimProjDiags::Subset(data_cube$attrs$Dates, 'syear', 1), cal = calendar) if (fcst.horizon == 'decadal') { init_month <- archive$System[[recipe$Analysis$Datasets$System$name]]$initial_month @@ -775,7 +775,7 @@ save_probabilities <- function(probs, # Generate vector containing leadtimes ## TODO: Move to a separate function? - dates <- as.PCICt(ClimProjDiags::Subset(data_cube$Dates$start, 'syear', 1), + dates <- as.PCICt(ClimProjDiags::Subset(data_cube$attrs$Dates, 'syear', 1), cal = calendar) if (fcst.horizon == 'decadal') { init_month <- archive$System[[recipe$Analysis$Datasets$System$name]]$initial_month @@ -793,7 +793,7 @@ save_probabilities <- function(probs, syears <- seq(1:dim(data_cube$data)['syear'][[1]]) ## expect dim = [sday = 1, sweek = 1, syear, time] - syears_val <- lubridate::year(data_cube$Dates$start[1, 1, , 1]) + syears_val <- lubridate::year(data_cube$attrs$Dates[1, 1, , 1]) for (i in syears) { # Select year from array and rearrange dimensions probs_syear <- lapply(probs, ClimProjDiags::Subset, 'syear', i, drop = 'selected') diff --git a/modules/Visualization/Visualization.R b/modules/Visualization/Visualization.R index 2d50a1a0..ff9b4981 100644 --- a/modules/Visualization/Visualization.R +++ b/modules/Visualization/Visualization.R @@ -168,7 +168,7 @@ plot_skill_metrics <- function(recipe, archive, data_cube, skill_metrics, outfile <- paste0(outdir, name, ".png") toptitle <- paste(display_name, "-", data_cube$Variable$varName, "-", system_name, "-", init_month, hcst_period) - months <- unique(lubridate::month(data_cube$Dates$start, + months <- unique(lubridate::month(data_cube$attrs$Dates, label = T, abb = F)) titles <- as.vector(months) # Plot @@ -247,7 +247,7 @@ plot_ensemble_mean <- function(recipe, archive, fcst, outdir) { } toptitle <- paste("Forecast Ensemble Mean -", variable, "-", system_name, "- Initialization:", i_syear) - months <- lubridate::month(fcst$Dates$start[1, 1, which(start_date == i_syear), ], + months <- lubridate::month(fcst$attrs$Dates[1, 1, which(start_date == i_syear), ], label = T, abb = F) titles <- as.vector(months) # Plots @@ -326,7 +326,7 @@ plot_most_likely_terciles <- function(recipe, archive, } toptitle <- paste("Most Likely Tercile -", variable, "-", system_name, "-", "Initialization:", i_syear) - months <- lubridate::month(fcst$Dates$start[1, 1, which(start_date == i_syear), ], + months <- lubridate::month(fcst$attrs$Dates[1, 1, which(start_date == i_syear), ], label = T, abb = F) ## TODO: Ensure this works for daily and sub-daily cases titles <- as.vector(months) diff --git a/tools/data_summary.R b/tools/data_summary.R index 34b6bd6e..8fffd3b4 100644 --- a/tools/data_summary.R +++ b/tools/data_summary.R @@ -12,10 +12,10 @@ data_summary <- function(data_cube, recipe) { } else if (recipe$Analysis$Variables$freq == "daily_mean") { date_format <- '%b %d %Y' } - months <- unique(format(as.Date(data_cube$Dates[[1]]), format = '%B')) + months <- unique(format(as.Date(data_cube$attrs$Dates[[1]]), format = '%B')) months <- paste(as.character(months), collapse=", ") - sdate_min <- format(min(as.Date(data_cube$Dates[[1]])), format = date_format) - sdate_max <- format(max(as.Date(data_cube$Dates[[1]])), format = date_format) + sdate_min <- format(min(as.Date(data_cube$attrs$Dates[[1]])), format = date_format) + sdate_max <- format(max(as.Date(data_cube$attrs$Dates[[1]])), format = date_format) # Create log instance and sink output to logfile and terminal info(recipe$Run$logger, "DATA SUMMARY:") -- GitLab From 4bc28d1a46349d496fd3b53dd4f5cd1b924cdf67 Mon Sep 17 00:00:00 2001 From: aho Date: Wed, 14 Dec 2022 06:32:22 +0100 Subject: [PATCH 05/12] Correct varName attributes --- modules/Saving/Saving.R | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/Saving/Saving.R b/modules/Saving/Saving.R index e49e9781..c7a26a57 100644 --- a/modules/Saving/Saving.R +++ b/modules/Saving/Saving.R @@ -170,7 +170,7 @@ save_forecast <- function(data_cube, lalo <- c('longitude', 'latitude') - variable <- data_cube$Variable$varName + variable <- data_cube$attrs$Variable$varName var.longname <- attr(data_cube$Variable, 'variable')$long_name global_attributes <- get_global_attributes(recipe, archive) fcst.horizon <- tolower(recipe$Analysis$Horizon) @@ -273,7 +273,7 @@ save_forecast <- function(data_cube, time <- times$time # Generate name of output file - outfile <- get_filename(outdir, recipe, data_cube$Variable$varName, + outfile <- get_filename(outdir, recipe, data_cube$attrs$Variable$varName, fcst.sdate, agg, "exp") # Get grid data and metadata and export to netCDF @@ -309,7 +309,7 @@ save_observations <- function(data_cube, lalo <- c('longitude', 'latitude') - variable <- data_cube$Variable$varName + variable <- data_cube$attrs$Variable$varName var.longname <- attr(data_cube$Variable, 'variable')$long_name global_attributes <- get_global_attributes(recipe, archive) fcst.horizon <- tolower(recipe$Analysis$Horizon) @@ -408,7 +408,7 @@ save_observations <- function(data_cube, time <- times$time # Generate name of output file - outfile <- get_filename(outdir, recipe, data_cube$Variable$varName, + outfile <- get_filename(outdir, recipe, data_cube$attrs$Variable$varName, fcst.sdate, agg, "obs") # Get grid data and metadata and export to netCDF @@ -525,7 +525,7 @@ save_metrics <- function(skill, time <- times$time # Generate name of output file - outfile <- get_filename(outdir, recipe, data_cube$Variable$varName, + outfile <- get_filename(outdir, recipe, data_cube$attrs$Variable$varName, fcst.sdate, agg, "skill") # Get grid data and metadata and export to netCDF @@ -631,7 +631,7 @@ save_corr <- function(skill, time <- times$time # Generate name of output file - outfile <- get_filename(outdir, recipe, data_cube$Variable$varName, + outfile <- get_filename(outdir, recipe, data_cube$attrs$Variable$varName, fcst.sdate, agg, "corr") # Get grid data and metadata and export to netCDF @@ -730,7 +730,7 @@ save_percentiles <- function(percentiles, time <- times$time # Generate name of output file - outfile <- get_filename(outdir, recipe, data_cube$Variable$varName, + outfile <- get_filename(outdir, recipe, data_cube$attrs$Variable$varName, fcst.sdate, agg, "percentiles") # Get grid data and metadata and export to netCDF @@ -766,7 +766,7 @@ save_probabilities <- function(probs, lalo <- c('longitude', 'latitude') - variable <- data_cube$Variable$varName + variable <- data_cube$attrs$Variable$varName var.longname <- attr(data_cube$Variable, 'variable')$long_name global_attributes <- get_global_attributes(recipe, archive) fcst.horizon <- tolower(recipe$Analysis$Horizon) @@ -837,7 +837,7 @@ save_probabilities <- function(probs, time <- times$time # Generate name of output file - outfile <- get_filename(outdir, recipe, data_cube$Variable$varName, + outfile <- get_filename(outdir, recipe, data_cube$attrs$Variable$varName, fcst.sdate, agg, "probs") # Get grid data and metadata and export to netCDF -- GitLab From a483ea10d1c55eb3ee3c9de325ab4aca84aae315 Mon Sep 17 00:00:00 2001 From: aho Date: Wed, 14 Dec 2022 06:44:40 +0100 Subject: [PATCH 06/12] Change lat/lon attributes level --- modules/Saving/Saving.R | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/Saving/Saving.R b/modules/Saving/Saving.R index c7a26a57..77c6ad03 100644 --- a/modules/Saving/Saving.R +++ b/modules/Saving/Saving.R @@ -281,8 +281,8 @@ save_forecast <- function(data_cube, country <- get_countries(grid) ArrayToNc(append(country, time, fcst), outfile) } else { - latitude <- data_cube$lat[1:length(data_cube$lat)] - longitude <- data_cube$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -416,8 +416,8 @@ save_observations <- function(data_cube, country <- get_countries(grid) ArrayToNc(append(country, time, fcst), outfile) } else { - latitude <- data_cube$lat[1:length(data_cube$lat)] - longitude <- data_cube$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -533,8 +533,8 @@ save_metrics <- function(skill, country <- get_countries(grid) ArrayToNc(append(country, time, skill), outfile) } else { - latitude <- data_cube$lat[1:length(data_cube$lat)] - longitude <- data_cube$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -639,8 +639,8 @@ save_corr <- function(skill, country <- get_countries(grid) ArrayToNc(append(country, time, skill), outfile) } else { - latitude <- data_cube$lat[1:length(data_cube$lat)] - longitude <- data_cube$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -738,8 +738,8 @@ save_percentiles <- function(percentiles, country <- get_countries(grid) ArrayToNc(append(country, time, percentiles), outfile) } else { - latitude <- data_cube$lat[1:length(data_cube$lat)] - longitude <- data_cube$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -845,8 +845,8 @@ save_probabilities <- function(probs, country <- get_countries(grid) ArrayToNc(append(country, time, probs_syear), outfile) } else { - latitude <- data_cube$lat[1:length(data_cube$lat)] - longitude <- data_cube$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) -- GitLab From 95fa10cc86e47db4dcaf6d8fd17807cb7699a295 Mon Sep 17 00:00:00 2001 From: aho Date: Wed, 14 Dec 2022 07:17:57 +0100 Subject: [PATCH 07/12] Crrect attributes levels --- modules/Saving/Saving.R | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/Saving/Saving.R b/modules/Saving/Saving.R index 77c6ad03..5246b320 100644 --- a/modules/Saving/Saving.R +++ b/modules/Saving/Saving.R @@ -171,7 +171,7 @@ save_forecast <- function(data_cube, lalo <- c('longitude', 'latitude') variable <- data_cube$attrs$Variable$varName - var.longname <- attr(data_cube$Variable, 'variable')$long_name + var.longname <- data_cube$attrs$Variable$variables[[variable]]$long_name global_attributes <- get_global_attributes(recipe, archive) fcst.horizon <- tolower(recipe$Analysis$Horizon) store.freq <- recipe$Analysis$Variables$freq @@ -241,7 +241,7 @@ save_forecast <- function(data_cube, dims <- c(lalo, 'ensemble', 'time') var.expname <- variable var.sdname <- var.sdname - var.units <- attr(data_cube$Variable, 'variable')$units + var.units <- data_cube$attrs$Variable$variables[[variable]]$units } metadata <- list(fcst = list(name = var.expname, @@ -265,7 +265,7 @@ save_forecast <- function(data_cube, fcst.sdate <- format(fcst.sdate, '%Y%m%d') } else { - fcst.sdate <- data_cube$load_parameters$dat1$file_date[[1]][i] + fcst.sdate <- data_cube$attrs$load_parameters$dat1$file_date[[1]][i] } # Get time dimension values and metadata @@ -281,8 +281,8 @@ save_forecast <- function(data_cube, country <- get_countries(grid) ArrayToNc(append(country, time, fcst), outfile) } else { - latitude <- data_cube$coords$lat[1:length(data_cube$lat)] - longitude <- data_cube$coords$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$coords$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$coords$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -310,7 +310,7 @@ save_observations <- function(data_cube, lalo <- c('longitude', 'latitude') variable <- data_cube$attrs$Variable$varName - var.longname <- attr(data_cube$Variable, 'variable')$long_name + var.longname <- data_cube$attrs$Variable$variables[[variable]]$long_name global_attributes <- get_global_attributes(recipe, archive) fcst.horizon <- tolower(recipe$Analysis$Horizon) store.freq <- recipe$Analysis$Variables$freq @@ -359,11 +359,11 @@ save_observations <- function(data_cube, dims <- c('Country', 'time') var.expname <- paste0(variable, '_country') var.longname <- paste0("Country-Aggregated ", var.longname) - var.units <- attr(data_cube$Variable, 'variable')$units + var.units <- data_cube$attrs$Variable$variables[[variable]]$units } else { dims <- c(lalo, 'time') var.expname <- variable - var.units <- attr(data_cube$Variable, 'variable')$units + var.units <- data_cube$attrs$Variable$variables[[variable]]$units } metadata <- list(fcst = list(name = var.expname, @@ -387,7 +387,7 @@ save_observations <- function(data_cube, } else { if (store.freq == "monthly_mean") { - fcst.sdate <- data_cube$load_parameters$dat1$file_date[[1]][i] + fcst.sdate <- data_cube$attrs$load_parameters$dat1$file_date[[1]][i] fcst.sdate <- as.Date(paste0(fcst.sdate, "01"), '%Y%m%d') } else { fcst.sdate <- as.Date(data_cube$attrs$Dates[i]) @@ -416,8 +416,8 @@ save_observations <- function(data_cube, country <- get_countries(grid) ArrayToNc(append(country, time, fcst), outfile) } else { - latitude <- data_cube$coords$lat[1:length(data_cube$lat)] - longitude <- data_cube$coords$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$coords$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$coords$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -533,8 +533,8 @@ save_metrics <- function(skill, country <- get_countries(grid) ArrayToNc(append(country, time, skill), outfile) } else { - latitude <- data_cube$coords$lat[1:length(data_cube$lat)] - longitude <- data_cube$coords$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$coords$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$coords$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -639,8 +639,8 @@ save_corr <- function(skill, country <- get_countries(grid) ArrayToNc(append(country, time, skill), outfile) } else { - latitude <- data_cube$coords$lat[1:length(data_cube$lat)] - longitude <- data_cube$coords$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$coords$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$coords$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -738,8 +738,8 @@ save_percentiles <- function(percentiles, country <- get_countries(grid) ArrayToNc(append(country, time, percentiles), outfile) } else { - latitude <- data_cube$coords$lat[1:length(data_cube$lat)] - longitude <- data_cube$coords$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$coords$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$coords$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) @@ -767,7 +767,7 @@ save_probabilities <- function(probs, lalo <- c('longitude', 'latitude') variable <- data_cube$attrs$Variable$varName - var.longname <- attr(data_cube$Variable, 'variable')$long_name + var.longname <- data_cube$attrs$Variable$variables[[variable]]$long_name global_attributes <- get_global_attributes(recipe, archive) fcst.horizon <- tolower(recipe$Analysis$Horizon) store.freq <- recipe$Analysis$Variables$freq @@ -829,7 +829,7 @@ save_probabilities <- function(probs, fcst.sdate <- init_date + lubridate::years(syears_val[i] - lubridate::year(init_date)) fcst.sdate <- format(fcst.sdate, '%Y%m%d') } else { - fcst.sdate <- data_cube$load_parameters$dat1$file_date[[1]][i] + fcst.sdate <- data_cube$attrs$load_parameters$dat1$file_date[[1]][i] } # Get time dimension values and metadata @@ -845,8 +845,8 @@ save_probabilities <- function(probs, country <- get_countries(grid) ArrayToNc(append(country, time, probs_syear), outfile) } else { - latitude <- data_cube$coords$lat[1:length(data_cube$lat)] - longitude <- data_cube$coords$lon[1:length(data_cube$lon)] + latitude <- data_cube$coords$lat[1:length(data_cube$coords$lat)] + longitude <- data_cube$coords$lon[1:length(data_cube$coords$lon)] latlon <- get_latlon(latitude, longitude) # Compile variables into a list and export to netCDF vars <- list(latlon$lat, latlon$lon, time) -- GitLab From 2a5ca81b6a70ec6dc7283631980f5d783a2f4e44 Mon Sep 17 00:00:00 2001 From: aho Date: Wed, 14 Dec 2022 07:24:28 +0100 Subject: [PATCH 08/12] Correct lat/lon attribures level --- modules/Visualization/Visualization.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Visualization/Visualization.R b/modules/Visualization/Visualization.R index ff9b4981..f9498739 100644 --- a/modules/Visualization/Visualization.R +++ b/modules/Visualization/Visualization.R @@ -81,8 +81,8 @@ plot_skill_metrics <- function(recipe, archive, data_cube, skill_metrics, stop("The element 'skill_metrics' must be a list of named arrays.") } - latitude <- data_cube$lat - longitude <- data_cube$lon + latitude <- data_cube$coords$lat + longitude <- data_cube$coords$lon system_name <- archive$System[[recipe$Analysis$Datasets$System$name]]$name hcst_period <- paste0(recipe$Analysis$Time$hcst_start, "-", recipe$Analysis$Time$hcst_end) @@ -166,7 +166,7 @@ plot_skill_metrics <- function(recipe, archive, data_cube, skill_metrics, } # Define output file name and titles outfile <- paste0(outdir, name, ".png") - toptitle <- paste(display_name, "-", data_cube$Variable$varName, + toptitle <- paste(display_name, "-", data_cube$attrs$Variable$varName, "-", system_name, "-", init_month, hcst_period) months <- unique(lubridate::month(data_cube$attrs$Dates, label = T, abb = F)) -- GitLab From 32c44e8846cdb6bb56ca5095bff97a8aedd8b8d1 Mon Sep 17 00:00:00 2001 From: aho Date: Wed, 14 Dec 2022 07:52:03 +0100 Subject: [PATCH 09/12] Correct attributes level --- modules/Visualization/Visualization.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/Visualization/Visualization.R b/modules/Visualization/Visualization.R index f9498739..b16fb4a7 100644 --- a/modules/Visualization/Visualization.R +++ b/modules/Visualization/Visualization.R @@ -201,8 +201,8 @@ plot_ensemble_mean <- function(recipe, archive, fcst, outdir) { stop("Visualization functions not yet implemented for daily data.") } - latitude <- fcst$lat - longitude <- fcst$lon + latitude <- fcst$coords$lat + longitude <- fcst$coords$lon system_name <- archive$System[[recipe$Analysis$Datasets$System$name]]$name variable <- recipe$Analysis$Variables$name units <- attr(fcst$Variable, "variable")$units @@ -278,8 +278,8 @@ plot_most_likely_terciles <- function(recipe, archive, stop("Visualization functions not yet implemented for daily data.") } - latitude <- fcst$lat - longitude <- fcst$lon + latitude <- fcst$coords$lat + longitude <- fcst$coords$lon system_name <- archive$System[[recipe$Analysis$Datasets$System$name]]$name variable <- recipe$Analysis$Variables$name start_date <- paste0(recipe$Analysis$Time$fcst_year, -- GitLab From 086eb3ae63b98477c071579611eee55471d4684e Mon Sep 17 00:00:00 2001 From: Victoria Agudetse Roures Date: Mon, 30 Jan 2023 17:16:05 +0100 Subject: [PATCH 10/12] Adapt Anomalies module --- modules/Anomalies/Anomalies.R | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/Anomalies/Anomalies.R b/modules/Anomalies/Anomalies.R index 552f895a..41fd286f 100644 --- a/modules/Anomalies/Anomalies.R +++ b/modules/Anomalies/Anomalies.R @@ -45,13 +45,14 @@ compute_anomalies <- function(recipe, data) { data$obs <- anom$obs remove(anom) # Change variable metadata - # data$hcst$Variable$varName <- paste0(data$hcst$Variable$varName, "anomaly") - attr(data$hcst$Variable, "variable")$long_name <- - paste(attr(data$hcst$Variable, "variable")$long_name, "anomaly") - # data$obs$Variable$varName <- paste0(data$obs$Variable$varName, "anomaly") - attr(data$obs$Variable, "variable")$long_name <- - paste(attr(data$obs$Variable, "variable")$long_name, "anomaly") - + for (var in data$hcst$attrs$Variable$varName) { + # Change hcst longname + data$hcst$attrs$Variable$variables[[var]]$long_name <- + paste(data$hcst$attrs$Variable$variables[[var]]$long_name, "anomaly") + # Change obs longname + data$obs$attrs$Variable$variables[[var]]$long_name <- + paste(data$obs$attrs$Variable$variables[[var]]$long_name, "anomaly") + } # Compute forecast anomaly field if (!is.null(data$fcst)) { # Compute hindcast climatology ensemble mean @@ -70,9 +71,10 @@ compute_anomalies <- function(recipe, data) { # Get fcst anomalies data$fcst$data <- data$fcst$data - clim_hcst # Change metadata - # data$fcst$Variable$varName <- paste0(data$fcst$Variable$varName, "anomaly") - attr(data$fcst$Variable, "variable")$long_name <- - paste(attr(data$fcst$Variable, "variable")$long_name, "anomaly") + for (var in data$fcst$attrs$Variable$varName) { + data$fcst$attrs$Variable$variables[[var]]$long_name <- + paste(data$fcst$attrs$Variable$variables[[var]]$long_name, "anomaly") + } } info(recipe$Run$logger, -- GitLab From c235b4932a91ee4d051de89b3196371002aba56d Mon Sep 17 00:00:00 2001 From: Victoria Agudetse Roures Date: Wed, 8 Feb 2023 09:51:36 +0100 Subject: [PATCH 11/12] Fix bug in data summary --- tools/data_summary.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/data_summary.R b/tools/data_summary.R index 49f3c8ea..597f42cb 100644 --- a/tools/data_summary.R +++ b/tools/data_summary.R @@ -11,10 +11,10 @@ data_summary <- function(data_cube, recipe) { } else if (recipe$Analysis$Variables$freq == "daily_mean") { date_format <- '%b %d %Y' } - months <- unique(format(as.Date(data_cube$attrs$Dates[[1]]), format = '%B')) + months <- unique(format(as.Date(data_cube$attrs$Dates), format = '%B')) months <- paste(as.character(months), collapse=", ") - sdate_min <- format(min(as.Date(data_cube$attrs$Dates[[1]])), format = date_format) - sdate_max <- format(max(as.Date(data_cube$attrs$Dates[[1]])), format = date_format) + sdate_min <- format(min(as.Date(data_cube$attrs$Dates)), format = date_format) + sdate_max <- format(max(as.Date(data_cube$attrs$Dates)), format = date_format) # Create log instance and sink output to logfile and terminal info(recipe$Run$logger, "DATA SUMMARY:") -- GitLab From d950a24c1652f318a80934721a9d7931a3362a67 Mon Sep 17 00:00:00 2001 From: Victoria Agudetse Roures Date: Wed, 29 Mar 2023 16:20:59 +0200 Subject: [PATCH 12/12] Remove sourcing of as.s2dv_cube function after release of CSTools 5.0.0 --- modules/Loading/Loading.R | 3 --- modules/Loading/Loading_decadal.R | 3 --- 2 files changed, 6 deletions(-) diff --git a/modules/Loading/Loading.R b/modules/Loading/Loading.R index 226a7fa5..107eaf71 100644 --- a/modules/Loading/Loading.R +++ b/modules/Loading/Loading.R @@ -5,9 +5,6 @@ source("modules/Loading/dates2load.R") source("modules/Loading/check_latlon.R") ## TODO: Move to prepare_outputs.R source("tools/libs.R") -#TODO: remove these two lines when new as.s2dv_cube() is in CSTools -source('https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-new_s2dv_cube/R/as.s2dv_cube.R') -source('https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-new_s2dv_cube/R/zzz.R') load_datasets <- function(recipe) { diff --git a/modules/Loading/Loading_decadal.R b/modules/Loading/Loading_decadal.R index 7d2d8fac..4258fd18 100644 --- a/modules/Loading/Loading_decadal.R +++ b/modules/Loading/Loading_decadal.R @@ -11,9 +11,6 @@ source("modules/Loading/helper_loading_decadal.R") source("modules/Loading/dates2load.R") source("modules/Loading/check_latlon.R") source("tools/libs.R") -#TODO: remove these two lines when new as.s2dv_cube() is in CSTools -source('https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-new_s2dv_cube/R/as.s2dv_cube.R') -source('https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-new_s2dv_cube/R/zzz.R') #==================================================================== -- GitLab