View source: R/VizAnimateMap.R
| VizAnimateMap | R Documentation |
Create animations of maps in an equi-rectangular or stereographic projection, showing the anomalies, the climatologies, the mean InterQuartile Range, Maximum-Mininum, Standard Deviation, Median Absolute Deviation, the trends, the RMSE, the correlation or the RMSSS, between modelled and observed data along the forecast time (lead-time) for all input experiments and input observational datasets.
VizAnimateMap(
data,
lon,
lat,
toptitle = rep("", 11),
title_scale = 1,
sizetit = NULL,
units = "",
monini = 1,
freq = 12,
msk95lev = FALSE,
brks = NULL,
cols = NULL,
filled.continents = FALSE,
lonmin = 0,
lonmax = 360,
latmin = -90,
latmax = 90,
intlon = 20,
intlat = 30,
drawleg = TRUE,
subsampleg = 1,
colNA = "white",
equi = TRUE,
fileout = c("output1_animvsltime.gif", "output2_animvsltime.gif",
"output3_animvsltime.gif"),
var = NULL,
...
)
data |
Matrix of dimensions (nltime, nlat, nlon) or (nexp/nmod, nltime, nlat, nlon) or (nexp/nmod, 3/4, nltime, nlat, nlon) or (nexp/nmod, nobs, 3/4, nltime, nlat, nlon). |
lon |
Vector containing longtitudes (degrees). |
lat |
Vector containing latitudes (degrees). |
toptitle |
c(”,”, ...) array of main title for each animation, optional. If RMS, RMSSS, correlations: first exp with successive obs, then second exp with successive obs, etc ... |
title_scale |
Scale factor for the figure top title. Defaults to 1. |
sizetit |
Deprecated. Use 'title_scale' instead. |
units |
Units, optional. |
monini |
Starting month between 1 and 12. Default = 1. |
freq |
1 = yearly, 12 = monthly, 4 = seasonal ... |
msk95lev |
TRUE/FALSE grid points with dots if 95% significance level reached. Default = FALSE. |
brks |
Limits of colour levels, optional. For example: seq(min(data), max(data), (max(data) - min(data)) / 10). |
cols |
Vector of colours of length(brks) - 1, optional. |
filled.continents |
Continents filled in grey (TRUE) or represented by a black line (FALSE). Default = TRUE. Filling unavailable if crossing Greenwich and equi = TRUE. Filling unavailable if square = FALSE and equi = TRUE. |
lonmin |
Westward limit of the domain to plot (> 0 or < 0). Default : 0 degrees. |
lonmax |
Eastward limit of the domain to plot (> 0 or < 0). lonmax > lonmin. Default : 360 degrees. |
latmin |
Southward limit of the domain to plot. Default : -90 degrees. |
latmax |
Northward limit of the domain to plot. Default : 90 degrees. |
intlon |
Interval between longitude ticks on x-axis. Default = 20 degrees. |
intlat |
Interval between latitude ticks on y-axis for equi = TRUE or between latitude circles for equi = FALSE. Default = 30 degrees. |
drawleg |
Draw a colorbar. Can be FALSE only if square = FALSE or equi = FALSE. Default = TRUE. |
subsampleg |
Supsampling factor of the interval between ticks on colorbar. Default = 1 = every colour level. |
colNA |
Color used to represent NA. Default = 'white'. |
equi |
TRUE/FALSE == cylindrical equidistant/stereographic projection. Default: TRUE. |
fileout |
c(”, ”, ...) array of output file name for each animation. If RMS, RMSSS, correlations : first exp with successive obs, then second exp with successive obs, etc ... |
var |
Deprecated. Use 'data' instead. |
... |
Arguments to be passed to the method. Only accepts the following
graphical parameters: |
Examples of input:
Outputs from clim (exp, obs, memb = FALSE): (nmod, nltime, nlat, nlon) or (nobs, nltime, nlat, nlon)
Model output from load/ano/smoothing: (nmod, nmemb, sdate, nltime, nlat, nlon) then passed through spread(data, posdim = 2, narm = TRUE) & mean1dim(data, posdim = 3, narm = TRUE) or through trend(mean1dim(data, 2), posTR = 2): (nmod, 3, nltime, nlat, nlon) animates average along start dates of IQR/MaxMin/SD/MAD across members or trends of the ensemble-mean computed accross the start dates.
model and observed output from load/ano/smoothing: (nmod, nmemb, sdate, nltime, nlat, nlon) & (nobs, nmemb, sdate, nltime, nlat, nlon) then averaged along members mean1dim(var_exp/var_obs, posdim = 2): (nmod, sdate, nltime, nlat, nlon) (nobs, sdate, nltime, nlat, nlon) then passed through corr(exp, obs, posloop = 1, poscor = 2) or RMS(exp, obs, posloop = 1, posRMS = 2): (nmod, nobs, 3, nltime, nlat, nlon) animates correlations or RMS between each exp & each obs against leadtime.
A figure in popup window by default, or saved to the specified path
via fileout.
clim <- s2dv::Clim(map_temp$exp, map_temp$obs, memb = FALSE,
dat_dim = c('dat', 'member'), memb_dim = 'member')
lats <- attr(map_temp$exp, "Variables")$common$lat
lons <- attr(map_temp$exp, "Variables")$common$lon
VizAnimateMap(clim$clim_exp[1, 1, , , ], lon = lons, lat = lats,
toptitle = "climatology of decadal prediction", title_scale = 1,
units = "K", brks = seq(270, 300, 3), monini = 11, freq = 12,
msk95lev = FALSE, filled.continents = FALSE, intlon = 10, intlat = 10,
drawleg = FALSE, fileout = "VizAnimateMap.gif")
unlink("VizAnimateMap.gif")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.