###############################################################################
## Author: V. Agudetse
## Description: Script to test developments for seasonal workflows. Please,
##              do not modify.
###############################################################################

# Load modules
source("modules/Loading/Loading.R")
source("modules/Units/Units.R")
source("modules/Calibration/Calibration.R")
source("modules/Anomalies/Anomalies.R")
source("modules/Skill/Skill.R")
source("modules/Saving/Saving.R")
source("modules/Visualization/Visualization.R")

# Read recipe
recipe_file <- "recipes/atomic_recipes/recipe_test_multivar.yml"
recipe <- prepare_outputs(recipe_file)

# Load datasets
data <- Loading(recipe)
# Change units
data <- Units(recipe, data)
# Calibrate datasets
data <- Calibration(recipe, data)
# Compute anomalies
data <- Anomalies(recipe, data)
# Compute skill metrics 
skill_metrics <- Skill(recipe, data)
# Compute percentiles and probability bins
probabilities <- Probabilities(recipe, data)
# Plot data
Visualization(recipe, data, skill_metrics, probabilities, significance = T)
