diff --git a/R/PlotEquiMap.R b/R/PlotEquiMap.R index 2c98430d27e6418021ea52af30344b4b43bfbe8a..16f42b5086dd9c38414326d2e9881b71937860ea 100644 --- a/R/PlotEquiMap.R +++ b/R/PlotEquiMap.R @@ -253,7 +253,7 @@ #' } #'PlotEquiMap(sampleData$mod[1, 1, 1, 1, , ], sampleData$lon, sampleData$lat, #' toptitle = 'Predicted sea surface temperature for Nov 1960 from 1st Nov', -#' sizetit = 0.5) +#' title_scale = 0.5) #'@import graphics maps #'@importFrom grDevices dev.cur dev.new dev.off gray #'@importFrom stats cor diff --git a/R/Utils.R b/R/Utils.R index adcded6fd3a8f40d549983d408df910d32723d21..362bdf8ff412601fd19d3ac14b7304c9f457a4a3 100644 --- a/R/Utils.R +++ b/R/Utils.R @@ -100,44 +100,7 @@ } position } - .t2nlatlon <- function(t) { - ## As seen in cdo's griddes.c: ntr2nlat() - nlats <- (t * 3 + 1) / 2 - if ((nlats > 0) && (nlats - trunc(nlats) >= 0.5)) { - nlats <- ceiling(nlats) - } else { - nlats <- round(nlats) - } - if (nlats %% 2 > 0) { - nlats <- nlats + 1 - } - ## As seen in cdo's griddes.c: compNlon(), and as specified in ECMWF - nlons <- 2 * nlats - keep_going <- TRUE - while (keep_going) { - n <- nlons - if (n %% 8 == 0) n <- trunc(n / 8) - while (n %% 6 == 0) n <- trunc(n / 6) - while (n %% 5 == 0) n <- trunc(n / 5) - while (n %% 4 == 0) n <- trunc(n / 4) - while (n %% 3 == 0) n <- trunc(n / 3) - if (n %% 2 == 0) n <- trunc(n / 2) - if (n <= 8) { - keep_going <- FALSE - } else { - nlons <- nlons + 2 - if (nlons > 9999) { - stop("Error: pick another gaussian grid truncation. It doesn't fulfill the standards to apply FFT.") - } - } - } - c(nlats, nlons) - } - .nlat2t <- function(nlats) { - trunc((nlats * 2 - 1) / 3) - } - found_file <- NULL dims <- NULL grid_name <- units <- var_long_name <- NULL diff --git a/man/PlotEquiMap.Rd b/man/PlotEquiMap.Rd index 19ff838922f4926f1fc093ed9c5a40b2185d2c26..5d3739a0349323304fcd881a804bda4a0fbf161c 100644 --- a/man/PlotEquiMap.Rd +++ b/man/PlotEquiMap.Rd @@ -404,5 +404,5 @@ sampleData <- s2dv:::.LoadSampleData('tos', c('experiment'), } PlotEquiMap(sampleData$mod[1, 1, 1, 1, , ], sampleData$lon, sampleData$lat, toptitle = 'Predicted sea surface temperature for Nov 1960 from 1st Nov', - sizetit = 0.5) + title_scale = 0.5) } diff --git a/vignettes/NAOindex_81to91.png b/vignettes/Figures/NAOindex_81to91.png similarity index 100% rename from vignettes/NAOindex_81to91.png rename to vignettes/Figures/NAOindex_81to91.png diff --git a/vignettes/NAOpredictions.png b/vignettes/Figures/NAOpredictions.png similarity index 100% rename from vignettes/NAOpredictions.png rename to vignettes/Figures/NAOpredictions.png diff --git a/vignettes/RMSSSforNAOprediction.png b/vignettes/Figures/RMSSSforNAOprediction.png similarity index 100% rename from vignettes/RMSSSforNAOprediction.png rename to vignettes/Figures/RMSSSforNAOprediction.png diff --git a/vignettes/ex_ano_expA_obsX.png b/vignettes/Figures/ex_ano_expA_obsX.png similarity index 100% rename from vignettes/ex_ano_expA_obsX.png rename to vignettes/Figures/ex_ano_expA_obsX.png diff --git a/vignettes/ex_ano_expB_obsX.png b/vignettes/Figures/ex_ano_expB_obsX.png similarity index 100% rename from vignettes/ex_ano_expB_obsX.png rename to vignettes/Figures/ex_ano_expB_obsX.png diff --git a/vignettes/ex_clim_expA_expB_obsX.png b/vignettes/Figures/ex_clim_expA_expB_obsX.png similarity index 100% rename from vignettes/ex_clim_expA_expB_obsX.png rename to vignettes/Figures/ex_clim_expA_expB_obsX.png diff --git a/vignettes/ex_corr_expA_expB_obsX.png b/vignettes/Figures/ex_corr_expA_expB_obsX.png similarity index 100% rename from vignettes/ex_corr_expA_expB_obsX.png rename to vignettes/Figures/ex_corr_expA_expB_obsX.png diff --git a/vignettes/ex_raw_expA_obsX.png b/vignettes/Figures/ex_raw_expA_obsX.png similarity index 100% rename from vignettes/ex_raw_expA_obsX.png rename to vignettes/Figures/ex_raw_expA_obsX.png diff --git a/vignettes/ex_raw_expB_obsX.png b/vignettes/Figures/ex_raw_expB_obsX.png similarity index 100% rename from vignettes/ex_raw_expB_obsX.png rename to vignettes/Figures/ex_raw_expB_obsX.png diff --git a/vignettes/s2dv_modules.png b/vignettes/Figures/s2dv_modules.png similarity index 100% rename from vignettes/s2dv_modules.png rename to vignettes/Figures/s2dv_modules.png diff --git a/vignettes/snip1_equi_map_raw_all.png b/vignettes/Figures/snip1_equi_map_raw_all.png similarity index 100% rename from vignettes/snip1_equi_map_raw_all.png rename to vignettes/Figures/snip1_equi_map_raw_all.png diff --git a/vignettes/snip2_anim_corr_expA_obsX.gif b/vignettes/Figures/snip2_anim_corr_expA_obsX.gif similarity index 100% rename from vignettes/snip2_anim_corr_expA_obsX.gif rename to vignettes/Figures/snip2_anim_corr_expA_obsX.gif diff --git a/vignettes/snip2_anim_corr_expB_obsX.gif b/vignettes/Figures/snip2_anim_corr_expB_obsX.gif similarity index 100% rename from vignettes/snip2_anim_corr_expB_obsX.gif rename to vignettes/Figures/snip2_anim_corr_expB_obsX.gif diff --git a/vignettes/snip2_equimap_corr_raw_expA_obsX.png b/vignettes/Figures/snip2_equimap_corr_raw_expA_obsX.png similarity index 100% rename from vignettes/snip2_equimap_corr_raw_expA_obsX.png rename to vignettes/Figures/snip2_equimap_corr_raw_expA_obsX.png diff --git a/vignettes/snip2_equimap_corr_raw_expB_obsX.png b/vignettes/Figures/snip2_equimap_corr_raw_expB_obsX.png similarity index 100% rename from vignettes/snip2_equimap_corr_raw_expB_obsX.png rename to vignettes/Figures/snip2_equimap_corr_raw_expB_obsX.png diff --git a/vignettes/stat_ano_expA_Y_obsX.png b/vignettes/Figures/stat_ano_expA_Y_obsX.png similarity index 100% rename from vignettes/stat_ano_expA_Y_obsX.png rename to vignettes/Figures/stat_ano_expA_Y_obsX.png diff --git a/vignettes/stat_ano_expA_obsX.png b/vignettes/Figures/stat_ano_expA_obsX.png similarity index 100% rename from vignettes/stat_ano_expA_obsX.png rename to vignettes/Figures/stat_ano_expA_obsX.png diff --git a/vignettes/stat_ano_expB_obsX.png b/vignettes/Figures/stat_ano_expB_obsX.png similarity index 100% rename from vignettes/stat_ano_expB_obsX.png rename to vignettes/Figures/stat_ano_expB_obsX.png diff --git a/vignettes/stat_clim_expA_expB_obsX.png b/vignettes/Figures/stat_clim_expA_expB_obsX.png similarity index 100% rename from vignettes/stat_clim_expA_expB_obsX.png rename to vignettes/Figures/stat_clim_expA_expB_obsX.png diff --git a/vignettes/stat_detr_ano_expA_obsX.png b/vignettes/Figures/stat_detr_ano_expA_obsX.png similarity index 100% rename from vignettes/stat_detr_ano_expA_obsX.png rename to vignettes/Figures/stat_detr_ano_expA_obsX.png diff --git a/vignettes/stat_filter_ano_expA.png b/vignettes/Figures/stat_filter_ano_expA.png similarity index 100% rename from vignettes/stat_filter_ano_expA.png rename to vignettes/Figures/stat_filter_ano_expA.png diff --git a/vignettes/stat_raw_expA_obsX.png b/vignettes/Figures/stat_raw_expA_obsX.png similarity index 100% rename from vignettes/stat_raw_expA_obsX.png rename to vignettes/Figures/stat_raw_expA_obsX.png diff --git a/vignettes/stat_raw_expB_obsX.png b/vignettes/Figures/stat_raw_expB_obsX.png similarity index 100% rename from vignettes/stat_raw_expB_obsX.png rename to vignettes/Figures/stat_raw_expB_obsX.png diff --git a/vignettes/stat_season_mam_expA.png b/vignettes/Figures/stat_season_mam_expA.png similarity index 100% rename from vignettes/stat_season_mam_expA.png rename to vignettes/Figures/stat_season_mam_expA.png diff --git a/vignettes/stat_season_mam_obsX.png b/vignettes/Figures/stat_season_mam_obsX.png similarity index 100% rename from vignettes/stat_season_mam_obsX.png rename to vignettes/Figures/stat_season_mam_obsX.png diff --git a/vignettes/stat_smooth_ano_expA_obsX.png b/vignettes/Figures/stat_smooth_ano_expA_obsX.png similarity index 100% rename from vignettes/stat_smooth_ano_expA_obsX.png rename to vignettes/Figures/stat_smooth_ano_expA_obsX.png diff --git a/vignettes/stat_toy_forecast_ano.png b/vignettes/Figures/stat_toy_forecast_ano.png similarity index 100% rename from vignettes/stat_toy_forecast_ano.png rename to vignettes/Figures/stat_toy_forecast_ano.png diff --git a/vignettes/stat_trend_expA_expB.png b/vignettes/Figures/stat_trend_expA_expB.png similarity index 100% rename from vignettes/stat_trend_expA_expB.png rename to vignettes/Figures/stat_trend_expA_expB.png diff --git a/vignettes/vis_acc_expA_expB_obsX.png b/vignettes/Figures/vis_acc_expA_expB_obsX.png similarity index 100% rename from vignettes/vis_acc_expA_expB_obsX.png rename to vignettes/Figures/vis_acc_expA_expB_obsX.png diff --git a/vignettes/vis_anim_clim_expA.gif b/vignettes/Figures/vis_anim_clim_expA.gif similarity index 100% rename from vignettes/vis_anim_clim_expA.gif rename to vignettes/Figures/vis_anim_clim_expA.gif diff --git a/vignettes/vis_anim_clim_expA_world.gif b/vignettes/Figures/vis_anim_clim_expA_world.gif similarity index 100% rename from vignettes/vis_anim_clim_expA_world.gif rename to vignettes/Figures/vis_anim_clim_expA_world.gif diff --git a/vignettes/vis_anim_clim_expB.gif b/vignettes/Figures/vis_anim_clim_expB.gif similarity index 100% rename from vignettes/vis_anim_clim_expB.gif rename to vignettes/Figures/vis_anim_clim_expB.gif diff --git a/vignettes/vis_anim_clim_obsX.gif b/vignettes/Figures/vis_anim_clim_obsX.gif similarity index 100% rename from vignettes/vis_anim_clim_obsX.gif rename to vignettes/Figures/vis_anim_clim_obsX.gif diff --git a/vignettes/vis_anim_clim_obsX_world.gif b/vignettes/Figures/vis_anim_clim_obsX_world.gif similarity index 100% rename from vignettes/vis_anim_clim_obsX_world.gif rename to vignettes/Figures/vis_anim_clim_obsX_world.gif diff --git a/vignettes/vis_ano_exp_obs.png b/vignettes/Figures/vis_ano_exp_obs.png similarity index 100% rename from vignettes/vis_ano_exp_obs.png rename to vignettes/Figures/vis_ano_exp_obs.png diff --git a/vignettes/vis_ano_exp_points.png b/vignettes/Figures/vis_ano_exp_points.png similarity index 100% rename from vignettes/vis_ano_exp_points.png rename to vignettes/Figures/vis_ano_exp_points.png diff --git a/vignettes/vis_clim_expA_expB_obsX.png b/vignettes/Figures/vis_clim_expA_expB_obsX.png similarity index 100% rename from vignettes/vis_clim_expA_expB_obsX.png rename to vignettes/Figures/vis_clim_expA_expB_obsX.png diff --git a/vignettes/vis_conf_interval_exp.png b/vignettes/Figures/vis_conf_interval_exp.png similarity index 100% rename from vignettes/vis_conf_interval_exp.png rename to vignettes/Figures/vis_conf_interval_exp.png diff --git a/vignettes/vis_corr_expA_expB_obsX.png b/vignettes/Figures/vis_corr_expA_expB_obsX.png similarity index 100% rename from vignettes/vis_corr_expA_expB_obsX.png rename to vignettes/Figures/vis_corr_expA_expB_obsX.png diff --git a/vignettes/vis_corr_rms_expA_expB_obsX.png b/vignettes/Figures/vis_corr_rms_expA_expB_obsX.png similarity index 100% rename from vignettes/vis_corr_rms_expA_expB_obsX.png rename to vignettes/Figures/vis_corr_rms_expA_expB_obsX.png diff --git a/vignettes/vis_eno_expA_expB.png b/vignettes/Figures/vis_eno_expA_expB.png similarity index 100% rename from vignettes/vis_eno_expA_expB.png rename to vignettes/Figures/vis_eno_expA_expB.png diff --git a/vignettes/vis_equimap_box_expA.png b/vignettes/Figures/vis_equimap_box_expA.png similarity index 100% rename from vignettes/vis_equimap_box_expA.png rename to vignettes/Figures/vis_equimap_box_expA.png diff --git a/vignettes/vis_equimap_cols_raw_expA.png b/vignettes/Figures/vis_equimap_cols_raw_expA.png similarity index 100% rename from vignettes/vis_equimap_cols_raw_expA.png rename to vignettes/Figures/vis_equimap_cols_raw_expA.png diff --git a/vignettes/vis_equimap_cols_raw_obsX.png b/vignettes/Figures/vis_equimap_cols_raw_obsX.png similarity index 100% rename from vignettes/vis_equimap_cols_raw_obsX.png rename to vignettes/Figures/vis_equimap_cols_raw_obsX.png diff --git a/vignettes/vis_equimap_contour_raw_expA.png b/vignettes/Figures/vis_equimap_contour_raw_expA.png similarity index 100% rename from vignettes/vis_equimap_contour_raw_expA.png rename to vignettes/Figures/vis_equimap_contour_raw_expA.png diff --git a/vignettes/vis_equimap_contour_raw_obsX.png b/vignettes/Figures/vis_equimap_contour_raw_obsX.png similarity index 100% rename from vignettes/vis_equimap_contour_raw_obsX.png rename to vignettes/Figures/vis_equimap_contour_raw_obsX.png diff --git a/vignettes/vis_equimap_raw_expA.png b/vignettes/Figures/vis_equimap_raw_expA.png similarity index 100% rename from vignettes/vis_equimap_raw_expA.png rename to vignettes/Figures/vis_equimap_raw_expA.png diff --git a/vignettes/vis_equimap_raw_obsX.png b/vignettes/Figures/vis_equimap_raw_obsX.png similarity index 100% rename from vignettes/vis_equimap_raw_obsX.png rename to vignettes/Figures/vis_equimap_raw_obsX.png diff --git a/vignettes/vis_error_bar.png b/vignettes/Figures/vis_error_bar.png similarity index 100% rename from vignettes/vis_error_bar.png rename to vignettes/Figures/vis_error_bar.png diff --git a/vignettes/vis_iqr_expA_expB.png b/vignettes/Figures/vis_iqr_expA_expB.png similarity index 100% rename from vignettes/vis_iqr_expA_expB.png rename to vignettes/Figures/vis_iqr_expA_expB.png diff --git a/vignettes/vis_layout_complex.png b/vignettes/Figures/vis_layout_complex.png similarity index 100% rename from vignettes/vis_layout_complex.png rename to vignettes/Figures/vis_layout_complex.png diff --git a/vignettes/vis_layout_equimap_expA.png b/vignettes/Figures/vis_layout_equimap_expA.png similarity index 100% rename from vignettes/vis_layout_equimap_expA.png rename to vignettes/Figures/vis_layout_equimap_expA.png diff --git a/vignettes/vis_mad_expA_expB.png b/vignettes/Figures/vis_mad_expA_expB.png similarity index 100% rename from vignettes/vis_mad_expA_expB.png rename to vignettes/Figures/vis_mad_expA_expB.png diff --git a/vignettes/vis_maxmin_expA_expB.png b/vignettes/Figures/vis_maxmin_expA_expB.png similarity index 100% rename from vignettes/vis_maxmin_expA_expB.png rename to vignettes/Figures/vis_maxmin_expA_expB.png diff --git a/vignettes/vis_ratiorms_expA_expB_obsX.png b/vignettes/Figures/vis_ratiorms_expA_expB_obsX.png similarity index 100% rename from vignettes/vis_ratiorms_expA_expB_obsX.png rename to vignettes/Figures/vis_ratiorms_expA_expB_obsX.png diff --git a/vignettes/vis_ratiosdrms_expA_expB_obsX.png b/vignettes/Figures/vis_ratiosdrms_expA_expB_obsX.png similarity index 100% rename from vignettes/vis_ratiosdrms_expA_expB_obsX.png rename to vignettes/Figures/vis_ratiosdrms_expA_expB_obsX.png diff --git a/vignettes/vis_ratiosdrms_expA_obsX_obsXrnorm.png b/vignettes/Figures/vis_ratiosdrms_expA_obsX_obsXrnorm.png similarity index 100% rename from vignettes/vis_ratiosdrms_expA_obsX_obsXrnorm.png rename to vignettes/Figures/vis_ratiosdrms_expA_obsX_obsXrnorm.png diff --git a/vignettes/vis_raw_expA_obsX.png b/vignettes/Figures/vis_raw_expA_obsX.png similarity index 100% rename from vignettes/vis_raw_expA_obsX.png rename to vignettes/Figures/vis_raw_expA_obsX.png diff --git a/vignettes/vis_raw_expB_obsX.png b/vignettes/Figures/vis_raw_expB_obsX.png similarity index 100% rename from vignettes/vis_raw_expB_obsX.png rename to vignettes/Figures/vis_raw_expB_obsX.png diff --git a/vignettes/vis_regression_expA_expB.png b/vignettes/Figures/vis_regression_expA_expB.png similarity index 100% rename from vignettes/vis_regression_expA_expB.png rename to vignettes/Figures/vis_regression_expA_expB.png diff --git a/vignettes/vis_rms_expA_expB_obsX.png b/vignettes/Figures/vis_rms_expA_expB_obsX.png similarity index 100% rename from vignettes/vis_rms_expA_expB_obsX.png rename to vignettes/Figures/vis_rms_expA_expB_obsX.png diff --git a/vignettes/vis_rmsss_expA_expB_obsX.png b/vignettes/Figures/vis_rmsss_expA_expB_obsX.png similarity index 100% rename from vignettes/vis_rmsss_expA_expB_obsX.png rename to vignettes/Figures/vis_rmsss_expA_expB_obsX.png diff --git a/vignettes/vis_sd_expA_expB.png b/vignettes/Figures/vis_sd_expA_expB.png similarity index 100% rename from vignettes/vis_sd_expA_expB.png rename to vignettes/Figures/vis_sd_expA_expB.png diff --git a/vignettes/vis_stereomap_raw_expA.png b/vignettes/Figures/vis_stereomap_raw_expA.png similarity index 100% rename from vignettes/vis_stereomap_raw_expA.png rename to vignettes/Figures/vis_stereomap_raw_expA.png diff --git a/vignettes/vis_stereomap_raw_obsX.png b/vignettes/Figures/vis_stereomap_raw_obsX.png similarity index 100% rename from vignettes/vis_stereomap_raw_obsX.png rename to vignettes/Figures/vis_stereomap_raw_obsX.png diff --git a/vignettes/vis_trend_expA_expB.png b/vignettes/Figures/vis_trend_expA_expB.png similarity index 100% rename from vignettes/vis_trend_expA_expB.png rename to vignettes/Figures/vis_trend_expA_expB.png diff --git a/vignettes/ScoringForecast.md b/vignettes/ScoringForecast.md index 37c53e0cc1b11dcf86b6ccc69723bccf08cc0788..275619c31218b172cee6a9c11e2d54c73b75140a 100644 --- a/vignettes/ScoringForecast.md +++ b/vignettes/ScoringForecast.md @@ -103,7 +103,7 @@ PlotBoxWhisker(t(nao_exp_n), nao_obs_n, toptitle = "NAO index, DJF", legend(x = 3.8, y = 2.6, c('EUROSIP', 'EraInterim'), col = c(2, 4), pch = 15) ``` - + The figure above does not represent a good agreement between observations (blue line) and forecast (whisker boxes) due to the large dispersion through the 51 model members. The NAO signal is too weak due to the large dispersion among ensemble members thus almost disappearing (close to 0). @@ -149,7 +149,7 @@ legend(x = 4.95, y = 2.4, c('EUROSIP', 'EraInterim'), col = c(2, 4), pch = 15, cex = 0.9, lty = 0) ``` - + The above figure shows very different RMSSS for different members (left plot). Most of them have RMSSS close to 0, thus the prediction error is close to the system variability. **The RMSSS for the whole ensemble is 0.091**, what means a not very useful ensemble prediction. @@ -227,7 +227,7 @@ title('Predictions for selected-members ensemble') ``` - + For the all-members ensemble, the results are: diff --git a/vignettes/example.md b/vignettes/example.md index 9ac470da402a64a77690a8dccf52079fe3451e9d..3a71e98ec31668d96e421025c67d7968b4ca12c4 100644 --- a/vignettes/example.md +++ b/vignettes/example.md @@ -130,7 +130,7 @@ PlotEquiMap(data$mod[1, 1, 1, 1, , ], data$lon, data$lat) PlotEquiMap(data$mod[2, 1, 1, 1, , ], data$lon, data$lat) PlotEquiMap(data$obs[1, 1, 1, 1, , ], data$lon, data$lat) ``` - + See the full code used to obtain this figure in [**Snippet 1**](snippets.md#snippet1). @@ -150,8 +150,8 @@ PlotAno(mod, obs, gsub('1101', '1201', sdates), fileout = c('ex_raw_expA_obsX.eps', 'ex_raw_expB_obsX.eps')) ``` - - + + Each coloured region represents data corresponding to a single starting date. The bold line represents the mean value and the thin lines represent the values @@ -205,7 +205,7 @@ PlotClim(clim$clim_exp, clim$clim_obs, monini = 12, ytitle = "K", fileout = 'ex_clim_expA_expB_obsX.eps') ``` - + Each line in this plot represents the climatology of each member of the corresponding dataset. A single climatology of the ensemble mean could be @@ -225,8 +225,8 @@ PlotAno(ano_mod, ano_obs, gsub('1101', '1201', sdates), fileout = c('ex_ano_expA_obsX.eps', 'ex_ano_expB_obsX.eps')) ``` - - + + To fulfill the bias correction we would need to add the observed climatologies to these anomalies. The working units of the package, however, are the @@ -255,7 +255,7 @@ PlotVsLTime(corr, toptitle = "Correlations with Observation X over North Pacific fileout = 'ex_corr_expA_expB_obsX.eps') ``` - + See [**Verification**](verification.md) for a detailed explanation of the available deterministic and probabilistic scores or diff --git a/vignettes/snippets.md b/vignettes/snippets.md index 40929c2bd62acc0aa0bbb2564abb4d4e040c50d0..9f81a4bce9b01e6e0c45dc0ecb5fa762303cabf5 100644 --- a/vignettes/snippets.md +++ b/vignettes/snippets.md @@ -56,7 +56,7 @@ PlotEquiMap(data$obs[1,1,1,1,,], data$lon, data$lat, brks = brks, cols = cols, d ColorBar(brks, cols, vert = FALSE, subsampleg = 5) dev.off() ``` - + Snippet 2 --------- @@ -94,8 +94,8 @@ PlotEquiMap(corr[2, 1, 2, 1, , ], map_data$lon, map_data$lat, dots = t(corr[2, 1, 2, 1, , ] > corr[2, 1, 4, 1, , ])) dev.off() ``` - - + + And generates the animations of the actual time correlations of Experiment A and B against Observation X over the Atlantic, with black dots on values that @@ -112,6 +112,6 @@ AnimVsLTime(corr, map_data$lon, map_data$lat, monini = 12, "snip2_anim_corr_expB_obsX")) ``` - - + + diff --git a/vignettes/statistics.md b/vignettes/statistics.md index ff127c4c9fe5550da5a650954f06c8c4fe845063..e455d2c652627a9299b74d8053126cc911018422 100644 --- a/vignettes/statistics.md +++ b/vignettes/statistics.md @@ -138,14 +138,14 @@ PlotClim(clim$exp, clim$obs, monini = 12, listobs = c('Observation X'), fileout = "stat_clim_expA_expB_obsX.eps") ``` - - + + Each coloured curve in the `PlotAno()` figures corresponds to a starting date, with the various ensemble members and the ensemble mean in bold. The coloured area is delimited by the minimum and maximum ensemble values. - + Each plot in the `PlotClim()` figure corresponds to the climatology of a member of the corresponding experiment or observation. @@ -198,8 +198,8 @@ PlotAno(ano$exp, ano$obs, selected_sdates, ytitle = c("K", "K"), linezero = TRUE, fileout = paste0("stat_ano_exp", c("A", "B"), "_obsX.eps")) ``` - - + + To fulfill the bias correction of the forecasts, i.e. transforming the forecast data from the biased model mean state to the real observed mean state, the @@ -240,7 +240,7 @@ PlotVsLTime(trend_exp$trend, listexp = c('Experiment A', 'Experiment B'), fileout = 'stat_trend_expA_expB.eps') ``` - + In this case the slopes of the trends are nearly zero at all lead-times. The raw anomalies of the experiment A and observations are plotted next, side to @@ -261,8 +261,8 @@ PlotAno(InsertDim(plyr::take(trend_exp$detrended, 1, 1), 2, 1), ytitle = "K", linezero = TRUE, fileout = paste0("stat_detr_ano_expA_obsX.eps")) ``` - - + + Since the anomaly members have been averaged to compute the trend, the provided detrended data by `Trend()` is also an ensemble average. @@ -410,7 +410,7 @@ PlotAno(plyr::take(smoothed_ano_exp, 1, 1), smoothed_ano_obs, ytitle = "K", linezero = TRUE, fileout = "stat_smooth_ano_expA_obsX.eps") ``` - + ### Frequency filtering `Filter()` filters a specified frequency from the input data. The filtering is @@ -439,7 +439,7 @@ PlotAno(InsertDim(ens_mean_ano_expA, 2, 1), ano$obs, ytitle = "K", linezero = TRUE, fileout = "stat_filter_ano_expA.eps") ``` - + Generating derivative fields ---------------------------- @@ -487,8 +487,8 @@ PlotEquiMap(mam_clim_obs[1, 1, , ], data_map$lon, data_map$lat, units = "K", brks = brks, cols = cols, subsampleg = 10) dev.off() ``` - - + + ### Cathegorizing data `ProbBins()` @@ -545,7 +545,7 @@ PlotAno(ano_toy$ano_exp, ano_toy$ano_obs, sdates_toy, ytitle = "units", linezero = TRUE, fileout = "stat_toy_forecast_ano.eps") ``` - + It is possible, however, to generate model data from observational data from `Load()`. The only required parameters are, then, the predictability, error diff --git a/vignettes/visualisation.md b/vignettes/visualisation.md index 2c526ca0406f9b1300d5a14ebf2b573d080c9992..07e04fc1bb2a5b9be23fdc9bfc8c7a5ee98be0ca 100644 --- a/vignettes/visualisation.md +++ b/vignettes/visualisation.md @@ -10,7 +10,7 @@ vignette: > Visualisation ============= -s2dverification contains a set of functions to plot data at every stage of the +s2dv contains a set of functions to plot data at every stage of the verification process, most based directly on R graphics plotting tools. These functions are essential to: - Quickly inspect the results of a newly produced experiment, i.e. to check @@ -28,7 +28,7 @@ The visualisation functions, most with a name following the pattern `PlotStereoMap()`, `AnimateMap()`, `PlotLayout()` and `PlotSection()`. To master these functions it is convenient to have in mind the common array -dimension structure used throughout in s2dverification and how it evolves as +dimension structure used throughout in s2dv and how it evolves as the data objects go through the statistics and verification stages. For that you can review the introduction in [**Data retrieval**](data_retrieval.md) and the sections [**Statistics**](statistics.md) and @@ -38,7 +38,7 @@ Next an explanation of which situations they fit the best, details of the options they provide and short examples of usage. The data used hereunder will be the same as in [**Data retrieval**](data_retrieval.md): ```r -library(s2dverification) +library(s2dv) expA <- list(name = 'experimentA', path = file.path('/path/to/experiments/$EXP_NAME$/monthly_mean', '$VAR_NAME$/$VAR_NAME$_$START_DATE$.nc')) @@ -79,7 +79,7 @@ the underlying R graphics `plot()` function for a fine tuning. **Note:** A general purpose time-series plotting function, `PlotTimeSeries()`, is currently being developed. This function will agglomerate all the functionality required to generate the plots resulting from all the currently -available functions in `s2dverification` and will be based on the `ggplot2` +available functions in `s2dv` and will be based on the `ggplot2` package. The current functions will be kept as they are but will simply be an interface to `PlotTimeSeries()`. See [**this report**](https://earth.bsc.es/gitlab/es/s2dverification/blob/develop-PlotTimeSeries/inst/doc/PlotTimeSeries/PlotTimeSeries.pdf) @@ -116,7 +116,7 @@ PlotClim(clim$exp, clim$obs, monini = 12, listobs = c('Observation X'), fileout = "vis_clim_expA_expB_obsX.png") ``` - + ### Plotting multi-member raw data or anomalies @@ -156,8 +156,8 @@ PlotAno(data$mod, data$obs, selected_sdates, ytitle = c("K", "K"), fileout = paste0("vis_raw_exp", c("A", "B"), "_obsX.png")) ``` - - + + ### Plotting statistics and scores @@ -216,8 +216,8 @@ PlotVsLTime(ano_expA_Y$regression, monini = 12, freq = 1, leg = FALSE, fileout = 'vis_regression_expA_expB.png') ``` - - + + - To plot the `Spread()` across ensemble members and starting dates of area averaged data (interquartile range, maximum minus minimum, standard deviation or median absolute deviation): @@ -249,10 +249,10 @@ PlotVsLTime(spread$iqr, listexp = c('Experiment A', 'Experiment B'), fileout = 'vis_mad_expA_expB.png') ``` - - - - + + + + - To plot the correlation (`Corr()`) and RMSE (`RMS()`) between experiments (averaged across ensemble members) and observations: @@ -274,8 +274,9 @@ PlotVsLTime(rms, listexp = c('Experiment A', 'Experiment B'), fileout = 'vis_rms_expA_expB_obsX.png') ``` - - + + + - To plot the ratio between the RMSE of the ensemble mean of two experiments with a same observation at a single grid point or area averaged: @@ -291,7 +292,8 @@ PlotVsLTime(ratio_rms2, monini = 12, freq = 1, siglev = TRUE, leg = FALSE, fileout = 'vis_ratiorms_expA_expB_obsX.png') ``` - + + - To plot the ratio between the ensemble spread of the experiments and their RMSE against the observations (`RatioSDRMS()`) at a single grid point or area averaged: @@ -307,7 +309,7 @@ PlotVsLTime(ratio_sdrms2, listexp = c('Experiment A', 'Experiment B'), fileout = 'vis_ratiosdrms_expA_expB_obsX.png') ``` - + In this example, the ratio SD / RMS is calculated for the experiment A only but against two observational datasets: @@ -327,7 +329,8 @@ PlotVsLTime(ratio_sdrms2, listobs = c('Observation X', 'Observation X + rnorm(n, 0, 0.1)'), fileout = 'vis_ratiosdrms_expA_obsX_obsXrnorm.png') ``` - + + - To plot `RMSSS()` of ensemble mean at a single grid point or area averaged: ```r @@ -341,7 +344,8 @@ PlotVsLTime(rmsss2, listexp = c('Experiment A', 'Experiment B'), fileout = 'vis_rmsss_expA_expB_obsX.png') ``` - + + - To plot effective number of independent data (`Eno()`): ```r @@ -355,7 +359,7 @@ PlotVsLTime(eno2, listexp = c('Experiment A', 'Experiment B'), fileout = 'vis_eno_expA_expB.png') ``` - + `Plot2VarsVsLTime()` allows to plot two indices or scores at a time on the same plot, each with its confidence intervals. It accepts as inputs arrays of only @@ -377,7 +381,7 @@ Plot2VarsVsLTime(corr[, 1, 1:3, ], rms[, 1, , ], listvars = c('Corr', 'RMSE'), fileout = 'vis_corr_rms_expA_expB_obsX.png') ``` - + `PlotACC()`, in contrast to `PlotVsLTime()`, accepts an additional dimension for the starting dates in the input and the dimension of the confidence @@ -416,7 +420,7 @@ PlotACC(acc$ACC, selected_sdates, legends = c('Experiment A', 'Experiment B'), fileout = 'vis_acc_expA_expB_obsX.png') ``` - + `PlotBoxWhisker()` @@ -443,7 +447,7 @@ PlotTimeSeries(ano_exp) + PlotTimeSeries(ano_obs, add = T) ``` - + -------------------- The `PlotTimeSeries` function has read the x- and y- axis labels, the title and the legend from the metadata automatically. By default, a horizontal line is plotted along `y = 0`, and this line can be shifted or removed with `intercept`. Layers can be added by selecting `add = TRUE`, as in the above example, where the dataset of observations have been added to the plot. The user can plot the geometric objects (the mean, confidence intervals, curves etc.) along any of the dimensions, as well as adding points, changing the linestyles and removing any of the objects. For example the curves for the individual members can be replaced with points, with different shapes for the different members, and the shading between the minimum and maximum can be removed as follows. @@ -453,7 +457,7 @@ PlotTimeSeries(ano_exp, minmax_along = NA, points = T, shape_along = 2, curves_a ``` - + ### Plotting scores and sample statistics @@ -466,8 +470,8 @@ PlotTimeSeries(Corr, interval_type = "line") ``` - - + + ### Conclusions @@ -482,8 +486,7 @@ Plotting maps This group of functions allows to plot grid data (i.e. defined over latitudes and longitudes) on a rectangular equidistant projection or on a stereographic -projection (as of s2dverification v2.5.0) as well as depth sections (i.e. -defined over latitudes/longitudes and depth levels). +projection as well as depth sections (i.e. defined over latitudes/longitudes and depth levels). Regarding the functions to plot maps, by default each grid point is drawn on a world map with a colour as a function of the magnitude of the provided field, @@ -523,8 +526,8 @@ PlotEquiMap(MeanDims(map_data$obs, 2)[1, 1, 1, , ], map_data$lon, map_data$lat, toptitle = "Obs. X: 'tas', 1990-12-01", units = "K", filled.continents = FALSE, fileout = 'vis_equimap_raw_obsX.png') ``` - - + + ```r PlotEquiMap(Mean1Dim(map_data$mod, 2)[1, 1, 1, , ], map_data$lon, map_data$lat, @@ -539,14 +542,14 @@ PlotEquiMap(Mean1Dim(map_data$obs, 2)[1, 1, 1, , ], map_data$lon, map_data$lat, filled.continents = FALSE, fileout = 'vis_equimap_cols_raw_obsX.png') ``` - - + + Or, as seen in the example from [**Snippet 2**](snippets.md#snippet2): - - + + `PlotEquiMap()` has some other additional features: @@ -572,8 +575,8 @@ PlotEquiMap(MeanDims(map_data$obs, 2)[1, 1, 1, , ], map_data$lon, map_data$lat, fileout = 'vis_equimap_contour_raw_obsX.png') ``` - - + + - Drawing boxes on the map: `boxlim`, `boxcol` and `boxlwd` allow to specify the position of the corners, colour and thickness of a box to be drawn @@ -589,7 +592,7 @@ PlotEquiMap(MeanDims(map_data$obs, 2)[1, 1, 1, , ], map_data$lon, map_data$lat, fileout = 'vis_equimap_box_expA.png') ``` - + - Ticks on the longitude/latitude axes can be adjusted with `axelab`, `labW`, `intylat` and `intxlon`. @@ -632,8 +635,8 @@ PlotStereoMap(MeanDims(world_data$obs, 2)[1, 1, 10, , ], units = "K", fileout = 'vis_stereomap_raw_obsX.png') ``` - - + + ### AnimateMap() @@ -688,15 +691,15 @@ AnimateMap(Subset(map_clim$exp, 'dataset', 1), units = "K", brks = brks, cols = cols, fileout = "vis_anim_clim_expA.gif") ``` - + And, as seen in [**Snippet 2**](snippets.md#snippet2), the animations of the actual time correlations of Experiment A and B against Observation X over the Atlantic, with black dots on values that reach a 95% significance level: - + - + Also the entire globe and stereographic projection maps can be animated: @@ -716,9 +719,9 @@ AnimateMap(world_clim$obs, fileout = "vis_anim_clim_obsX_world.gif") ``` - + - + ### PlotLayout() @@ -740,7 +743,7 @@ PlotLayout(PlotEquiMap, c('lat', 'lon'), fileout = "vis_layout_equimap_expA.png") ``` - + But really complex layouts can be achieved thanks to the great number of available parameters: @@ -765,7 +768,7 @@ layout <- PlotLayout(fun = c('PlotEquiMap', 'plot', 'plot', 'PlotStereoMap'), fileout = 'vis_layout_complex.png') ``` - + ### PlotSection()