From 9a93ffef4f74e6a2532df1660f6d6987c7da5ef2 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Tue, 14 Mar 2023 11:41:40 +0100 Subject: [PATCH 1/2] Minor change of comments in /inst/doc --- inst/doc/UseCase1_WindEvent_March2018.R | 2 +- inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF100.R | 2 +- inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R | 3 ++- inst/doc/UseCase3_data_preparation_SCHEME_model.R | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/inst/doc/UseCase1_WindEvent_March2018.R b/inst/doc/UseCase1_WindEvent_March2018.R index 2bb64f0b..e0416a90 100644 --- a/inst/doc/UseCase1_WindEvent_March2018.R +++ b/inst/doc/UseCase1_WindEvent_March2018.R @@ -86,7 +86,7 @@ for (mm in 1:3) { quantile(MeanDims(wind_ref$data, c('lat', 'lon')), c(0.3, 0.6))) wind_ref_extremes <- rbind(wind_ref_extremes, quantile(MeanDims(wind_ref$data, c('lat', 'lon')), c(0.1, 0.9))) - source("/esarchive/scratch/nperez/git/cstools/R/CST_BiasCorrection.R") + # source("/esarchive/scratch/nperez/git/cstools/R/CST_BiasCorrection.R") wind_fsct <- CST_BiasCorrection(exp = wind_hcst, obs = wind_ref, exp_cor = wind_fcst) diff --git a/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF100.R b/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF100.R index 23654b56..0a85b754 100644 --- a/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF100.R +++ b/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF100.R @@ -18,7 +18,7 @@ rm(list=ls()); gc(); # In this file, the lines are commented since they have been run and the # result saved on disk, then the result is loaded. # ---------------------------------------- -# Update date: "March 2023" +# Update: "March 2023" # # Load required libraries and setup output directory: library(CSTools) diff --git a/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R b/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R index de205fde..22584d3e 100644 --- a/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R +++ b/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R @@ -17,13 +17,14 @@ rm(list=ls()); gc(); # In this file, the lines are commented since they have been run and the # result saved on disk, then the result is loaded. # ---------------------------------------- -# Update date: "March 2023" +# Update: "March 2023" # # Load required libraries and setup output directory: library(CSTools) library(ClimProjDiags) library(zeallot) library(ragg) + dir_output <- '/esarchive/scratch/nperez/CSTools_manuscript/v20210603/' #slash end # -------------------------------------------- # STEP 1: diff --git a/inst/doc/UseCase3_data_preparation_SCHEME_model.R b/inst/doc/UseCase3_data_preparation_SCHEME_model.R index 9e38208c..fdcd6acd 100644 --- a/inst/doc/UseCase3_data_preparation_SCHEME_model.R +++ b/inst/doc/UseCase3_data_preparation_SCHEME_model.R @@ -1,7 +1,7 @@ # Author: Bert Van Schaeybroeck # Use Case 3: Seasonal forecasts for a river flow # ----------------------------------------------- -# Update date: "March 2023" +# Update: "March 2023" rm(list = ls()) library(CSTools) -- GitLab From fd96415a13cab20a94d0d8434289af25b4143056 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Tue, 14 Mar 2023 11:55:50 +0100 Subject: [PATCH 2/2] Update file to new structure --- .../UseCase2_PrecipitationDownscaling_RainFARM_RF4.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R b/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R index 60182fb0..22584d3e 100644 --- a/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R +++ b/inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4.R @@ -112,7 +112,7 @@ fs <- CST_RainFARM(exp.qm, nf = 4, newfs <- CST_MergeDims(fs, merge_dims = c("ftime", "monthly"), na.rm = TRUE) -newfs$Dates[[1]] <- exp$Dates[[1]] +newfs$attrs$Dates <- exp$attrs$Dates CST_SaveExp(newfs, destination = paste0(dir_output, 'RF4/')) Rprof(NULL) @@ -123,7 +123,7 @@ profile.info <- summaryRprof(paste0(dir_output, "Rprof.out")) library(s2dv) agg_png(paste0(dir_output, "EXP_11dec.png"), width = 800, height = 900, units = 'px',res = 144) -PlotEquiMap(exp$data[1,1,1,11,,,2],lon = exp$lon, lat = exp$lat, +PlotEquiMap(exp$data[1,1,1,11,,,2],lon = exp$coords$lon, lat = exp$coords$lat, filled.continents = FALSE, bar_limits = c(0,40), intylat = 2, intxlon = 2, title_scale = 0.8, bar_label_scale = 1.3, axes_label_scale = 1.2, @@ -132,7 +132,7 @@ PlotEquiMap(exp$data[1,1,1,11,,,2],lon = exp$lon, lat = exp$lat, dev.off() agg_png(paste0(dir_output, "EXPQM_11dec.png"), width = 800, height = 900, units = 'px',res = 144) -PlotEquiMap(exp.qm$data[1,1,1,11,,,2],lon = exp$lon, lat = exp$lat, +PlotEquiMap(exp.qm$data[1,1,1,11,,,2],lon = exp$coords$lon, lat = exp$coords$lat, filled.continents = FALSE, bar_limits = c(0,40), intylat = 2, intxlon = 2, title_scale = 0.8, bar_label_scale = 1.3, axes_label_scale = 1.2, @@ -141,7 +141,7 @@ PlotEquiMap(exp.qm$data[1,1,1,11,,,2],lon = exp$lon, lat = exp$lat, dev.off() agg_png(paste0(dir_output, "RF4_Down_11dec.png"), width = 800, height = 900, units = 'px',res = 144) -PlotEquiMap(fs$data[1,1,1,11,,,2],lon = fs$lon, lat = fs$lat, +PlotEquiMap(fs$data[1,1,1,11,,,2],lon = fs$coords$lon, lat = fs$coords$lat, filled.continents = FALSE, bar_limits = c(0,40), intylat = 2, intxlon = 2, title_scale = 0.8, bar_label_scale = 1.3, axes_label_scale = 1.2, @@ -150,7 +150,7 @@ PlotEquiMap(fs$data[1,1,1,11,,,2],lon = fs$lon, lat = fs$lat, dev.off() agg_png(paste0(dir_output, "RF4_WeightsDec.png"), width = 800, height = 900, units = 'px',res = 144) -PlotEquiMap(weight$data[,,12], lon = weight$lon, lat = weight$lat, +PlotEquiMap(weight$data[,,12], lon = weight$coords$lon, lat = weight$coords$lat, filled.continents = FALSE, title_scale = 0.8, bar_label_scale = 1.3, axes_label_scale = 1.2, intylat = 2, intxlon = 2, degree_sym = TRUE, -- GitLab