diff --git a/DESCRIPTION b/DESCRIPTION index 09c1dbc2ee01809acd2a07d9bddbea541c9e653a..86859f21f36e58d19e966fc6f68d86c7197f7a42 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,6 +43,6 @@ URL: https://earth.bsc.es/gitlab/es/esviz/ BugReports: https://earth.bsc.es/gitlab/es/esviz/-/issues SystemRequirements: GDAL (>= 2.0.1), GEOS (>= 3.4.0), PROJ (>= 4.8.0) Encoding: UTF-8 -RoxygenNote: 7.2.0 +RoxygenNote: 7.2.3 Config/testthat/edition: 3 LazyData: true diff --git a/R/VizAnimateMap.R b/R/VizAnimateMap.R index 7efab6f538fffc939f18a691f7ef6b2735d1789f..748c1057f2297afd3eea5c1e932e94874284c677 100644 --- a/R/VizAnimateMap.R +++ b/R/VizAnimateMap.R @@ -98,7 +98,7 @@ #' toptitle = "climatology of decadal prediction", sizetit = 1, #' units = "K", brks = seq(270, 300, 3), monini = 11, freq = 12, #' msk95lev = FALSE, filled.continents = FALSE, intlon = 10, intlat = 10, -#' fileout = 'clim_animation.gif') +#' fileout = NULL) #' #'@importFrom grDevices postscript dev.off #' @importFrom s2dv InsertDim @@ -218,13 +218,13 @@ VizAnimateMap <- function(var, lon, lat, toptitle = rep("", 11), sizetit = 1, (max(brks) - min(brks))/1000 if (equi) { VizEquiMap(t(varbis), lonb$x, latb$x, toptitle = title, - sizetit = sizetit, units = units, filled.continents = filled.continents, + title_scale = sizetit, units = units, filled.continents = filled.continents, dots = t(flag), brks = brks, cols = cols, intxlon = intlon, intylat = intlat, drawleg = drawleg, subsampleg = subsampleg, colNA = colNA, ...) } else { VizStereoMap(t(varbis), lonb$x, latb$x, latlims = c(latmin, - latmax), toptitle = title, sizetit = sizetit, + latmax), toptitle = title, title_scale = sizetit, units = units, filled.continents = filled.continents, dots = t(flag), brks = brks, cols = cols, intlat = intlat, drawleg = drawleg, subsampleg = subsampleg, diff --git a/R/VizRobinson.R b/R/VizRobinson.R index 048677a5e0064a28a36de8e67a2ded73590e6e7d..7130f32fd44d1fd1e6768fd00569f5066d46b01d 100644 --- a/R/VizRobinson.R +++ b/R/VizRobinson.R @@ -21,15 +21,15 @@ #' of ascending or descending order. #'@param lon_dim A character string indicating the longitude dimension name in #' 'data'. If it is NULL, the function tries to find the name in -#' \code{s2dv:::.KnownLonNames}. The default value is NULL. +#' \code{esviz:::.KnownLonNames}. The default value is NULL. #'@param lat_dim A character string indicating the latitude dimension name in #' 'data'. If it is NULL, the function tries to find the name in -#' \code{s2dv:::.KnownLatNames}. The default value is NULL. +#' \code{esviz:::.KnownLatNames}. The default value is NULL. #'@param target_proj A character string indicating the target projection. It #' should be a valid crs string. The default projection is Robinson #' (ESRI:54030). Note that the character string may work differently depending #' on PROJ and GDAL module version. -#'@param legend A character string indicating the legend style. It can be 's2dv' +#'@param legend A character string indicating the legend style. It can be 'bar' #' (color bar by \code{ColorBarContinuous()}), 'ggplot2' (discrete legend by #' ggplot2), or NULL (no legend), #'@param style A character string indicating the plotting style. It can be @@ -61,7 +61,7 @@ #' parameters to control the visual aspect of the drawn colour bar #' (1/3). See ?ColorBarContinuous for a full explanation. #'@param vertical A logical value indicating the direction of colorbar if -#' parameter 'legend' is 's2dv'. The default value is TRUE. +#' parameter 'legend' is 'bar'. The default value is TRUE. #'@param toptitle A character string of the top title of the figure, scalable #' with parameter 'title_size'. #'@param caption A character string of the caption located at left-bottom of the @@ -117,7 +117,7 @@ #'@importFrom ClimProjDiags Subset #'@export VizRobinson <- function(data, lon, lat, lon_dim = NULL, lat_dim = NULL, - target_proj = 54030, legend = 's2dv', style = 'point', + target_proj = 54030, legend = 'bar', style = 'point', dots = NULL, mask = NULL, brks = NULL, cols = NULL, bar_limits = NULL, triangle_ends = NULL, col_inf = NULL, col_sup = NULL, colNA = NULL, color_fun = ClimPalette(), bar_extra_margin = rep(0, 4), vertical = TRUE, @@ -188,8 +188,8 @@ VizRobinson <- function(data, lon, lat, lon_dim = NULL, lat_dim = NULL, } # legend - if (!is.null(legend) && (!legend %in% c('s2dv', 'ggplot2'))) { - stop("Parameter 'legend' must be NULL, ggplot2 or s2dv.") + if (!is.null(legend) && (!legend %in% c('bar', 'ggplot2'))) { + stop("Parameter 'legend' must be NULL, ggplot2 or bar.") } # style if (!style %in% c('point', 'polygon') || length(style) != 1) { @@ -312,9 +312,9 @@ VizRobinson <- function(data, lon, lat, lon_dim = NULL, lat_dim = NULL, #================================================================= - # Adapt s2dv ColorBar parameters to ggplot plot - # If legend is NULL, still tune with s2dv legend way - if (is.null(legend) || legend == 's2dv') { + # Adapt ColorBarContinuous parameters to ggplot plot + # If legend is NULL, still tune with bar legend way + if (is.null(legend) || legend == 'bar') { # the colorbar triangle color. If it is NULL (no triangle plotted), use colNA col_inf_image <- ifelse(is.null(col_inf), colNA, col_inf) col_sup_image <- ifelse(is.null(col_sup), colNA, col_sup) @@ -493,7 +493,7 @@ VizRobinson <- function(data, lon, lat, lon_dim = NULL, lat_dim = NULL, guides(colour = guide_legend(title = units, override.aes = list(size = 1))) } - } else { # s2dv or NULL + } else { # bar or NULL if (style == 'polygon') { res_p <- res_p + scale_colour_manual(values = cols_ggplot, aesthetics = c("colour", "fill"), @@ -515,8 +515,8 @@ VizRobinson <- function(data, lon, lat, lon_dim = NULL, lat_dim = NULL, theme(plot.caption = element_text(hjust = 0, vjust = 1, margin = margin(0, 0, 0, 0, 'cm'))) } - # s2dv legend fun to put in cowplot::plot_grid - if (identical(legend, 's2dv')) { + # bar legend fun to put in cowplot::plot_grid + if (identical(legend, 'bar')) { fun_legend <- function() { if (vertical) { par(mar = c(7.1, 2.2, 7.1, 3.1), mgp = c(3, 1, 0)) diff --git a/man/VizAnimateMap.Rd b/man/VizAnimateMap.Rd index ccb103442083f0adb29323a7e47bf35c032300cf..23c0d4fce9aed6f9663bbf17d817e206b3b35e67 100644 --- a/man/VizAnimateMap.Rd +++ b/man/VizAnimateMap.Rd @@ -155,6 +155,6 @@ VizAnimateMap(clim$clim_exp[1, 1, , , ], lon = lons, lat = lats, toptitle = "climatology of decadal prediction", sizetit = 1, units = "K", brks = seq(270, 300, 3), monini = 11, freq = 12, msk95lev = FALSE, filled.continents = FALSE, intlon = 10, intlat = 10, - fileout = 'clim_animation.gif') + fileout = NULL) } diff --git a/man/VizRobinson.Rd b/man/VizRobinson.Rd index fd0dd94c469375f0db7c32e478bb2d778f227eaf..2da516256ccf7512833253ac705af1c343834dd0 100644 --- a/man/VizRobinson.Rd +++ b/man/VizRobinson.Rd @@ -11,7 +11,7 @@ VizRobinson( lon_dim = NULL, lat_dim = NULL, target_proj = 54030, - legend = "s2dv", + legend = "bar", style = "point", dots = NULL, mask = NULL, @@ -55,18 +55,18 @@ of ascending or descending order.} \item{lon_dim}{A character string indicating the longitude dimension name in 'data'. If it is NULL, the function tries to find the name in -\code{s2dv:::.KnownLonNames}. The default value is NULL.} +\code{esviz:::.KnownLonNames}. The default value is NULL.} \item{lat_dim}{A character string indicating the latitude dimension name in 'data'. If it is NULL, the function tries to find the name in -\code{s2dv:::.KnownLatNames}. The default value is NULL.} +\code{esviz:::.KnownLatNames}. The default value is NULL.} \item{target_proj}{A character string indicating the target projection. It should be a valid crs string. The default projection is Robinson (ESRI:54030). Note that the character string may work differently depending on PROJ and GDAL module version.} -\item{legend}{A character string indicating the legend style. It can be 's2dv' +\item{legend}{A character string indicating the legend style. It can be 'bar' (color bar by \code{ColorBarContinuous()}), 'ggplot2' (discrete legend by ggplot2), or NULL (no legend),} @@ -105,7 +105,7 @@ parameters to control the visual aspect of the drawn colour bar (1/3). See ?ColorBarContinuous for a full explanation.} \item{vertical}{A logical value indicating the direction of colorbar if -parameter 'legend' is 's2dv'. The default value is TRUE.} +parameter 'legend' is 'bar'. The default value is TRUE.} \item{toptitle}{A character string of the top title of the figure, scalable with parameter 'title_size'.} diff --git a/vignettes/Figures/map_equi_anim_clim_exp1.gif b/vignettes/Figures/map_equi_anim_clim_exp1.gif new file mode 100644 index 0000000000000000000000000000000000000000..51a8c6404fa3956a864e000f5463645ffdff6e31 Binary files /dev/null and b/vignettes/Figures/map_equi_anim_clim_exp1.gif differ diff --git a/vignettes/Figures/map_equi_contour_raw_exp1.png b/vignettes/Figures/map_equi_contour_raw_exp1.png new file mode 100644 index 0000000000000000000000000000000000000000..5a6493f0d1c7c65e76e9a493a5dd95dc1e94b31e Binary files /dev/null and b/vignettes/Figures/map_equi_contour_raw_exp1.png differ diff --git a/vignettes/Figures/map_equi_contour_raw_exp1_ver2.png b/vignettes/Figures/map_equi_contour_raw_exp1_ver2.png new file mode 100644 index 0000000000000000000000000000000000000000..96d8e192af6f3336e79f16c580755e51e09605e0 Binary files /dev/null and b/vignettes/Figures/map_equi_contour_raw_exp1_ver2.png differ diff --git a/vignettes/Figures/map_equi_corr_exp1_obs.png b/vignettes/Figures/map_equi_corr_exp1_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..b1511f32c672e0059d5ee92c1eb822ef7b3c7e03 Binary files /dev/null and b/vignettes/Figures/map_equi_corr_exp1_obs.png differ diff --git a/vignettes/Figures/map_equi_layout_complex.png b/vignettes/Figures/map_equi_layout_complex.png new file mode 100644 index 0000000000000000000000000000000000000000..00ffdd93f359f51cde4fa23e91696a563cad9fe9 Binary files /dev/null and b/vignettes/Figures/map_equi_layout_complex.png differ diff --git a/vignettes/Figures/map_equi_layout_exp1_ftime.png b/vignettes/Figures/map_equi_layout_exp1_ftime.png new file mode 100644 index 0000000000000000000000000000000000000000..a0905c709b73add2d4f9b8170358f059ae8e6ff6 Binary files /dev/null and b/vignettes/Figures/map_equi_layout_exp1_ftime.png differ diff --git a/vignettes/Figures/map_equi_raw_exp1.png b/vignettes/Figures/map_equi_raw_exp1.png new file mode 100644 index 0000000000000000000000000000000000000000..4edc7075a5fb315780fda671f49d5040d17dc174 Binary files /dev/null and b/vignettes/Figures/map_equi_raw_exp1.png differ diff --git a/vignettes/Figures/map_equi_raw_exp1_boxes.png b/vignettes/Figures/map_equi_raw_exp1_boxes.png new file mode 100644 index 0000000000000000000000000000000000000000..8524a9df5412cc3b55e53278de205488b8ffd547 Binary files /dev/null and b/vignettes/Figures/map_equi_raw_exp1_boxes.png differ diff --git a/vignettes/Figures/map_equi_raw_obs.png b/vignettes/Figures/map_equi_raw_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..9b38c5915e8cb79e9cffbaf70917ca050f76c7c6 Binary files /dev/null and b/vignettes/Figures/map_equi_raw_obs.png differ diff --git a/vignettes/Figures/map_robinson_rmsss_euro_lambert_point.png b/vignettes/Figures/map_robinson_rmsss_euro_lambert_point.png new file mode 100644 index 0000000000000000000000000000000000000000..0d422929f37ff8e52b196d8bc3f14235bb84befa Binary files /dev/null and b/vignettes/Figures/map_robinson_rmsss_euro_lambert_point.png differ diff --git a/vignettes/Figures/map_robinson_rmsss_euro_lambert_poly.png b/vignettes/Figures/map_robinson_rmsss_euro_lambert_poly.png new file mode 100644 index 0000000000000000000000000000000000000000..b7b902f2c69c8d068d1e88ba09b0683c1a568dd2 Binary files /dev/null and b/vignettes/Figures/map_robinson_rmsss_euro_lambert_poly.png differ diff --git a/vignettes/Figures/map_robinson_rmsss_global_moll.png b/vignettes/Figures/map_robinson_rmsss_global_moll.png new file mode 100644 index 0000000000000000000000000000000000000000..a50616337402606f4f3419c04e4187141664b841 Binary files /dev/null and b/vignettes/Figures/map_robinson_rmsss_global_moll.png differ diff --git a/vignettes/Figures/map_robinson_rmsss_global_robin.png b/vignettes/Figures/map_robinson_rmsss_global_robin.png new file mode 100644 index 0000000000000000000000000000000000000000..b9a75e37ba766699c1262f6fd8bc0491d51f1de1 Binary files /dev/null and b/vignettes/Figures/map_robinson_rmsss_global_robin.png differ diff --git a/vignettes/Figures/map_stereo_anim_clim_exp1_np.gif b/vignettes/Figures/map_stereo_anim_clim_exp1_np.gif new file mode 100644 index 0000000000000000000000000000000000000000..fd1c63fe04a18ea3c51d94c6aa1fcdaa8121278e Binary files /dev/null and b/vignettes/Figures/map_stereo_anim_clim_exp1_np.gif differ diff --git a/vignettes/Figures/map_stereo_clim_exp1_np.png b/vignettes/Figures/map_stereo_clim_exp1_np.png new file mode 100644 index 0000000000000000000000000000000000000000..4c0a9a4695aac1ff3404fa3f40a9e383cd95e2f6 Binary files /dev/null and b/vignettes/Figures/map_stereo_clim_exp1_np.png differ diff --git a/vignettes/Figures/map_stereo_clim_exp1_np_robin.png b/vignettes/Figures/map_stereo_clim_exp1_np_robin.png new file mode 100644 index 0000000000000000000000000000000000000000..3bac35415edbb66dd447d29f173a1fa8b68c1230 Binary files /dev/null and b/vignettes/Figures/map_stereo_clim_exp1_np_robin.png differ diff --git a/vignettes/Figures/map_stereo_clim_exp1_sp.png b/vignettes/Figures/map_stereo_clim_exp1_sp.png new file mode 100644 index 0000000000000000000000000000000000000000..a74339cc7dceb11701b99d2651cc520bdebfb321 Binary files /dev/null and b/vignettes/Figures/map_stereo_clim_exp1_sp.png differ diff --git a/vignettes/Figures/map_stereo_layout_clim_exp1_np.png b/vignettes/Figures/map_stereo_layout_clim_exp1_np.png new file mode 100644 index 0000000000000000000000000000000000000000..303604af4ddbeb506028285dc95dbc901e5348b2 Binary files /dev/null and b/vignettes/Figures/map_stereo_layout_clim_exp1_np.png differ diff --git a/vignettes/Figures/maps_equimap_contour_raw_exp1.png b/vignettes/Figures/maps_equimap_contour_raw_exp1.png deleted file mode 100644 index 805839c65f2a84ad38796285ed41468c5ee5945e..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/maps_equimap_contour_raw_exp1.png and /dev/null differ diff --git a/vignettes/Figures/maps_equimap_contour_raw_exp1_ver2.png b/vignettes/Figures/maps_equimap_contour_raw_exp1_ver2.png deleted file mode 100644 index 54ec0a08b96ead1f8dc8a134108a32bd588b6828..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/maps_equimap_contour_raw_exp1_ver2.png and /dev/null differ diff --git a/vignettes/Figures/maps_equimap_corr_exp1_obs.png b/vignettes/Figures/maps_equimap_corr_exp1_obs.png deleted file mode 100644 index defdd2d8a8638fa00e271139c67d24011dc6ad3a..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/maps_equimap_corr_exp1_obs.png and /dev/null differ diff --git a/vignettes/Figures/maps_equimap_raw_exp1.png b/vignettes/Figures/maps_equimap_raw_exp1.png deleted file mode 100644 index 91330833339c4e00b627146b1369228918a6cdc9..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/maps_equimap_raw_exp1.png and /dev/null differ diff --git a/vignettes/Figures/maps_equimap_raw_exp1_boxes.png b/vignettes/Figures/maps_equimap_raw_exp1_boxes.png deleted file mode 100644 index a0467505cf811166511c0e7f00b160fe61eb767e..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/maps_equimap_raw_exp1_boxes.png and /dev/null differ diff --git a/vignettes/Figures/maps_equimap_raw_obs.png b/vignettes/Figures/maps_equimap_raw_obs.png deleted file mode 100644 index 9a365ab96fd7e1896c98f3557e4a0e4550461771..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/maps_equimap_raw_obs.png and /dev/null differ diff --git a/vignettes/Figures/ts_acc_exp1_exp2_obs.png b/vignettes/Figures/ts_acc_exp1_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..b0a3a0d4fd561d9c05f2dbb642dcb6ffa49598d2 Binary files /dev/null and b/vignettes/Figures/ts_acc_exp1_exp2_obs.png differ diff --git a/vignettes/Figures/ts_clim_exp1_exp2_obs.png b/vignettes/Figures/ts_clim_exp1_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..44afbb447f250c732e77e7c7e72aaad70695e0bb Binary files /dev/null and b/vignettes/Figures/ts_clim_exp1_exp2_obs.png differ diff --git a/vignettes/Figures/ts_corr_exp1_exp2_obs.png b/vignettes/Figures/ts_corr_exp1_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..b1a3b4ccfe4658474852a68d4b287d2b926588af Binary files /dev/null and b/vignettes/Figures/ts_corr_exp1_exp2_obs.png differ diff --git a/vignettes/Figures/ts_corr_rms_exp1_exp2_obs.png b/vignettes/Figures/ts_corr_rms_exp1_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..fb9071863eebe128def84b3833c95609fe88066d Binary files /dev/null and b/vignettes/Figures/ts_corr_rms_exp1_exp2_obs.png differ diff --git a/vignettes/Figures/ts_eno_exp1_exp2.png b/vignettes/Figures/ts_eno_exp1_exp2.png new file mode 100644 index 0000000000000000000000000000000000000000..dd5c69cb978bd758bd0f69fc3671e509374af0a0 Binary files /dev/null and b/vignettes/Figures/ts_eno_exp1_exp2.png differ diff --git a/vignettes/Figures/ts_iqr_exp1_exp2.png b/vignettes/Figures/ts_iqr_exp1_exp2.png new file mode 100644 index 0000000000000000000000000000000000000000..b892c6a2947ea5843bc8be681adef81ce80a90d8 Binary files /dev/null and b/vignettes/Figures/ts_iqr_exp1_exp2.png differ diff --git a/vignettes/Figures/ts_mad_exp1_exp2.png b/vignettes/Figures/ts_mad_exp1_exp2.png new file mode 100644 index 0000000000000000000000000000000000000000..19f565c80cd71b9eccbbe23cdf5b2d7df6f73136 Binary files /dev/null and b/vignettes/Figures/ts_mad_exp1_exp2.png differ diff --git a/vignettes/Figures/ts_maxmin_exp1_exp2.png b/vignettes/Figures/ts_maxmin_exp1_exp2.png new file mode 100644 index 0000000000000000000000000000000000000000..afc6f7ddccc22b284b29de7683f10adb0cf19c30 Binary files /dev/null and b/vignettes/Figures/ts_maxmin_exp1_exp2.png differ diff --git a/vignettes/Figures/ts_ratiorms_exp1_exp2_obs.png b/vignettes/Figures/ts_ratiorms_exp1_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..ae71abcd440e641c256ec79bc015693db8629582 Binary files /dev/null and b/vignettes/Figures/ts_ratiorms_exp1_exp2_obs.png differ diff --git a/vignettes/Figures/ts_ratiosdrms_exp1_exp2_obs.png b/vignettes/Figures/ts_ratiosdrms_exp1_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..900f25ac21f0bed296eb0a520c1a12343b8abf4b Binary files /dev/null and b/vignettes/Figures/ts_ratiosdrms_exp1_exp2_obs.png differ diff --git a/vignettes/Figures/ts_ratiosdrms_exp1_obs1_obs2.png b/vignettes/Figures/ts_ratiosdrms_exp1_obs1_obs2.png new file mode 100644 index 0000000000000000000000000000000000000000..c4793b8b03e2b042c410f388345fa358c3435e42 Binary files /dev/null and b/vignettes/Figures/ts_ratiosdrms_exp1_obs1_obs2.png differ diff --git a/vignettes/Figures/ts_raw_exp1_obs.png b/vignettes/Figures/ts_raw_exp1_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..74ce76977fe4a12ca7cbe6b636a38b26a684cea4 Binary files /dev/null and b/vignettes/Figures/ts_raw_exp1_obs.png differ diff --git a/vignettes/Figures/ts_raw_exp2_obs.png b/vignettes/Figures/ts_raw_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..0e68f2b25ce5e1017e3c18fe8ab4714ad8f30904 Binary files /dev/null and b/vignettes/Figures/ts_raw_exp2_obs.png differ diff --git a/vignettes/Figures/ts_regression_exp1_exp2.png b/vignettes/Figures/ts_regression_exp1_exp2.png new file mode 100644 index 0000000000000000000000000000000000000000..7f69ae2f47a5265ce575c7176ff86d7e71c28391 Binary files /dev/null and b/vignettes/Figures/ts_regression_exp1_exp2.png differ diff --git a/vignettes/Figures/ts_rms_exp1_exp2_obs.png b/vignettes/Figures/ts_rms_exp1_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..6723caa062e489bfbaac6188a652b3c1db678b70 Binary files /dev/null and b/vignettes/Figures/ts_rms_exp1_exp2_obs.png differ diff --git a/vignettes/Figures/ts_rmsss_exp1_exp2_obs.png b/vignettes/Figures/ts_rmsss_exp1_exp2_obs.png new file mode 100644 index 0000000000000000000000000000000000000000..8900f8fce19da6ef67394d7c38ff047fb85ee80a Binary files /dev/null and b/vignettes/Figures/ts_rmsss_exp1_exp2_obs.png differ diff --git a/vignettes/Figures/ts_sd_exp1_exp2.png b/vignettes/Figures/ts_sd_exp1_exp2.png new file mode 100644 index 0000000000000000000000000000000000000000..b14d7ff43ccc3902dd73afb38acf943897f1b159 Binary files /dev/null and b/vignettes/Figures/ts_sd_exp1_exp2.png differ diff --git a/vignettes/Figures/ts_trend_exp1_exp2.png b/vignettes/Figures/ts_trend_exp1_exp2.png new file mode 100644 index 0000000000000000000000000000000000000000..b508a2d0aa718e92ad1eb3f80b9800fc9d1b882e Binary files /dev/null and b/vignettes/Figures/ts_trend_exp1_exp2.png differ diff --git a/vignettes/Figures/vis_acc_exp1_exp2_obs.png b/vignettes/Figures/vis_acc_exp1_exp2_obs.png deleted file mode 100644 index 279a53ea6a23b38dbaebd462677e639f97eccb16..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_acc_exp1_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_anim_clim_expA.gif b/vignettes/Figures/vis_anim_clim_expA.gif deleted file mode 100644 index 7554148d5550fcb194effa41520b06b8a7624f4d..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_anim_clim_expA.gif and /dev/null differ diff --git a/vignettes/Figures/vis_anim_clim_expA_world.gif b/vignettes/Figures/vis_anim_clim_expA_world.gif deleted file mode 100644 index f5980fc63ac320a6a99457e2e3c18fdc274d81c6..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_anim_clim_expA_world.gif and /dev/null differ diff --git a/vignettes/Figures/vis_anim_clim_expB.gif b/vignettes/Figures/vis_anim_clim_expB.gif deleted file mode 100644 index 465a71528f933b7add55df5ab8d0c81572df1a94..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_anim_clim_expB.gif and /dev/null differ diff --git a/vignettes/Figures/vis_anim_clim_obsX.gif b/vignettes/Figures/vis_anim_clim_obsX.gif deleted file mode 100644 index c8d2aefe08a5b115e480434581210b44f5205da8..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_anim_clim_obsX.gif and /dev/null differ diff --git a/vignettes/Figures/vis_anim_clim_obsX_world.gif b/vignettes/Figures/vis_anim_clim_obsX_world.gif deleted file mode 100644 index 1d94c28ce9ce9afa3c3c8f0a4c1b09a819fae6ea..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_anim_clim_obsX_world.gif and /dev/null differ diff --git a/vignettes/Figures/vis_ano_exp_obs.png b/vignettes/Figures/vis_ano_exp_obs.png deleted file mode 100644 index 2047c681ebdde2fcdd4c8d8e445f4a897a5f9df3..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_ano_exp_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_ano_exp_points.png b/vignettes/Figures/vis_ano_exp_points.png deleted file mode 100644 index cdcfd8e5c3c8ae2adea46ccb439adedda89f2f4e..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_ano_exp_points.png and /dev/null differ diff --git a/vignettes/Figures/vis_clim_exp1_exp2_obs.png b/vignettes/Figures/vis_clim_exp1_exp2_obs.png deleted file mode 100644 index 626e662c248b873d458cf3c2ac814cf9b98cc87f..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_clim_exp1_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_conf_interval_exp.png b/vignettes/Figures/vis_conf_interval_exp.png deleted file mode 100644 index 85cf56d5a37ff14720c42316ad30a853cef6c89a..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_conf_interval_exp.png and /dev/null differ diff --git a/vignettes/Figures/vis_corr_exp1_exp2_obs.png b/vignettes/Figures/vis_corr_exp1_exp2_obs.png deleted file mode 100644 index 872f165b06342ca8e60db010d437d932e260a9e0..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_corr_exp1_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_corr_rms_exp1_exp2_obs.png b/vignettes/Figures/vis_corr_rms_exp1_exp2_obs.png deleted file mode 100644 index 9e1b27247febc3be143b0ca5ce60d65d6c227dd0..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_corr_rms_exp1_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_eno_exp1_exp2.png b/vignettes/Figures/vis_eno_exp1_exp2.png deleted file mode 100644 index edab0597838ff471cbcc8ee00d4dfb868ea2f7e0..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_eno_exp1_exp2.png and /dev/null differ diff --git a/vignettes/Figures/vis_equimap_box_expA.png b/vignettes/Figures/vis_equimap_box_expA.png deleted file mode 100644 index 7c5686ad31e46de4e976fbb9e78e6ce505bdc7b5..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_equimap_box_expA.png and /dev/null differ diff --git a/vignettes/Figures/vis_equimap_cols_raw_expA.png b/vignettes/Figures/vis_equimap_cols_raw_expA.png deleted file mode 100644 index afd7550eba4cba35630387787faa43d425cc37db..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_equimap_cols_raw_expA.png and /dev/null differ diff --git a/vignettes/Figures/vis_equimap_cols_raw_obsX.png b/vignettes/Figures/vis_equimap_cols_raw_obsX.png deleted file mode 100644 index b3cf03532291470b231ce90e295c8c79f5fc87f9..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_equimap_cols_raw_obsX.png and /dev/null differ diff --git a/vignettes/Figures/vis_equimap_contour_raw_expA.png b/vignettes/Figures/vis_equimap_contour_raw_expA.png deleted file mode 100644 index 15b3a630fa62b4e49ec63e7529affcdb804ffeb7..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_equimap_contour_raw_expA.png and /dev/null differ diff --git a/vignettes/Figures/vis_equimap_contour_raw_obsX.png b/vignettes/Figures/vis_equimap_contour_raw_obsX.png deleted file mode 100644 index a526700e7c12c690de0b37fc943e5d58a48f82ec..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_equimap_contour_raw_obsX.png and /dev/null differ diff --git a/vignettes/Figures/vis_equimap_raw_expA.png b/vignettes/Figures/vis_equimap_raw_expA.png deleted file mode 100644 index 7f8441331ec7047b9e787f794abbe9a1b9077d36..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_equimap_raw_expA.png and /dev/null differ diff --git a/vignettes/Figures/vis_equimap_raw_obsX.png b/vignettes/Figures/vis_equimap_raw_obsX.png deleted file mode 100644 index f99ae26dd438ff43698d3d66872fcdbf5a5fb1dd..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_equimap_raw_obsX.png and /dev/null differ diff --git a/vignettes/Figures/vis_error_bar.png b/vignettes/Figures/vis_error_bar.png deleted file mode 100644 index 87718e965faac97ba5f1f866016372ea57c37719..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_error_bar.png and /dev/null differ diff --git a/vignettes/Figures/vis_iqr_exp1_exp2.png b/vignettes/Figures/vis_iqr_exp1_exp2.png deleted file mode 100644 index 43bdcebea31dc5fa7a2cc16ddac2a24e62404165..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_iqr_exp1_exp2.png and /dev/null differ diff --git a/vignettes/Figures/vis_layout_complex.png b/vignettes/Figures/vis_layout_complex.png deleted file mode 100644 index dfbfc96b356901a0360b25512bd8b31da9947019..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_layout_complex.png and /dev/null differ diff --git a/vignettes/Figures/vis_layout_equimap_expA.png b/vignettes/Figures/vis_layout_equimap_expA.png deleted file mode 100644 index 6804590a36d0c071f241c65519618f708d2fe4c1..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_layout_equimap_expA.png and /dev/null differ diff --git a/vignettes/Figures/vis_mad_exp1_exp2.png b/vignettes/Figures/vis_mad_exp1_exp2.png deleted file mode 100644 index ef2493271788b9196e81d40fcc4a37856a1b26a0..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_mad_exp1_exp2.png and /dev/null differ diff --git a/vignettes/Figures/vis_maxmin_exp1_exp2.png b/vignettes/Figures/vis_maxmin_exp1_exp2.png deleted file mode 100644 index 71cd25d2897618b9b8cc4c6e5820c15ed6af78ba..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_maxmin_exp1_exp2.png and /dev/null differ diff --git a/vignettes/Figures/vis_proj_eu_1.png b/vignettes/Figures/vis_proj_eu_1.png deleted file mode 100644 index 7275ea88d10278c12702bb3419e4aa7802839af4..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_proj_eu_1.png and /dev/null differ diff --git a/vignettes/Figures/vis_proj_eu_2.png b/vignettes/Figures/vis_proj_eu_2.png deleted file mode 100644 index dae2c4d5b6d8380365e623bc39c18867e92c129b..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_proj_eu_2.png and /dev/null differ diff --git a/vignettes/Figures/vis_proj_global_1.png b/vignettes/Figures/vis_proj_global_1.png deleted file mode 100644 index dbd18c15d35392f1993e20fe9cee8c053f1cc6cf..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_proj_global_1.png and /dev/null differ diff --git a/vignettes/Figures/vis_proj_global_2.png b/vignettes/Figures/vis_proj_global_2.png deleted file mode 100644 index e82903bc2c2b136b0c9c49618d8c35e1162f3294..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_proj_global_2.png and /dev/null differ diff --git a/vignettes/Figures/vis_proj_np_1.png b/vignettes/Figures/vis_proj_np_1.png deleted file mode 100644 index a3f4a1995290c4813729d4a9f152aff49a5d5286..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_proj_np_1.png and /dev/null differ diff --git a/vignettes/Figures/vis_proj_np_2.png b/vignettes/Figures/vis_proj_np_2.png deleted file mode 100644 index b2a7e49ed4726fd2278e8e6345289aca39b32d9a..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_proj_np_2.png and /dev/null differ diff --git a/vignettes/Figures/vis_ratiorms_exp1_exp2_obs.png b/vignettes/Figures/vis_ratiorms_exp1_exp2_obs.png deleted file mode 100644 index da6e168b3f6087ac81a27f1c2bc070eb20884d29..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_ratiorms_exp1_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_ratiosdrms_exp1_exp2_obs.png b/vignettes/Figures/vis_ratiosdrms_exp1_exp2_obs.png deleted file mode 100644 index 55e3ddfa11f9817f0b1e10b9566a07ff19ded09e..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_ratiosdrms_exp1_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_ratiosdrms_exp1_obs1_obs2.png b/vignettes/Figures/vis_ratiosdrms_exp1_obs1_obs2.png deleted file mode 100644 index b6ec514926fea43ab1501007e2cc1dab3324ac8d..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_ratiosdrms_exp1_obs1_obs2.png and /dev/null differ diff --git a/vignettes/Figures/vis_raw_exp1_obs.png b/vignettes/Figures/vis_raw_exp1_obs.png deleted file mode 100644 index 2ca62b6309b6d5aba1eedda0624477afdaa74b09..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_raw_exp1_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_raw_exp2_obs.png b/vignettes/Figures/vis_raw_exp2_obs.png deleted file mode 100644 index 72647ea3a5cbe71a42693510683175050812470c..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_raw_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_regression_exp1_exp2.png b/vignettes/Figures/vis_regression_exp1_exp2.png deleted file mode 100644 index 3f3bc6b0c39db22afcae93a15a41a5ed9ea1577b..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_regression_exp1_exp2.png and /dev/null differ diff --git a/vignettes/Figures/vis_rms_exp1_exp2_obs.png b/vignettes/Figures/vis_rms_exp1_exp2_obs.png deleted file mode 100644 index 5c7c635a98c2da487efc9e8a85a6ae7b6a54d57e..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_rms_exp1_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_rmsss_exp1_exp2_obs.png b/vignettes/Figures/vis_rmsss_exp1_exp2_obs.png deleted file mode 100644 index c8e5c492280f5374de791617ac0031d759496ee5..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_rmsss_exp1_exp2_obs.png and /dev/null differ diff --git a/vignettes/Figures/vis_sd_exp1_exp2.png b/vignettes/Figures/vis_sd_exp1_exp2.png deleted file mode 100644 index 970408bf104f95480831f74f32743cf130101ffb..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_sd_exp1_exp2.png and /dev/null differ diff --git a/vignettes/Figures/vis_stereomap_raw_expA.png b/vignettes/Figures/vis_stereomap_raw_expA.png deleted file mode 100644 index fb7b265f17f3208599f60be708cd619be2179b21..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_stereomap_raw_expA.png and /dev/null differ diff --git a/vignettes/Figures/vis_stereomap_raw_obsX.png b/vignettes/Figures/vis_stereomap_raw_obsX.png deleted file mode 100644 index 4d1ffe56ed243fc73a7d136bbadf341347d5b58f..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_stereomap_raw_obsX.png and /dev/null differ diff --git a/vignettes/Figures/vis_trend_exp1_exp2.png b/vignettes/Figures/vis_trend_exp1_exp2.png deleted file mode 100644 index 234727f55e0206f97ff5dfe913b83a03e51ac5f4..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/vis_trend_exp1_exp2.png and /dev/null differ diff --git a/vignettes/data_loading.md b/vignettes/data_loading.md index 3eb4335f2fbab6f2802e115e6e63562951106086..2dac9f31f45f3af910a69cfea84ed0c45caf79ad 100644 --- a/vignettes/data_loading.md +++ b/vignettes/data_loading.md @@ -1,10 +1,11 @@ --- +title: "Data Loading" author: "An-Chi Ho" date: "`r Sys.Date()`" output: html_document vignette: > %\VignetteEngine{R.rsp::md} - %\VignetteIndexEntry{Visualisation} + %\VignetteIndexEntry{Data Loading} %\usepackage[utf8]{inputenc} --- @@ -17,8 +18,13 @@ to obtain the sample data. We are going to load three datasets: the experiment data are SEAS5 and Meteo-France System 7 from ECMWF, and the observation data ERA5 from ECMWF. +In vignettes [Time Series](time_series.md) and [Map: Equidistant Projection](map_proj_equi.md), we use Europe region (20W-40E, 20N-80N); +in [Map: Stereographic Projection](map_proj_stereo.md), we use global region; +and in [Map: Various Projection](map_proj_robinson.md), we use both. +Adjust the variable `region` in the script to load different region. + The variable to be analyzed is the monthly mean near-surface temperature (tas). -The region is Europe (20W-40E, 20N-80N), and the forecast years are 1997 to 2016. +The forecast years are 1997 to 2016 for european region and 2011 to 2016 for global region. The initial month is November. All the ensemble members and the first 6 forecast time steps are loaded. ## Load monthly mean data @@ -26,7 +32,22 @@ The initial month is November. All the ensemble members and the first 6 forecast ```r library(startR) -sdates <- paste0(1997:2016, '1101') +region <- "euro" +if (region == "euro") { + lat_min <- 20 + lat_max <- 80 + lon_min <- -20 + lon_max <- 40 + sdates <- paste0(1997:2016, '1101') + +} else if (region == "global") { + lat_min <- -90 + lat_max <- 90 + lon_min <- -180 + lon_max <- 179.99 + sdates <- paste0(2011:2016, '1101') + +} repo_exp1 <- paste0('/esarchive/exp/ecmwf/system5c3s/monthly_mean/', '$var$_f6h/$var$_$sdate$.nc') @@ -39,9 +60,9 @@ exp <- Start(dat = list(list(name = "system5c3s", path = repo_exp1), sdate = sdates, time = 1:6, ensemble = 'all', - lat = values(list(20, 80)), + lat = values(list(lat_min, lat_max)), lat_reorder = Sort(), - lon = values(list(-20, 40)), + lon = values(list(lon_min, lon_max)), lon_reorder = CircularSort(-180, 180), transform = CDORemapper, transform_params = list(grid = 'r360x181', method = 'bilinear'), @@ -60,9 +81,9 @@ obs <- Start(dat = repo_obs, var = 'tas', sdate = sdate_obs, split_multiselected_dims = TRUE, - lat = values(list(20, 80)), + lat = values(list(lat_min, lat_max)), lat_reorder = Sort(), - lon = values(list(-20, 40)), + lon = values(list(lon_min, lon_max)), lon_reorder = CircularSort(-180, 180), transform = CDORemapper, transform_params = list(grid = 'r360x181', method = 'bilinear'), @@ -92,6 +113,9 @@ dim(obs_sm) <- dim(obs_sm)[c("dat", "sdate", "time")] Now, we have both the original data and the spatial mean data. We can move to other vignettes to see the usage of the plotting functions: -- [**time_series.md**](time_series.md): To plot different types of time series data -- [**maps.md**](maps.md): To plot different type of map data -- [**proj_map.md**](proj_map.md): To plot maps with different projections +- [**Time Series Plotting**](time_series.md): To plot different types of time series data +- [**Map: Equidistant Projection**](map_proj_equi.md +): Introduce the functions that plot maps with equidistant projection +- [**Map: Stereographic Projection**](map_proj_stereo.md +): Introduce the functions that plot maps with stereographic projection +- [**Map: Various Projections**](map_proj_robinson.md): To plot maps with various projections diff --git a/vignettes/map_proj_equi.md b/vignettes/map_proj_equi.md new file mode 100644 index 0000000000000000000000000000000000000000..ed5519725a3ff785df77c09e7488db07d57b8705 --- /dev/null +++ b/vignettes/map_proj_equi.md @@ -0,0 +1,247 @@ +--- +title: "Map: Equidistant Projection" +author: "An-Chi Ho" +date: "2023-11-20" +output: html_document +vignette: > + %\VignetteEngine{knitr::rmarkdown} + %\VignetteIndexEntry{Map: Equidistant Projection} + %\usepackage[utf8]{inputenc} +--- + +We will use the data loaded in [Data Loading](data_loading.md) in this vignette. +Please follow that vignette first to get the data if you want to replicate the results in this vignette. Load European region data with `region = "euro"` in the loading script. + +# Map plotting + +In this vignette, we will go through the functions that plot the maps with equidistant projection: +`VizEquiMap()`, `VizAnimateMap()`, `VizLayout()`. + +Some traits of these plotting functions: + - Expect a data matrix in the parameter `var` of dimensions +`c(n. of latitudes, n. of longitudes)`, `lat` with a vector with the latitudes +of the centers of the grid cells and `lon`, a vector with the longitudes. + - The N colors to paint the grid cells with (via `cols`) as well as the N + +1 threshold magnitudes (via `brks`) that will allow to assign each grid cell +value one of the N colours. The colour for any missing values can be adjusted +with `colNA`. + - Whether to fill the map continents or only draw coast wires can be adjusted +with `filled.continents`. + - A matrix of `dots` can be plotted over the drawn map to, e.g., highlight +cells where a skill has been greatest or most significant. + - A legend can be drawn (unless disabled with `drawleg`) and the amount of +ticks on that legend can be adjusted with `subsampleg`. + - They accept any additional parameters via the parameter `...` to be sent to +the underlying R graphics `image()` function for a fine tuning. + +Check the function documentation to see all the parameters that help you adjust the visualization. + +## VizEquiMap() + +VizEquiMap() plots the map with rectangular equidistant projection. +It has various parameters to adjust the visualization. + +### Basic usage + +Plot the raw experimental and observational data. +```r +# Plot the first experiment, ensemble mean, first start year, first forecast time +exp1 <- ClimProjDiags::Subset(exp, c("dat", "var"), list(1, 1), drop = 'selected') +exp1 <- s2dv::MeanDims(exp1, "ensemble") +lats <- attr(exp, 'Variables')$system5c3s$lat +lons <- attr(exp, 'Variables')$system5c3s$lon + +VizEquiMap(exp1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, + toptitle = "SEAS5 near-surface temperature, Nov. 1997", + units = "K", bar_limits = c(250, 300), brks = 21, + width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), + fileout = 'map_equi_raw_exp1.png') + +# Plot corresponding observational data +obs1 <- ClimProjDiags::Subset(obs, c("dat", "var"), list(1, 1), drop = 'selected') +VizEquiMap(obs1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, + toptitle = "ERA5 near-surface temperature, Nov. 1997", + units = "K", bar_limits = c(250, 300), brks = 21, + width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), + fileout = 'map_equi_raw_obs.png') +``` + + + +### dots + +Plot correlation with the significance by parameter `dots`. +Use s2dv function `Corr()` to calculate the correlation. The dotted points are the insignificant ones. + +```r +corr <- s2dv::Corr(exp1, obs1, time_dim = 'sdate', dat_dim = NULL, sign = TRUE, + conf = FALSE, pval = FALSE) +VizEquiMap(corr$corr[1, , ], lon = lons, lat = lats, filled.continents = FALSE, + dots = !drop(corr$sign)[1, , ], dot_symbol = 3, dot_size = 1.2, + toptitle = "Correlation of near-surface temperature, SEAS5 - ERA5, Nov. 1997", + title_scale = 0.7, color_fun = ClimPalette("yellowred"), + bar_limits = c(0, 1), brks = 21, + width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), + fileout = 'map_equi_corr_exp1_obs.png') +``` + + + +### contours + +To draw the contour lines, set parameter `square` as FALSE to smooth the grid borders. +The contours can be adjusted by providing a matrix to parameter `contours` with dimensions +`c(n. of longitudes, n. of latitudes)`. The contours matrix will be drawn over the map, +using the thresholds provided in `brks2`. + +You can also plot the contours of the original data without border +smoothing, to plot only some of the default contours, or to plot contours +defined by another field. + +Here, we plot the same raw data as the previous section but with contours. +```r +VizEquiMap(exp1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, + square = FALSE, + toptitle = "SEAS5 near-surface temperature, Nov. 1997", + units = "K", bar_limits = c(250, 300), brks = 21, + width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), + fileout = 'map_equi_contour_raw_exp1.png') + +# Adjust the styles +VizEquiMap(exp1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, + square = TRUE, + contours = exp1[1, 1, , ], contour_lwd = 1, brks2 = seq(240, 300, 5), + contour_color = 'blue', contour_lty = 5, contour_label_scale = 0.7, + toptitle = "SEAS5 near-surface temperature, Nov. 1997", + units = "K", bar_limits = c(250, 300), brks = 21, + width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), + fileout = 'map_equi_contour_raw_exp1_ver2.png') +``` + + + + +### Boxes + +We can draw boxes on the map using parameters `boxlim`, `boxcol` and `boxlwd`. +They specify the position of the corners, color and thickness of a box to be drawn +on the map. + +We use the same raw data from the previous section and add two boxes, +one over Alpine region (green) and one over south side of Mediterranean Sea (yellow). +```r +VizEquiMap(exp1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, + toptitle = "SEAS5 near-surface temperature, Nov. 1997", + units = "K", bar_limits = c(250, 300), brks = 21, + width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), + boxlim = list(c(6, 45, 15, 48), c(10, 30, 20, 36)), + boxcol = c('green', 'yellow'), boxlwd = c(2, 2), + fileout = 'map_equi_raw_exp1_boxes.png') +``` + + + + +## VizAnimateMap() + +`VizAnimateMap()` generates animation of maps from `VizEquiMap()` or +`VizStereoMap()` and saves them as .gif file . The input array should have dimensions as follow: +```r + c(n. of experiments/observations, n. of observations, 3, n. of forecast times, n. of latitudes, n. of longitudes) +``` +The first 3 dimensions are optional; the 3rd dimension corresponding to the lower +confidence interval, the actual value and the upper confidence interval. +The confidence intervals, if provided, are drawn with +black dots on grid cells where reach 95% significance level, if requested via `msk95lev`. + +The data is assumed to be monthly frequency and to start in +January. Otherwise it can be adjusted with `monini` and `freq`. + +Whether to plot with a equidistant rectangular projection or a stereographic +projection can be chosen with the parameter `equi`. The plot can be limited to +a sub-region of the provided data via the parameters `lonmin`, `lonmax`, `latmin` and `latmax`. +Check function documentation for more explanations of function arguments. + +In the following example, we use s2dv function MeanDims() to calcualte climatologies, then make animation through forecast time. + +```r +exp_clim <- s2dv::MeanDims(exp1, dims = "sdate", na.rm = T, drop = TRUE) + +cols <- ClimColors(50) +col_inf <- cols[1] +col_sup <- tail(cols, 1) +cols <- cols[c(2:49)] +brks_range <- range(exp_clim, na.rm = TRUE) +brks <- round(seq(ceiling(brks_range[1]), floor(brks_range[2]), + length.out = length(cols) + 1), 1) + +VizAnimateMap(exp_clim, lon = lons, lat = lats, + monini = 11, + toptitle = "SEAS5 climatologies (1997-2016)", + units = "K", brks = brks, cols = cols, + col_inf = col_inf, col_sup = col_sup, + triangle_ends = c(T, T), + fileout = "map_equi_anim_clim_exp1.gif") +``` + + +## VizLayout() + +This function combined plots from any R plot function in +layouts, and a common color bar can be set for the multi-panel. + +In the following example, we plot the ensemble-mean climatology at each forecast time by VizEquiMap(). + +```r +VizLayout(fun = VizEquiMap, plot_dims = c('lat', 'lon'), + var = exp_clim, lon = lons, lat = lats, + units = 'K', title_scale = 0.8, + toptitle = "SEAS5 tas climatology (1997-2016)", + titles = paste0("ftime ", seq_len(dim(exp_clim)[1]), ": ", + lubridate::month(c(11:12, 1:4), label = T)), + brks = brks, cols = cols, + col_inf = col_inf, col_sup = col_sup, + triangle_ends = c(T, T), coast_color = 'black', + fileout = "map_equi_layout_exp1_ftime.png") +``` + + + +VizLayout() can also put plots from different plotting functions together. In the next plot, we use VizEquiMap(), base function plot(), and VizVsLTime() in VizLayout(). + +Check [data_loading.md](#data-loading) to get spatial mean `exp_sm` and `obs_sm`., and [time_series.md](#time-series#1-trend-and-regression) to see the explanation of trend calculation. + +```r +# Calculate anomalies and trend +ano <- s2dv::Ano_CrossValid(exp_sm, obs_sm, memb = FALSE, dat_dim = c("dat", "ensemble"), memb_dim = "ensemble") +trend_exp <- s2dv::Trend(s2dv::MeanDims(ano$exp, 'ensemble'), time_dim = "sdate") +input_trend <- array(dim = c(dat = 2, 4, time = 6)) +input_trend[, 1, ] <- trend_exp$conf.lower[2, , ] +input_trend[, 2, ] <- trend_exp$trend[2, , ] +input_trend[, 3, ] <- trend_exp$conf.upper[2, , ] +input_trend[, 4, ] <- trend_exp$trend[1, , ] + +# Arguments for each plot +args <- list( + list(lon = lons, lat = lons, + filled.continents = FALSE, title_scale = 0.5, axes_label_scale = 0.6, + units = 'K', units_scale = 2), + list(), list(), + list(monini = 11, freq = 12, ytitle = "K/year", limits = c(-0.02, 0.1), + listexp = c('SEAS5', 'Meteo-France System 7'), sizetit = 0.5, leg = F) +) + +VizLayout(fun = c('VizEquiMap', 'plot', 'plot', 'VizVsLTime'), + plot_dims = list(c('lat', 'lon'), 1, 1, 1:3), + var = list(exp_clim, array(1:10), array(10:1), input_trend), + special_args = args, drawleg = 'E', + brks = brks, cols = cols, + col_inf = col_inf, col_sup = col_sup, triangle_ends = c(T, T), + titles = paste('Fig.', 1:9), toptitle = 'Multipanel', + row_titles = paste('Row', 1:3), col_titles = paste('Col', 1:3), + width = 12, height = 12, res = 200, + fileout = 'map_equi_layout_complex.png') +``` + + +As you can see, some plots in the layout don't have appropriate plot setting. For example, the axis labels in the last plot from VizVsLTime() are too big; plots from plot() don't have titles. Please contact us if you'd like to have VizLayout() work well with these plotting functions and we can try to improve it. diff --git a/vignettes/map_proj_robinson.md b/vignettes/map_proj_robinson.md new file mode 100644 index 0000000000000000000000000000000000000000..4908340493d8e9c6160eb1ee780fcc0c535b3592 --- /dev/null +++ b/vignettes/map_proj_robinson.md @@ -0,0 +1,163 @@ +--- +title: "Map: Various Projections" +author: "An-Chi Ho" +date: "2023-11-21" +output: html_document +vignette: > + %\VignetteEngine{knitr::rmarkdown} + %\VignetteIndexEntry{Map: Various Projections} + %\usepackage[utf8]{inputenc} +--- + +# Visualization of different projections + +This vignette shows how to use function `VizRobinson()`, which can plot maps with the projection of your choice. +The projection types and IDs can be found on https://epsg.io/. Note that different PROJ and GDAL module versions may have different CRS codes. In this vignettes, GDAL_3.5.2 and PROJ_9.1.0 are used. + +We will use the data loaded in [Data Loading](data_loading.md) in this vignette. +Please follow that vignette first to get the data if you want to replicate the results in this vignette. Load global data with `region = "global"` and european data with `region = "euro"` in the loading script. + +## Global Robinson Projection + +First, we use s2dv function `Clim()` and `Ano()` to calculate anomalies, then use `RMSSS()` to calculate +root mean square error skill score between ensemble-mean experiment SEAS5 and the observation ERA5. + +```r +exp1 <- ClimProjDiags::Subset(exp, c("dat", "var"), list(1, 1), drop = "selected") +exp1 <- s2dv::MeanDims(exp1, "ensemble") +obs1 <- ClimProjDiags::Subset(obs, c("dat", "var"), list(1, 1), drop = "selected") + +# Calculate anomalies and trend +clim <- s2dv::Clim(exp1, obs1, dat_dim = NULL, memb_dim = NULL) +ano_exp <- s2dv::Ano(exp1, clim$clim_exp) +ano_obs <- s2dv::Ano(obs1, clim$clim_obs) + +# Calculate RMSSS +rmsss <- s2dv::RMSSS(ano_exp, ano_obs, + time_dim = 'sdate', dat_dim = NULL, + pval = FALSE, sign = TRUE, alpha = 0.05, + sig_method = "Random Walk", sig_method.type = "two.sided") +``` + +We plot the RMSSS result where pass 95% significance test. The points that are not significant, we can use parameter `mask` to not plot them or use parameter `dots` to mark the unsignificance. + +```r +lats <- attributes(exp)$Variables$system5c3s$lat +lons <- attributes(exp)$Variables$system5c3s$lon + +# Create adequete colorbar elements for the plot +cols <- ClimColors(52, palette = "purpleorange") +col_inf <- cols[1] +col_sup <- tail(cols, 1) +cols <- cols[c(2:51)] +brks <- seq(-1, 1, length.out = 51) + +``` +The code of Robinson projection is 54030 or 53030. +Note that different PROJ and GDAL module versions have different CRS codes. If on workstation, use "54030"; if on hub, use "54030"; if on Nord3v2, please use "ESRI:53030" or "+proj=robin" to get the correct Robinson projection. + +The plot style can be either "point" or "polygen", which is more time-consuming. There are two types of legend, 'ggplot2' or 'bar'. You can also set `legend` as `NULL` to not plot legend. + +```r +VizRobinson(rmsss$rmsss[1, , ], lon = lons, lat = lats, + target_proj = "ESRI:54030", + dots = !rmsss$sign[1, , ], dots_size = 0.7, + brks = brks, cols = cols, col_inf = col_inf, + style = 'point', legend = 'bar', + toptitle = "RMSSS SEAS5-ERA5 monthly tas anomaly Nov 2011-2016", + caption = "Projection: Robinson ESRI:54030", + width = 10, height = 6, + fileout = 'map_robinson_rmsss_global_robin.png') + +``` + + + + +## Global Mollweide Projection + +You can find more projection types through the link at the beginning. `VizRobinson()` is mainly designed for Robinson projection, but it is possible to use other projections as well. +For example, Mollweide projection is "ESRI:54009" or "ESRI:53009". We use parameter "mask" instead of "dots" to ignore unsignificant points. + +```r +VizRobinson(rmsss$rmsss[1, , ], lon = lons, lat = lats, + target_proj = "ESRI:54009", + mask = !rmsss$sign[1, , ], + color_fun = ClimPalette("yellowred"), + brks = 21, bar_limits = c(-1, 1), + style = 'point', legend = 'bar', + toptitle = "RMSSS SEAS5-ERA5 monthly tas anomaly Nov 2011-2016", + caption = "Projection: Mollweide ESRI:54009", + width = 10, height = 6, + fileout = 'map_robinson_rmsss_global_moll.png') + + +``` + + +Check how to plot arctic polar stereographic projection (EPSG:3995) in [Map: Stereographic Projection](map_proj_stereo.md#vizrobinson) + +## European region + +Load the European region data with vignette [Data Loading](data_loading.md) by assigin `region = "euro"` in the loading script. + +```r +exp1_eu <- ClimProjDiags::Subset(exp_eu, c("dat", "var"), list(1, 1), drop = "selected") +exp1_eu <- s2dv::MeanDims(exp1_eu, "ensemble") +obs1_eu <- ClimProjDiags::Subset(obs_eu, c("dat", "var"), list(1, 1), drop = "selected") + +# Calculate anomalies and trend +clim_eu <- s2dv::Clim(exp1_eu, obs1_eu, dat_dim = NULL, memb_dim = NULL) +ano_exp_eu <- s2dv::Ano(exp1_eu, clim_eu$clim_exp) +ano_obs_eu <- s2dv::Ano(obs1_eu, clim_eu$clim_obs) + +# Calculate RMSSS +rmsss_eu <- s2dv::RMSSS(ano_exp_eu, ano_obs_eu, + time_dim = 'sdate', dat_dim = NULL, + pval = FALSE, sign = TRUE, alpha = 0.05, + sig_method = "Random Walk", sig_method.type = "two.sided") + +``` + +The parameter `crop_coastlines` helps to adjust the map coastline plotting. You can test and find the best range. Note that this parameter is not suitable for the case that longitude range exceeds half of the earth (i.e., 180 degrees.) + +We can also choose to plot the map by polygon instead of point. Note that polygon is relatively **slow** so it takes a long time for global map. + +Note that `target_proj = 102014` does not work well on Nord3v2. Use PROJ.4 string `target_proj = "+proj=lcc +lat_0=30 +lon_0=10 +lat_1=43 +lat_2=62 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs +type=crs"` instead. + +```r +lats_eu <- attributes(exp_eu)$Variables$system5c3s$lat +lons_eu <- attributes(exp_eu)$Variables$system5c3s$lon + +## style = point +VizRobinson(rmsss_eu$rmsss[1, , ], lon = lons_eu, lat = lats_eu, + target_proj = "ESRI:102014", + style = 'point', legend = 'bar', + mask = !rmsss_eu$sign[1, , ], + brks = 21, cols = cols, bar_limits = c(-0.8, 0.8), + bar_extra_margin = c(0.6, 3, 0.6, 3), + point_size = 1.3, + crop_coastlines = c(lonmin = -20, lonmax = 40, latmin = 27, latmax = 70), + toptitle = "RMSSS SEAS5-ERA5 tas Nov 1997-2016", + caption = paste0("Projection: Lambert Europe\nESRI:102014\n", "Europe"), + vertical = F, width = 6, height = 6, + fileout = 'map_robinson_rmsss_euro_lambert_point.png') + +## style = polygon +VizRobinson(rmsss_eu$rmsss[1, , ], lon = lons_eu, lat = lats_eu, + target_proj = "ESRI:102014", + style = 'polygon', legend = 'bar', + mask = !rmsss_eu$sign[1, , ], + brks = 21, cols = cols, bar_limits = c(-0.8, 0.8), + bar_extra_margin = c(0.6, 3, 0.6, 3), + point_size = 1.3, + crop_coastlines = c(lonmin = -20, lonmax = 40, latmin = 27, latmax = 70), + toptitle = "RMSSS SEAS5-ERA5 tas Nov 1997-2016", + caption = paste0("Projection: Lambert Europe\nESRI:102014\n", "Europe"), + vertical = F, width = 6, height = 6, + fileout = 'map_robinson_rmsss_euro_lambert_poly.png') +``` + + + + diff --git a/vignettes/map_proj_stereo.md b/vignettes/map_proj_stereo.md new file mode 100644 index 0000000000000000000000000000000000000000..b163b6007cc9bfc7341a2b5eab177cead9947f6b --- /dev/null +++ b/vignettes/map_proj_stereo.md @@ -0,0 +1,143 @@ +--- +title: "Map: Stereographic Projection" +author: "An-Chi Ho" +date: "2023-11-16" +output: html_document +vignette: > + %\VignetteEngine{knitr::rmarkdown} + %\VignetteIndexEntry{Map: Stereographic Projection} + %\usepackage[utf8]{inputenc} +--- + +We will use the data loaded in [Data Loading](data_loading.md) in this vignette. +Please follow that vignette first to get the data if you want to replicate the results in this vignette. Load global data with `region = "global"` in the loading script. + +# Map plotting + +In this vignette, we will use the following functions that plot stereographi projection +map: +`VizStereoMap()`, `VizAnimateMap()`, `VizRobinson()`, `VizLayout()`. + +## VizStereoMap() + +`VizStereoMap()` plots the map with stereographic projection. +The latitude range needs to be within 110 degrees, being speficied by parameter `latlims`. +The parameter `intlat` can set the interval in degrees between consecutive latitude circles on the plot. See more parameters in function documentation. + +We plot the climatology ensemble-mean SEAS5 near-surface temperature data by VizStereoMap(), one with North Pole as center and the other with South Pole as center. + +We can add boxes in the map by giving parameter `boxlim`. + +```r +exp1 <- ClimProjDiags::Subset(exp, c("dat", "var"), list(1, 1), drop = "selected") +exp1_clim <- s2dv::MeanDims(exp1, c("sdate", "ensemble"), na.rm = TRUE) + +lats <- attributes(exp)$Variables$system5c3s$lat +lons <- attributes(exp)$Variables$system5c3s$lon +lats_np_ind <- which(lats %in% 60:90) +lats_sp_ind <- which(lats %in% -90:-60) + +cols <- ClimColors(50) +col_inf <- cols[1] +col_sup <- tail(cols, 1) +cols <- cols[c(2:49)] +brks_range <- range(exp1_clim[c(lats_np_ind, lats_sp_ind)], na.rm = TRUE) +brks <- round(seq(ceiling(brks_range[1]), floor(brks_range[2]), + length.out = 49), 1) + +VizStereoMap(exp1_clim[1, lats_np_ind, ], latlims = c(60, 90), + lon = lons, lat = lats[lats_np_ind], + brks = brks, cols = cols, col_sup = col_sup, + toptitle = "SEAS5 tas climatology (Nov. 2011-2016), ftime = 1, North Pole", + title_scale = 0.45, + units = "K", filled.continents = FALSE, + fileout = 'map_stereo_clim_exp1_np.png') + +VizStereoMap(exp1_clim[1, lats_sp_ind, ], latlims = c(-90, -60), + lon = lons, lat = lats[lats_sp_ind], + brks = brks, cols = cols, + toptitle = "SEAS5 tas climatology (Nov. 011-2016), ftime = 1, South Pole", + title_scale = 0.45, boxlwd = 2, + boxlim = list(c(166, -85, 235, -77)), + units = "K", filled.continents = FALSE, + fileout = 'map_stereo_clim_exp1_sp.png') +``` + + + + + +## VizLayout() + +This function allows to easily combine plots from any R plot function in +layouts. The input data can be provided in multiple data arrays, and a common +colour bar can be set for the multi-panel. + +A common use case is to plot the ensemble members at a given time step: + +```r +VizLayout(VizStereoMap, c('lat', 'lon'), exp1_clim[, lats_np_ind, ], + lon = lons, lat = lats[lats_np_ind], + brks = brks, cols = cols, col_sup = col_sup, + bar_extra_margin = c(1, 0, 1, 0), + units = 'K', filled.continents = FALSE, title_scale = 0.7, + toptitle = "SEAS5 tas climatology (Nov. 2011-2016), North Pole", + titles = paste("ftime", 1:dim(exp1_clim)[1]), + fileout = "map_stereo_layout_clim_exp1_np.png") +``` + + + +## VizAnimateMap() + +`VizAnimateMap()` can generate animation with the plots generated by `VizStereoMap()`. The input array should have dimensions as follow: +```r + c(n. of experiments/observations, n. of observations, 3, n. of forecast times, n. of latitudes, n. of longitudes) +``` +The first 3 dimensions are optional; the 3rd dimension corresponding to the lower +confidence interval, the actual value and the upper confidence interval. +The confidence intervals, if provided, are drawn with +black dots on grid cells where reach 95% significance level, if requested via `msk95lev`. + +The data is assumed to be monthly frequency and to start in +January. Otherwise it can be adjusted with `monini` and `freq`. + +Whether to plot with a equidistant rectangular projection or a stereographic +projection can be chosen with the parameter `equi`. The plot can be limited to +a sub-region of the provided data via the parameters `lonmin`, `lonmax`, `latmin` and `latmax`. +Check function documentation for more explanations of function arguments. + +We plot the climatology ensemble-mean SEAS5 tas and animate through forecast time. + +```r +VizAnimateMap(exp1_clim, equi = FALSE, + lon = lons, lat = lats, + latmin = 60, latmax = 90, + filled.continents = FALSE, monini = 11, + toptitle = "SEAS5 tas climatology (Nov. 2011-2016), North Pole", + brks = brks, cols = cols, col_sup = col_sup, triangle_ends = c(F, T), + units = "K", sizetit = 0.5, + fileout = 'map_stereo_anim_clim_exp1_np.gif') + +``` + + + +## VizRobinson() + +VizRobinson() can plot various projection types, including stereographic projection. Use `target_proj = 3995` (Arctic Polar Stereographic -- EPSG:3995) to assign the projection type. Note that different PROJ and GDAL module versions may have different CRS codes. + +We use VizRobinson() to plot the same figure as the first one, climatology ensemble-mean SEAS5 tas at North Pole. + +```r +VizRobinson(exp1_clim[1, lats_np_ind, ], target_proj = 3995, + lon = lons, lat = lats[lats_np_ind], + brks = brks, cols = cols, col_sup = col_sup, + legend = 's2dv', style = 'polygon', + toptitle = "SEAS5 tas climatology (Nov. 2011-2016), ftime = 1, North Pole", + caption = paste0("plotted by esviz::VizRobinson"), + units = "K", title_size = 14, + width = 8, height = 8, + fileout = "map_stereo_clim_exp1_np_robin.png") +``` + diff --git a/vignettes/maps_different_projections.md b/vignettes/maps_different_projections.md deleted file mode 100644 index 432b2fda53e393aecfa3eb203590099c83f2be05..0000000000000000000000000000000000000000 --- a/vignettes/maps_different_projections.md +++ /dev/null @@ -1,237 +0,0 @@ ---- -author: "An-Chi Ho" -date: "2023-05-03" -output: html_document -vignette: > - %\VignetteEngine{R.rsp::md} - %\VignetteIndexEntry{Visualisation} - %\usepackage[utf8]{inputenc} ---- - -# Visualization of different projections - -This vignette shows how to use function `PlotRobinson()`, which can plot maps with the projection of your choice. Since packages `sf` and `rnaturalearth` are required by the function, make sure you have modules `PROJ`, `GEOS`, `GDAL` loaded. -The projection types and IDs can be found on https://epsg.io/. - -```r -## Load packages -library(sf) -library(ggplot2) -library(rnaturalearth) -library(RColorBrewer) -library(cowplot) -library(startR) - -#TODO: Change to load the package -## Source function -source("/esarchive/scratch/aho/tmp/PlotRobinson.R") -## Source unexported s2dv functions used in PlotRobinson -.KnownLonNames <- s2dv:::.KnownLonNames -.KnownLatNames <- s2dv:::.KnownLatNames -.IsColor <- s2dv:::.IsColor -.warning <- s2dv:::.warning - -``` -Specify where you want to save the figures later. -```r -fileout_path <- "/esarchive/scratch/" -``` - -## Global map - -### 1. Load data - -We use `startR::Start` to load system5c3s monthly temperature data from esarchive. To focus on visualization, we simply load one file with one ensemble and one time step. - -```r -repos <- "/esarchive/exp/ecmwf/system5c3s/monthly_mean/$var$_f6h/$var$_$sdate$.nc" -data <- Start(dat = list(list(name = 'system5c3s', path = repos)), - var = 'tas', - sdate = '20170101', - ensemble = indices(1), - time = indices(1), - lon = 'all', - lon_reorder = CircularSort(-180, 180), - lat = 'all', - lat_reorder = Sort(decreasing = T), - synonims = list(lat = c('lat', 'latitude'), - lon = c('lon', 'longitude')), - return_vars = list(time = 'sdate', longitude = 'dat', latitude = 'dat'), - retrieve = T) -lon <- attributes(data)$Variable$system5c3s$lon -lat <- attributes(data)$Variable$system5c3s$lat -data <- data - 273.15 # K to degC -``` - -### 2. Create mask - -We can create a logical or [0, 1] array to serve as mask in the plot. -```r -mask <- drop(data) -mask[which(mask > -20 & mask < -10)] <- 0 -mask[which(mask != 0)] <- 1 -``` - -### 3. Create colorbar breaks and colors - -Create the adequete colorbar elements for the plot -```r -## have exceeded values -brks1 <- seq(-40, 40, 10) -cols1 <- brewer.pal(9, 'PuOr')[-9] -## cover all values -#brks1 <- seq(-ceiling(max(abs(range(data)))), ceiling(max(abs(range(data)))), length.out = 11) -``` -### 4. Plot - -You can find more projection types through the URL above. `PlotRobinson()` is mainly designed for Robinson projection, but it is possible to use other projections as well. -E.g., Mollweide projection is "ESRI:54009" or "ESRI:53009". -Note that different PROJ and GDAL module versions have different CRS codes. If on Nord3v2, please use "ESRI:53030" or "+proj=robin" to get the correct Robinson projection. - -There are two types of legend, 'ggplot2' or 's2dv'. You can also set `legend` as `NULL` to not plot legend. - -```r -## legend = 'ggplot2' -PlotRobinson(data, lon, lat, brks = brks1, cols = NULL, legend = 'ggplot2', - target_proj = 54030, style = 'point', - toptitle = "system5c3s monthly tas Jan 2017", caption = "Projection: Robinson", - dots = mask, units = 'degC', colNA = 'red', - width = 10, height = 6) - -## legend = 's2dv' -PlotRobinson(data, lon, lat, brks = brks1, cols = cols1, legend = 's2dv', - target_proj = 54030, style = 'point', - toptitle = "system5c3s monthly tas Jan 2017", caption = "Projection: Robinson", - dots = mask, units = "degC", col_inf = 'brown', - width = 10, height = 5, - bar_extra_margin = c(0, 5, 0, 5), - vertical = F) -``` - - - - - - -## European region - -### 1. Subset data - -Crop the european area from the global data we loaded above. - -```r -data_eu <- ClimProjDiags::Subset(data, c('lat', 'lon'), list(21:61, 161:221)) -lon_eu <- lon[161:221] -lat_eu <- lat[21:61] -``` -### 2. Crop mask - -```r -mask_eu <- ClimProjDiags::Subset(mask, c('lat', 'lon'), list(21:61, 161:221)) -``` - -### 3. Create colorbar breaks - -```r -## have exceeded values -brks_eu <- seq(-18, 18, length.out = 11) -## cover all values -#brks_eu <- seq(-ceiling(max(abs(range(data_eu)))), ceiling(max(abs(range(data_eu)))), length.out = 11) -``` - -### 4. Plot -In the previous plots, we use `dots` to mark the masked area. This time, we use parameter `mask` to remove the unwanted data. The removed points are left as blank. - -The parameter `crop_coastlines` helps to adjust the map coastline plotting. You can test and find the best range. Note that this parameter is not suitable for the case that longitude range exceeds half of the earth (i.e., 180 degrees.) - -We can also choose to plot the map by polygon instead of point. Note that polygon is relatively **slow** so it takes a long time for global map, and it **does not work on our workstation** for some technical reason. - -Note that `target_proj = 102014` does not work well on Nord3v2. Use PROJ.4 string `target_proj = "+proj=lcc +lat_0=30 +lon_0=10 +lat_1=43 +lat_2=62 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs +type=crs"` instead. - -```r -## style = point -PlotRobinson(data_eu, lon_eu, lat_eu, brks = brks_eu, cols = NULL, legend = 's2dv', - target_proj = 102014, style = 'point', - toptitle = "system5c3s monthly tas Jan 2017", - caption = paste0("Projection: Lambert Europe\nESRI:102014\n", "Europe"), - mask = mask_eu, units = "degC", - width = 8, height = 6, point_size = 1.3, - crop_coastlines = c(lonmin = -20, lonmax = 40, latmin = 27, latmax = 70), - triangle_ends = c(T, T), bar_extra_margin = c(0.4, 4, 0.4, 4), - vertical = F) - -## style = polygon -PlotRobinson(data_eu, lon_eu, lat_eu, brks = brks_eu, cols = NULL, legend = 's2dv', - target_proj = 102014, style = 'polygon', - toptitle = "system5c3s monthly tas Jan 2017", - caption = paste0("Projection: Lambert Europe\nESRI:102014\n", "Europe"), - mask = mask_eu, units = "degC", - width = 8, height = 6, - crop_coastlines = c(lonmin = -20, lonmax = 40, latmin = 27, latmax = 70), - triangle_ends = c(T, T), bar_extra_margin = c(0.4, 4, 0.4, 4), - vertical = F) -``` - - - - - - -## North Pole region - -### 1. Subset data - -Crop the north pole area from the global data we loaded above. -```r -data_np <- ClimProjDiags::Subset(data, c('lat'), list(1:31)) -lon_np <- lon -lat_np <- lat[1:31] -``` -### 2. Crop mask - -```r -mask_np <- ClimProjDiags::Subset(mask, c('lat'), list(1:31)) -``` - -### 3. Create colorbar breaks - -```r -## have exceeded values -brks_np <- seq(-40, 0, length.out = 11) -## cover all values -#brks_np <- seq(-ceiling(max(abs(range(data_np)))), ceiling(max(abs(range(data_np)))), length.out = 11) -``` - -### 4. Plot - -#TODO: Update PlotStereoMap to the new function -We compare `PlotRobinson()` with `PlotStereoMap()`, which is specifically for the stereographic projection and it uses polygon to plot. -Note that we cannot use `crop_coastlines` here in `PlotRobinson()` because the longitude range is global. -It is recommended saving the figures for these two plots (especially `PlotStereoMap()`) because polygon plotting is time-consuming when it is in the pop-up window. - -The projection used here is Arctic Polar Stereographic (EPSG:3995). -```r -#NOTE: A bit slow, be patience. -PlotRobinson(data_np, lon_np, lat_np, brks = brks_np, cols = NULL, legend = 's2dv', - target_proj = 3995, style = 'polygon', - toptitle = "system5c3s monthly tas Jan 2017", - caption = paste0("Projection: WGS 84 / Arctic Polar Stereographic\nEPSG:3995\n", "North Pole"), - dots = mask_np, dots_size = 1.5, - units = "degC", color_fun = clim.palette("orangepurple"), - width = 8, height = 8, - triangle_ends = c(T, T), bar_extra_margin = c(0.4, 4, 0.4, 4), - vertical = F, fileout = paste0(fileout_path, '/PlotRobinson_np.png')) - -# Compare with PlotStereoMap -#NOTE: Save the figure instead of plotting in pop-up window because it is slow. -PlotStereoMap(data_np, lon = lon_np, lat = lat_np, brks = brks_np, cols = NULL, - color_fun = clim.palette("orangepurple"), - toptitle = "system5c3s monthly tas Jan 2017 (PlotStereoMap)", - width = 8, height = 8, filled.continent = F, - dots = !mask_np, units = "degC", title_scale = 0.8, - fileout = paste0(fileout_path, '/PlotStereoMap_np.png')) -``` - - - - diff --git a/vignettes/maps_equidistant_projection.md b/vignettes/maps_equidistant_projection.md deleted file mode 100644 index 0424d5a4875d7f95f4b4e7d530d43a1a9bf3d30e..0000000000000000000000000000000000000000 --- a/vignettes/maps_equidistant_projection.md +++ /dev/null @@ -1,318 +0,0 @@ ---- -author: "An-Chi Ho" -date: "`r Sys.Date()`" -output: html_document -vignette: > - %\VignetteEngine{R.rsp::md} - %\VignetteIndexEntry{Visualisation} - %\usepackage[utf8]{inputenc} ---- - -We will use the data loaded in [data_loading.md](#data-loading) in this vignette. -Please follow that vignette first to get the data if you want to replicate the results in this vignette. - -# Map plotting - -In this vignette, we will go through the functions that plot the map type of figures: -`VizEquiMap()`, `VizRobinson()`, `VizStereoMap()`, `VizAnimateMap()`, `VizLayout()`, `VizSection()`. - -This group of functions allows to plot grid data (i.e. defined over latitudes -and longitudes) on a rectangular equidistant or stereographic projection, -as well as depth section (i.e. the cross section of latitudes/longitudes and heights). - -`VizEquiMap()` and `VizStereoMap()` share some traits: - - Both expect a data matrix in the parameter `var` of dimensions -`c(n. of latitudes, n. of longitudes)`, `lat` with a vector with the latitudes -of the centers of the grid cells and `lon`, a vector with the longitudes. - - The N colors to paint the grid cells with (via `cols`) as well as the N + -1 threshold magnitudes (via `brks`) that will allow to assign each grid cell -value one of the N colours. The colour for any missing values can be adjusted -with `colNA`. - - Whether to fill the map continents or only draw coast wires can be adjusted -with `filled.continents`. - - A matrix of `dots` can be plotted over the drawn map to, e.g., highlight -cells where a skill has been greatest or most significant. - - A legend can be drawn (unless disabled with `drawleg`) and the amount of -ticks on that legend can be adjusted with `subsampleg`. - - They accept any additional parameters via the parameter `...` to be sent to -the underlying R graphics `image()` function for a fine tuning. - -### VizEquiMap() - -VizEquiMap() plots the map with rectangular equidistant projection. -It has various parameters to adjust the visualization. - -#### Basic usage - -Plot the raw experimental and observational data. -```r -# Plot the first experiment, ensemble mean, first start year, first forecast time -exp1 <- ClimProjDiags::Subset(exp, c("dat", "var"), list(1, 1), drop = 'selected') -exp1 <- s2dv::MeanDims(exp1, "ensemble") -lats <- attr(exp, 'Variables')$system5c3s$lat -lons <- attr(exp, 'Variables')$system5c3s$lon - -VizEquiMap(exp1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, - toptitle = "SEAS5 near-surface temperature, Nov. 1997", - units = "K", bar_limits = c(250, 300), brks = 21, - width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), - fileout = 'maps_equimap_raw_exp1.png') - -# Plot corresponding observational data -obs1 <- ClimProjDiags::Subset(obs, c("dat", "var"), list(1, 1), drop = 'selected') -VizEquiMap(obs1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, - toptitle = "ERA5 near-surface temperature, Nov. 1997", - units = "K", bar_limits = c(250, 300), brks = 21, - width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), - fileout = 'maps_equimap_raw_obs.png') -``` - - - -#### dots - -Plot correlation with the significance by parameter `dots`. -Use s2dv function `Corr()` to calculate the correlation. The dotted points are the insignificant ones. - -```r -corr <- s2dv::Corr(exp1, obs1, time_dim = 'sdate', dat_dim = NULL, sign = TRUE, - conf = FALSE, pval = FALSE) -VizEquiMap(corr$corr[1, , ], lon = lons, lat = lats, filled.continents = FALSE, - dots = !drop(corr$sign)[1, , ], dot_symbol = 3, dot_size = 1.2, - toptitle = "Correlation of near-surface temperature, SEAS5 - ERA5, Nov. 1997", - title_scale = 0.7, color_fun = ClimPalette("yellowred"), - bar_limits = c(0, 1), brks = 21, - width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), - fileout = 'maps_equimap_corr_exp1_obs.png') -``` - - - -#### contours - -To draw the contour lines, set parameter `square` as FALSE to smooth the grid borders. -The contours can be adjusted by providing a matrix to parameter `contours` with dimensions -`c(n. of longitudes, n. of latitudes)`. The contours matrix will be drawn over the map, -using the thresholds provided in `brks2`. - -You can also plot the contours of the original data without border -smoothing, to plot only some of the default contours, or to plot contours -defined by another field. - -Here, we plot the same raw data as the previous section but with contours. -```r -VizEquiMap(exp1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, - square = FALSE, - toptitle = "SEAS5 near-surface temperature, Nov. 1997", - units = "K", bar_limits = c(250, 300), brks = 21, - width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), - fileout = 'maps_equimap_contour_raw_exp1.png') - -# Adjust the styles -VizEquiMap(exp1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, - square = TRUE, - contours = exp1[1, 1, , ], contour_lwd = 1, brks2 = seq(240, 300, 5), - contour_color = 'blue', contour_lty = 5, contour_label_scale = 0.7, - toptitle = "SEAS5 near-surface temperature, Nov. 1997", - units = "K", bar_limits = c(250, 300), brks = 21, - width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), - fileout = 'maps_equimap_contour_raw_exp1_ver2.png') -``` - - - - -#### Boxes - -We can draw boxes on the map using parameters `boxlim`, `boxcol` and `boxlwd`. -They specify the position of the corners, color and thickness of a box to be drawn -on the map. - -We use the same raw data from the previous section and add two boxes, -one over Alpine region (green) and one over south side of Mediterranean Sea (yellow). -```r -VizEquiMap(exp1[1, 1, , ], lon = lons, lat = lats, filled.continents = FALSE, - toptitle = "SEAS5 near-surface temperature, Nov. 1997", - units = "K", bar_limits = c(250, 300), brks = 21, - width = 8, height = 8, bar_extra_margin = c(1, 0, 1, 0), - boxlim = list(c(6, 45, 15, 48), c(10, 30, 20, 36)), - boxcol = c('green', 'yellow'), boxlwd = c(2, 2), - fileout = 'maps_equimap_raw_exp1_boxes.png') -``` - - - - -### VizStereoMap() - -`VizStereoMap()` plots the map with stereographic projection. -It can be called almost identically to `VizEquiMap()`, except -that it requires the `latlims` parameter to specify which range of latitudes to -be plotted on the stereographic projection map. -The parameter `intlat` can set the interval in degrees between consecutive latitude circles on the plot. - -Next a couple of examples: - -```r -## Loading data over the entire globe -world_data <- Load('tas', list(expA, expB), list(obsX), - sdates = sdates[1], - leadtimemin = 2, leadtimemax = 13, - latmin = -90, latmax = 90, - lonmin = 0, lonmax = 360, - output = 'lonlat', grid = 't106grid', - method = 'distance-weighted') -VizStereoMap(s2dv::MeanDims(world_data$mod, 2)[1, 1, 1, , ], - world_data$lon, world_data$lat, c(40, 90), - brks = 100, bar_limits = c(240, 290), - toptitle = "Exp. A 'tas', s. date: 1990-11-01, f. time: 1 month", - title_scale = 0.5, - units = "K", filled.continents = 'black', - fileout = 'vis_stereomap_raw_expA.png') - -VizStereoMap(s2dv::MeanDims(world_data$obs, 2)[1, 1, 10, , ], - world_data$lon, world_data$lat, c(-90, -60), intlat = 10, - brks = 100, bar_limits = c(240, 290), - boxlim = list(c(0, -85, 135, -70)), - toptitle = "Obs. X 'tas', 1990-12-01", - title_scale = 0.5, - units = "K", fileout = 'vis_stereomap_raw_obsX.png') -``` - - - - -### VizAnimateMap() - -`VizAnimateMap()` generates animations of maps from `VizEquiMap()` or -`VizStereoMap()` and saves them in GIF files at the paths specified in the -parameter `fileout`. It receives an array with the dimensions: -```r - c(n. of experiments/observations, n. of observations, 3, n. of forecast times, n. of latitudes, n. of longitudes) -``` -the first 3 being optional and the 3rd dimension corresponding to the lower -confidence interval, the actual value and the upper confidence interval. This -means it can plot maps of a field of one or multiple experimental or -observational datasets, averaged across ensemble members and starting dates -(climatologies) or indices or scores computed across starting dates against -one or more observations. The confidence intervals, if provided, are used to -draw black dots on grid cells that reach a 95% significance level, if -requested via `msk95lev`. - -The provided data is assumed to be in a monthly frequency and to start at -January. Otherwise it can be adjusted with `monini` and `freq`. - -Whether to plot with a equidistant rectangular projection or a stereographic -projection can be chosen with the parameter `equi`. The plot can be limited to -a sub-region of the provided data via the parameters `lonmin`, `lonmax`, -`latmin` and `latmax`. - -`AnimateMap()` allows for the typical adjustments in the map plotting -functions: specifying the palette colors and breaks (`col` and `brk`), -displaying or not a legend (`drawleg`, `subsampleg`), selecting a color for -the NA values (`colNA`) and filling or not the continents -(`filled.continents`). - -Further title and axis tick adjustments can be achieved with `toptitle`, -`sizetit`, `units`, `intlon` and `intlat`. -brk col drawleg subsampleg colNA filled.continents - -Next a few examples: - -```r -map_clim <- s2dv::Clim(map_data$mod, map_data$obs, memb = FALSE) - -cols <- ClimColors(50) - -data_min <- min(map_data$mod, map_data$obs, na.rm = TRUE) -data_max <- max(map_data$mod, map_data$obs, na.rm = TRUE) -brks <- round(seq(data_min, data_max, length.out = length(cols) + 1), 2) - -AnimateMap(ClimProjDiags::Subset(map_clim$exp, 'dataset', 1), - map_data$lon, map_data$lat, monini = 12, - toptitle = "Exp. A climatologies.", - 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: - -```r -world_clim <- s2dv::Clim(world_data$mod, world_data$obs, memb = FALSE) -AnimateMap(ClimProjDiags::Subset(world_clim$exp, 'dataset', 1), - world_data$lon, world_data$lat, - filled.continents = FALSE, monini = 12, - toptitle = "Exp. A climatologies.", units = "K", - brks = brks, cols = cols, - fileout = 'vis_anim_clim_expA_world.gif') -AnimateMap(world_clim$obs, - world_data$lon, world_data$lat, equi = FALSE, - latmin = 60, latmax = 90, monini = 12, - toptitle = "Obs. X climatologies.", - units = "K", brks = brks, cols = cols, - fileout = "vis_anim_clim_obsX_world.gif") -``` - - - - - -### VizLayout() - -This function allows to easily combine plots from any R plot function in -layouts. The input data can be provided in multiple data arrays, and a common -colour bar can be set for the multi-panel. - -A common use case is to plot the ensemble members at a given time step: - -```r -VizLayout(VizEquiMap, c('lat', 'lon'), - ClimProjDiags::Subset(map_data$mod, - list('dataset', 'sdate', 'ftime'), - list(1, 1, 1)), - map_data$lon, map_data$lat, units = 'K', - toptitle = "Exp. A 'tas', s. date: 1990-11-01, f.time: 1 month", - titles = paste("Member", 1:dim(map_data$mod)[2]), - brks = 50, bar_limits = c(250, 300), coast_color = 'black', - fileout = "vis_layout_equimap_expA.png") -``` - - - -But really complex layouts can be achieved thanks to the great number of -available parameters: - -```r -ens_mean <- ClimProjDiags::Subset(world_data$mod, - list('dataset', 'sdate', 'ftime'), - list(1, 1, 1)) -layout <- VizLayout(fun = c('VizEquiMap', 'plot', 'plot', 'VizStereoMap'), - plot_dims = c('lat', 'lon'), - var = list(ens_mean, array(1:10), - array(10:1), ens_mean), - lon = world_data$lon, lat = world_data$lat, - fill = 'black', sizetit = 0.5, axes_label_scale = 0.6, - coast_color = 'yellow', - titles = paste('Fig.', 1:12), toptitle = 'Multipanel', - row_titles = paste('Row', 1:3), col_titles = paste('Col', 1:4), - drawleg = 'E', units = 'K', units_scale = 2, - bar_limits = c(275, 300), brks = 26, - bar_extra_labels = 281:284, - width = 12, height = 10, res = 200, - fileout = 'vis_layout_complex.png') -``` - - - -### VizSection() - -WIP. diff --git a/vignettes/time_series.md b/vignettes/time_series.md index c42847326311559a2ee6ecbd9dfb3df15822f1f0..1e62b8e4c2aeb82766082ea9388a95f8744c7120 100644 --- a/vignettes/time_series.md +++ b/vignettes/time_series.md @@ -1,10 +1,11 @@ --- +title: "Time Series Plotting" author: "An-Chi Ho" date: "2023-11-03" output: html_document vignette: > - %\VignetteEngine{R.rsp::md} - %\VignetteIndexEntry{Visualisation} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteIndexEntry{Time Series Plotting} %\usepackage[utf8]{inputenc} --- @@ -13,8 +14,8 @@ vignette: > In this vignette, we will go through the functions that plot the time series type of figures: `VizAno()`, `VizClim()`, `VizVsLtime()`, `Viz2VarsVsLTime()`, `VizBoxWhisker()`, `VizACC()`. -We will use the data loaded in [data_loading.md](#data-loading). -Please follow that vignette first to get the data if you want to replicate the results in this vignette. +We will use the data loaded in [Data Loading](data_loading.md). +Please follow that vignette first to get the data if you want to replicate the results in this vignette. Load European region data with `region = "euro"` in the loading script. All the functions devoted to plotting time series have some common traits and parameters: @@ -65,10 +66,10 @@ sdates <- paste0(1997:2016, '1101') VizAno(exp_sm, obs_sm, sdates, toptitle = paste0(c('SEAS5', 'Meteo-France System 7'), ": Raw 'tas' over Europe"), ytitle = c("K", "K"), legends = "ERA5", - fileout = paste0("vis_raw_exp", 1:2, "_obs.png")) + fileout = paste0("ts_raw_exp", 1:2, "_obs.png")) ``` - - + + ## Climatologies @@ -96,9 +97,9 @@ VizClim(clim_sm$clim_exp, clim_sm$clim_obs, monini = 11, toptitle = "Per-pair 'tas' climatologies, Europe", ytitle = "K", listexp = c('SEAS5', 'Meteo-France System 7'), listobs = c('ERA5'), - fileout = "vis_clim_exp1_exp2_obs.png") + fileout = "ts_clim_exp1_exp2_obs.png") ``` - + ## Statistics and scores @@ -180,9 +181,9 @@ VizVsLTime(input_trend, ytitle = "K/year", limits = c(-0.05, 0.1), monini = 11, freq = 1, listexp = c('SEAS5', 'Meteo-France System 7'), - fileout = 'vis_trend_exp1_exp2.png') + fileout = 'ts_trend_exp1_exp2.png') ``` - + We use the ensemble-mean anomaly as well to calculate regression between two experiments by `s2dv::Regression`. Regression() has the same output elements @@ -204,9 +205,9 @@ VizVsLTime(input_reg, toptitle = "Regression of System5c3s and Meteo-France System 7, Europe", ytitle = "K/year", sizetit = 0.7, monini = 11, freq = 1, leg = FALSE, - fileout = 'vis_regression_exp1_exp2.png') + fileout = 'ts_regression_exp1_exp2.png') ``` - + #### 2. Spread @@ -229,15 +230,15 @@ for (i_plot in seq_len(length(spread))) { ytitle = "K", sizetit = 0.7, monini = 11, freq = 1, listexp = c('SEAS5', 'Meteo-France System 7'), - fileout = paste0('vis_', names(spr_stats)[i_plot], '_exp1_exp2.png')) + fileout = paste0('ts_', names(spr_stats)[i_plot], '_exp1_exp2.png')) do.call(VizVsLTime, inputs) } ``` - - - - + + + + #### 3. Correlation, RMSE, and RMSSS @@ -263,9 +264,9 @@ VizVsLTime(input_cor, ytitle = "K", sizetit = 0.7, monini = 11, freq = 1, listexp = c('SEAS5', 'Meteo-France System 7'), - fileout = 'vis_corr_exp1_exp2_obs.png') + fileout = 'ts_corr_exp1_exp2_obs.png') ``` - + ```r rms_ano <- s2dv::RMS(s2dv::MeanDims(ano$exp, 'ensemble'), @@ -282,9 +283,9 @@ VizVsLTime(input_rms, ytitle = "K", sizetit = 0.7, monini = 11, freq = 1, listexp = c('SEAS5', 'Meteo-France System 7'), - fileout = 'vis_rms_exp1_exp2_obs.png') + fileout = 'ts_rms_exp1_exp2_obs.png') ``` - + ```r @@ -300,9 +301,9 @@ VizVsLTime(input_rmsss, ytitle = "K", sizetit = 0.7, monini = 11, freq = 1, siglev = TRUE, listexp = c('SEAS5', 'Meteo-France System 7'), - fileout = 'vis_rmsss_exp1_exp2_obs.png') + fileout = 'ts_rmsss_exp1_exp2_obs.png') ``` - + #### 4. The ratio of RMSE between two experiments @@ -323,9 +324,9 @@ VizVsLTime(input_ratio_rms, toptitle = "RMSE Ratio of SEAS5 and Meteo-France System 7 against ERA5, Europe", ytitle = "K", sizetit = 0.6, monini = 11, freq = 1, siglev = TRUE, leg = FALSE, - fileout = 'vis_ratiorms_exp1_exp2_obs.png') + fileout = 'ts_ratiorms_exp1_exp2_obs.png') ``` - + #### 5. The ratio between standard deviation and RMSE @@ -346,9 +347,9 @@ VizVsLTime(input_ratio_sdrms, ytitle = "K", sizetit = 0.7, monini = 11, freq = 1, siglev = TRUE, listexp = c('SEAS5', 'Meteo-France System 7'), - fileout = 'vis_ratiosdrms_exp1_exp2_obs.png') + fileout = 'ts_ratiosdrms_exp1_exp2_obs.png') ``` - + We can also calculate the ration of SD and RMS for one experiment only but against two observational data. Since only one observational data is loaded, we create another @@ -375,9 +376,9 @@ VizVsLTime(input_ratio_sdrms, monini = 11, freq = 1, siglev = TRUE, listexp = c('SEAS5'), listobs = c('ERA5', 'ERA5 with random turbulance'), - fileout = 'vis_ratiosdrms_exp1_obs1_obs2.png') + fileout = 'ts_ratiosdrms_exp1_obs1_obs2.png') ``` - + #### 6. Effective number of independent data @@ -395,9 +396,9 @@ VizVsLTime(input_eno, sizetit = 0.7, monini = 11, freq = 1, siglev = FALSE, show_conf = FALSE, listexp = c('SEAS5', 'Meteo-France System 7'), - fileout = 'vis_eno_exp1_exp2.png') + fileout = 'ts_eno_exp1_exp2.png') ``` - + ### Viz2VarsVsLTime @@ -421,9 +422,9 @@ Viz2VarsVsLTime(input_cor[, 1:3, ], input_rms, monini = 11, freq = 1, limits = c(-0.8, 2.2), listexp = c('SEAS5', 'Meteo-France System 7'), listvars = c('Corr', 'RMSE'), - fileout = 'vis_corr_rms_exp1_exp2_obs.png') + fileout = 'ts_corr_rms_exp1_exp2_obs.png') ``` - + ### VizACC @@ -471,9 +472,9 @@ VizACC(input_acc, sdates, toptitle = "Spatial anomaly corr. coeff. with ERA5 over Europe", ytitle = "K", sizetit = 0.7, freq = 1, limits = c(-0.8, 1.6), legends = c('SEAS5', 'Meteo-France System 7'), - fileout = 'vis_acc_exp1_exp2_obs.png') + fileout = 'ts_acc_exp1_exp2_obs.png') ``` - + ### VizBoxWhisker