
source("modules/Loading/Loading.R")
source("modules/Saving/Saving.R")
source("modules/Units/Units.R")
source("modules/Visualization/Visualization.R")
args = commandArgs(trailingOnly = TRUE)
recipe_file <- args[1]
#recipe_file <- "recipe_tas.yml"
recipe <- read_atomic_recipe(recipe_file)
#recipe <- prepare_outputs(recipe_file)
# Load datasets
data <- Loading(recipe)
data <- Units(recipe, data)
data_summary(data$hcst, recipe)
data_summary(data$obs, recipe)


source("modules/Crossval/Crossval_anomalies.R")
res <- Crossval_anomalies(recipe = recipe, data = data)

source("modules/Crossval/Crossval_skill.R")
skill_metrics <- Crossval_skill(recipe = recipe, data_crossval = res,
                                fair = FALSE, nmemb = NULL, nmemb_ref = NULL) 

Visualization(recipe = recipe, data = data, skill_metrics = skill_metrics, significance = TRUE)

## Check logo size is appropiated for your maps:
source("tools/add_logo.R")
add_logo(recipe, "rsz_rsz_bsc_logo.png")

# scorecards computation:


