CST_Anomaly {CSTools}R Documentation

Anomalies relative to a climatology along selected dimension with or without cross-validation

Description

This function computes the anomalies relative to a climatology computed along the selected dimension (usually starting dates or forecast time) allowing the application or not of crossvalidated climatologies. The computation is carried out independently for experimental and observational data products.

Usage

CST_Anomaly(
  exp = NULL,
  obs = NULL,
  cross = FALSE,
  memb = TRUE,
  filter_span = NULL,
  dim_anom = 3
)

Arguments

exp

an object of class s2dv_cube as returned by CST_Load function, containing the seasonal forecast experiment data in the element named $data.

obs

an object of class s2dv_cube as returned by CST_Load function, containing the observed data in the element named $data.'

cross

A logical value indicating whether cross-validation should be applied or not. Default = FALSE.

memb

A logical value indicating whether Clim() computes one climatology for each experimental data product member(TRUE) or it computes one sole climatology for all members (FALSE). Default = TRUE.

filter_span

a numeric value indicating the degree of smoothing. This option is only available if parameter cross is set to FALSE.

dim_anom

An integer indicating the dimension along which the climatology will be computed. It usually corresponds to 3 (sdates) or 4 (ftime). Default = 3.

Value

A list with two S3 objects, 'exp' and 'obs', of the class 's2dv_cube', containing experimental and date-corresponding observational anomalies, respectively. These 's2dv_cube's can be ingested by other functions in CSTools.

Author(s)

Perez-Zanon Nuria, nuria.perez@bsc.es

Pena Jesus, jesus.pena@bsc.es

See Also

Ano_CrossValid, Clim and CST_Load

Examples

# Example 1:
mod <- 1 : (2 * 3 * 4 * 5 * 6 * 7)
dim(mod) <- c(dataset = 2, member = 3, sdate = 4, ftime = 5, lat = 6, lon = 7)
obs <- 1 : (1 * 1 * 4 * 5 * 6 * 7)
dim(obs) <- c(dataset = 1, member = 1, sdate = 4, ftime = 5, lat = 6, lon = 7)
lon <- seq(0, 30, 5)
lat <- seq(0, 25, 5)
exp <- list(data = mod, lat = lat, lon = lon)
obs <- list(data = obs, lat = lat, lon = lon)
attr(exp, 'class') <- 's2dv_cube'
attr(obs, 'class') <- 's2dv_cube'

anom1 <- CST_Anomaly(exp = exp, obs = obs, cross = FALSE, memb = TRUE)
str(anom1)
anom2 <- CST_Anomaly(exp = exp, obs = obs, cross = TRUE, memb = TRUE)
str(anom2)

anom3 <- CST_Anomaly(exp = exp, obs = obs, cross = TRUE, memb = FALSE)
str(anom3)

anom4 <- CST_Anomaly(exp = exp, obs = obs, cross = FALSE, memb = FALSE)
str(anom4)

anom5 <- CST_Anomaly(lonlat_data$exp)

anom6 <- CST_Anomaly(obs = lonlat_data$obs)


[Package CSTools version 4.0.1 Index]