From 57ccc96a4d8642ed53fbd46668827d418525ba71 Mon Sep 17 00:00:00 2001 From: Nadia Milders Date: Wed, 11 Oct 2023 15:53:36 +0200 Subject: [PATCH 1/2] Updated start.months and inf.to.na paramaters --- modules/Scorecards/Scorecards.R | 8 +++++++- .../atomic_recipes/recipe_scorecards_atomic.yml | 15 ++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/modules/Scorecards/Scorecards.R b/modules/Scorecards/Scorecards.R index 3bcb01ce..035452c4 100644 --- a/modules/Scorecards/Scorecards.R +++ b/modules/Scorecards/Scorecards.R @@ -29,7 +29,11 @@ Scorecards <- function(recipe) { end.year <- as.numeric(recipe$Analysis$Time$hcst_end) forecast.months <- recipe$Analysis$Time$ftime_min : recipe$Analysis$Time$ftime_max - start.months <- 1:12 #recipe$Analysis$Workflow$Scorecards$start_months + if(recipe$Analysis$Workflow$Scorecards$start_months == 'all'){ + start.months <- 1:12 + } else { + start.months <- as.numeric(strsplit(recipe$Analysis$Workflow$Scorecards$start_months, split = " ")[[1]]) + } regions <- recipe$Analysis$Workflow$Scorecards$regions for (i in names(regions)){regions[[i]] <- unlist(regions[[i]])} @@ -61,6 +65,7 @@ Scorecards <- function(recipe) { } } + inf.to.na <- recipe$Analysis$Workflow$Scorecards$inf_to_na table.label <- recipe$Analysis$Workflow$Scorecards$table_label fileout.label <- recipe$Analysis$Workflow$Scorecards$fileout_label legend.white.space <- recipe$Analysis$Workflow$Scorecards$legend_white_space @@ -78,6 +83,7 @@ Scorecards <- function(recipe) { metrics = metrics.load, start.months = start.months, forecast.months = forecast.months, + inf_to_na = inf.to.na, input.path = input.path) diff --git a/recipes/atomic_recipes/recipe_scorecards_atomic.yml b/recipes/atomic_recipes/recipe_scorecards_atomic.yml index fc88af22..a8adb6c1 100644 --- a/recipes/atomic_recipes/recipe_scorecards_atomic.yml +++ b/recipes/atomic_recipes/recipe_scorecards_atomic.yml @@ -46,24 +46,25 @@ Analysis: Indicators: index: no Scorecards: + execute: yes # yes/no regions: Extra-tropical NH: {lon.min: 0, lon.max: 360, lat.min: 30, lat.max: 90} Tropics: {lon.min: 0, lon.max: 360, lat.min: -30, lat.max: 30} Extra-tropical SH : {lon.min: 0, lon.max: 360, lat.min: -30, lat.max: -90} - start_months: NULL + start_months: 'all' metric: mean_bias enscorr rpss crpss enssprerr metric_aggregation: 'score' - table_label: NULL - fileout_label: NULL - col1_width: NULL - col2_width: NULL + inf_to_na: TRUE + table_label: + fileout_label: + col1_width: + col2_width: calculate_diff: FALSE - #output_path: /esarchive/scratch/nmilders/scorecards_images/testing ncores: 7 # Optional, int: number of cores, defaults to 1 remove_NAs: # Optional, bool: Whether NAs are removed, defaults to FALSE Output_format: Scorecards #S2S4E Run: Loglevel: INFO Terminal: yes - output_dir: /esarchive/scratch/nmilders/scorecards_data/to_system/cross_validation/both_cross_val/ + output_dir: /esarchive/scratch/nmilders/scorecards_data/new/to_system/cross_validation/all_cross_val/ code_dir: /esarchive/scratch/nmilders/gitlab/git_clones/s2s-suite/ -- GitLab From 600e7f2c7afd606c6d8ea23ace29e54c8796e8b2 Mon Sep 17 00:00:00 2001 From: Victoria Agudetse Roures Date: Wed, 11 Oct 2023 16:26:36 +0200 Subject: [PATCH 2/2] Add separator options to scorecard start months --- modules/Scorecards/Scorecards.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/Scorecards/Scorecards.R b/modules/Scorecards/Scorecards.R index 035452c4..0dbcd921 100644 --- a/modules/Scorecards/Scorecards.R +++ b/modules/Scorecards/Scorecards.R @@ -29,10 +29,11 @@ Scorecards <- function(recipe) { end.year <- as.numeric(recipe$Analysis$Time$hcst_end) forecast.months <- recipe$Analysis$Time$ftime_min : recipe$Analysis$Time$ftime_max - if(recipe$Analysis$Workflow$Scorecards$start_months == 'all'){ + if (recipe$Analysis$Workflow$Scorecards$start_months == 'all') { start.months <- 1:12 } else { - start.months <- as.numeric(strsplit(recipe$Analysis$Workflow$Scorecards$start_months, split = " ")[[1]]) + start.months <- as.numeric(strsplit(recipe$Analysis$Workflow$Scorecards$start_months, + split = ", | |,")[[1]]) } regions <- recipe$Analysis$Workflow$Scorecards$regions -- GitLab