Visualization module error when all values are NAs
Hi @vagudets
As I mentioned a potential problem with metric bss90_specs
that the output is full of NaN. I checked the Skill modules and didn't find problems there. In s2s.metrics.R, all the metrics that use FairRpss
return values except for bss90, so the code should be correct. The skill module doesn't return an error but the visualization module cannot plot the metrics that are full of NaN. If the metric computation is correct, we need to add some checks in viz module to prevent errors.
To get the idea more clearly, you can run the following script (I use branch dev-skill-compute_probabilities
)
# Setwd to auto-s2s git folder
source("modules/Loading/Loading_decadal.R")
source("modules/Calibration/Calibration.R")
source("modules/Skill/Skill.R")
source("modules/Saving/Saving.R")
source("modules/Visualization/Visualization.R")
recipe_file <- "/esarchive/scratch/aho/tmp/recipe-decadal_monthly_2.yml"
recipe <- prepare_outputs(recipe_file)
# Load datasets
suppressWarnings({invisible(capture.output(
data <- load_datasets(recipe)
))})
# Calibrate datasets
suppressWarnings({invisible(capture.output(
calibrated_data <- calibrate_datasets(recipe, data)
))})
# Compute skill metrics
suppressMessages({invisible(capture.output(
skill_metrics <- compute_skill_metrics(recipe, calibrated_data)
))})
suppressWarnings({invisible(capture.output(
probs <- compute_probabilities(recipe, calibrated_data)
))})
plot_data(recipe = recipe, data = data,
calibrated_data = calibrated_data, skill_metrics = skill_metrics,
probabilities = probs, significance = T)
Error in PlotLayout(PlotEquiMap, c("longitude", "latitude"), asplit(skill, : Arrays in parameter 'var' must contain at least 2 different values.
Best,
An-Chi