diff --git a/DESCRIPTION b/DESCRIPTION index 5b527779407943515c9ad41b70dab3aa51c3b046..dfe40ba04e63e1531c35efd8e926c14cb6be16b5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: CSTools Title: Assessing Skill of Climate Forecasts on Seasonal-to-Decadal Timescales -Version: 1.0.0 +Version: 1.0.1 Authors@R: c( person("BSC-CNS", role = c("cph")), person("Louis-Philippe", "Caron", , "louis-philippe.caron@bsc.es", role = "aut", comment = c(ORCID = "0000-0001-5221-0147")), diff --git a/R/PlotMostLikelyQuantileMap.R b/R/PlotMostLikelyQuantileMap.R index c8abb372122bd0ea915a39217c5aa84d8682d3ff..96bb4ef9bf0fd43d0dedfd732e92c0e092ba6f25 100644 --- a/R/PlotMostLikelyQuantileMap.R +++ b/R/PlotMostLikelyQuantileMap.R @@ -168,9 +168,9 @@ PlotMostLikelyQuantileMap <- function(probs, lon, lat, cat_dim = 'bin', # Check bar_titles if (is.null(bar_titles)) { if (nprobs == 3) { - bar_titles <- list("Below normal (%)", "Normal (%)", "Above normal (%)") + bar_titles <- c("Below normal (%)", "Normal (%)", "Above normal (%)") } else if (nprobs == 5) { - bar_titles <- list("Low (%)", "Below normal (%)", + bar_titles <- c("Low (%)", "Below normal (%)", "Normal (%)", "Above normal (%)", "High (%)") } else { bar_titles <- paste0("Cat. ", 1:nprobs, " (%)") @@ -418,6 +418,7 @@ PlotCombinedMap <- function(maps, lon, lat, #---------------------- # Identify the most likely map #---------------------- + brks_norm <- seq(0, 1, length.out = length(brks)) if (is.function(map_select_fun)) { range_width <- display_range[2] - display_range[1] ml_map <- apply(maps, c(lat_dim, lon_dim), function(x) { @@ -427,10 +428,14 @@ PlotCombinedMap <- function(maps, lon, lat, res <- which(x == map_select_fun(x)) if (length(res) > 0) { res <- res[1] - if (map_select_fun(x) < display_range[1] || map_select_fun(x) > display_range[2]) { + if (map_select_fun(x) < display_range[1] || + map_select_fun(x) > display_range[2]) { res <- -0.5 } else { res <- res + (map_select_fun(x) - display_range[1]) / range_width + if (map_select_fun(x) == display_range[1]) { + res <- res + brks_norm[2] / (num_brks * 2) + } } } else { res <- -0.5 @@ -478,7 +483,7 @@ PlotCombinedMap <- function(maps, lon, lat, for (k in 2:nmap) { tcols <- append(tcols, c(col_unknown_map, cols[[k]])) } - brks_norm <- seq(0, 1, length.out = length(brks)) + tbrks <- c(-1, brks_norm + rep(1:nmap, each = length(brks))) PlotEquiMap(var = ml_map, lon = lon, lat = lat, brks = tbrks, cols = tcols, drawleg = FALSE, diff --git a/man/CST_BiasCorrection.Rd b/man/CST_BiasCorrection.Rd index 485199eae252039266185188df10ee21cf1af52b..e8a82af0b9e67719a600e1e6b04e9fec2c0d96b6 100644 --- a/man/CST_BiasCorrection.Rd +++ b/man/CST_BiasCorrection.Rd @@ -41,4 +41,4 @@ Verónica Torralba, \email{veronica.torralba@bsc.es} \references{ Torralba, V., F.J. Doblas-Reyes, D. MacLeod, I. Christel and M. Davis (2017). Seasonal climate prediction: a new source of information for the management of wind energy resources. Journal of Applied Meteorology and Climatology, 56, 1231-1247, doi:10.1175/JAMC-D-16-0204.1. (CLIM4ENERGY, EUPORIAS, NEWA, RESILIENCE, SPECS) } -\encoding{UTF-8} + diff --git a/man/CST_Calibration.Rd b/man/CST_Calibration.Rd index c841907683cdafaa996291ad634b20a7ad0464e8..396d87ca8f6e39c1548f40ce6699526966b29177 100644 --- a/man/CST_Calibration.Rd +++ b/man/CST_Calibration.Rd @@ -34,4 +34,4 @@ Doblas-Reyes F.J, Hagedorn R, Palmer T.N. The rationale behind the success of mu \seealso{ \code{\link{CST_Load}} } -\encoding{UTF-8} + diff --git a/man/PlotForecastPDF.Rd b/man/PlotForecastPDF.Rd index bed0bd3137789bc45216ab058c8d07d9b019f167..3d1d65c3335738ee1878723ec8c28f1a0e001fc9 100644 --- a/man/PlotForecastPDF.Rd +++ b/man/PlotForecastPDF.Rd @@ -49,4 +49,4 @@ PlotForecastPDF(fcsts2, c(-0.66, 0.66), extreme.limits = c(-1.2, 1.2), \author{ Llorenç Lledó \email{llledo@bsc.es} } -\encoding{UTF-8} +