autoplot_verification_map: Wrapper function to calculate and visualize verification of...

Description Usage Arguments Output Details See Also Examples

View source: R/autoplot_verification_map.R

Description

This function combines the functions calc_index,verify_index to generate skill maps for hindcast (re-forecasts). It can be used for either gridded or station data or a combination of both.
To see some example outputs of this function, look at the vignette "autoplot-functions" accesible through the package help main page or by typing
vignette("autoplot-functions",package="ClimIndVis") into the console.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
autoplot_verification_map(
  obs_grid,
  hc_grid,
  hc_ref_grid = NULL,
  obs_p,
  hc_p,
  hc_ref_p = NULL,
  index,
  index_args = list(),
  selyears = NULL,
  veri_metrics,
  veri_args = list(),
  col = "default",
  ncat = 3,
  output = NULL,
  plotdir,
  plot_title = TRUE,
  plotname = "",
  sep_folder = TRUE,
  title = "",
  plot_args = list()
)

Arguments

obs_grid

Gridded observation data. Climindvis-object with type = "grid" generated by make_object. For autoplot_forecast_map and autoplot_forecast_point only needed if skill criterion is applied.

hc_grid

Gridded hindcasts. Climindvis-object with type = "hc_grid" generated by make_object.

hc_ref_grid

Optional. Reference gridded hindcasts for calculation of skill scores. If not provided (NULL), climatology is taken as reference. Default = NULL.

obs_p

Station observations. Climindvis-object with type = "p" generated by make_object. For autoplot_forecast_map and autoplot_forecast_point only needed if skill criterion is applied.

hc_p

Hindcasts at stations. Climindvis-object with type = "hc_p" generated by make_object.

hc_ref_p

Optional. Reference hindcasts at stations for calculation of skill scores. If not provided (NULL), climatology is taken as reference. Default = NULL.

index

Name of index to be calculated., e.g. index = "dd" or index = "tnn". For list of indices see indices_list

index_args

List of arguments for index. See indices_list.

selyears

Integer array of years to be selected from data. For indices with quantiles, years as defined in index_args are used for quantile calculation, but only selected years are plotted. For functions using seasonal forecast data, selyears is only applied to hindcasts.

veri_metrics

Character array of skill metrics to calculate. For metrics see verify_index.

veri_args

Optional list of additional arguments for verification, see veri_args

col

Plot colors for colorscale of index. If not provided, package default colors for skill metric are used.

ncat

Number of forecast categories. Default = 3.

output

Format of image to be plotted ("png", "jpeg", "tiff", "pdf","dev.new"). Default = NULL, output to null device (getOption("device") will show you the null device. If you are not using RStudio, NULL and dev.new will give the same output).

plotdir

Character string of path of directory for saving plots. Ignored if output is NULL or "dev.new".

plot_title

Logical. Add plot title to graphic. Default = TRUE.

plotname

Optional. Character string. First part of plot name followed by character string containing index name/aggregation/time period/... depending on the autoplot function. Default = "".

sep_folder

Logical. Should output for different verification metrics be saved in different folders (TRUE) or all in one folder(FALSE). Default=TRUE

title

Optional. Character string. If provided added above the plot in addition to default information from the respective function (e.g. index name/aggregation/time period/...). Default = "", no additional title is written.

plot_args

Optional. List of arguments passed to plotting function, see plot_args_map.

Output

This function returns one plot per verification metric (and category in the case of the ROCSS and year in the case of e.g. the RPS) and all temporal aggregations which are covered by the hindcasts e.g. if aggt="seasonal" and the forecast is issued in Jan for 7 months it would return one graphic for "MAM"). The function creates folders for each verification metric in the output directory if sep_folder=TRUE. Gridpoints/stations where the index values are NA or where there is no variability on the climatology and the boundaries of the forecast categories are equal are colored in grey. This color can be changed by changing the argument NA_col in the argument plot_args.

If output is not NULL or "dev.new" the graphics are directly saved in the user specified directory (plotdir) with the following filename structure:

plotname // verification metric // (category name for category fc) // (year for RPS/CRPS) // index name // aggregation // forecast_month // hindcast_years // output
e.g.:
plotname"_EnsCorr_dry_days_MAM_fcmon01_hc1981-2010.png
plotname"_EnsRocss_cat2_dry_days_MAM_fcmon01_hc1981-2010.png

Details

The verification functions are all based on the package easyVerification.

See Also

Other autoplot_functions: autoplot_anomaly_map(), autoplot_anomaly_ts(), autoplot_climatology_map(), autoplot_forecast_map(), autoplot_forecast_spi(), autoplot_forecast_stations(), autoplot_overview_stations(), autoplot_trend_map(), autoplot_ts_stations()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## load data (see \code{\link{example_climindvis_objects}}:
data("object_hc_grid", "object_hc_st", "object_st", "object_grid")

## Verification of index = "dd"  and season MAM. Output to console.

autoplot_verification_map(
      obs_grid = object_grid, hc_grid = object_hc_grid,
      obs_p = object_st, hc_p = object_hc_st,
      index = "dd", index_args = list(aggt = "seasonal", selagg = "MAM"),
      veri_metrics = c("EnsCorr", "EnsRocss"))

Climandes/ClimIndVis documentation built on Oct. 24, 2021, 10:52 a.m.