rescaleGrid: Grid rescaling

View source: R/rescaleGrid.R

rescaleGridR Documentation

Grid rescaling

Description

Rescale a grid (or compute anomalies)

Usage

rescaleGrid(
  grid,
  grid.clim = NULL,
  ref = NULL,
  by.member = TRUE,
  parallel = FALSE,
  max.ncores = 16,
  ncores = NULL
)

Arguments

grid

Input grid to be rescaled

grid.clim

Reference climatology to be subtracted to the input grid. If NULL (the default), the climatology is directly computed from the grid via climatology, either member-by-member or using the ensemble mean climatology, as specified by the by.member flag.

ref

Reference grid. After subtracting to grid its climatology (as defined by grid.clim), the mean climatology of this additional grid is added. Default to NULL, so no reference grid is used.

by.member

Logical. In case of multimember grids, should the climatology be computed sepparately for each member (by.member=TRUE), or a single climatology calculated from the ensemble mean (by.member=FALSE)?. Default to TRUE. Argument passed to climatology.

parallel

Logical. Should parallel execution be used?

max.ncores

Integer. Upper bound for user-defined number of cores.

ncores

Integer number of cores used in parallel computation. Self-selected number of cores is used when ncpus = NULL (the default), or when maxcores exceeds the default ncores value.

Details

The reference grid (ref) is used to correct the input grid, as follows:

grid' = grid - mu_grid + mu_ref

, where mu corresponds to the monthly climatological mean considering the training period, and grid' is the corrected test data. The way mu_ref and mu_grid are computed in case of multimember grids is controlled by the argument by.member.

Note that if both grid.clim and ref are set to NULL, the output grid corresponds to the anomaly field of the input grid w.r.t. its own mean.

The ref usually corresponds to the control run of the GCM in the training period in climate change applications, or the hindcast data for the training period in s2d applications. Note that by default ref = NULL. In this case it will be assumed to be the pred grid. This can be used for instance when train and test correspond to the same model.

Value

A rescaled grid

Author(s)

J. Bedia


SantanderMetGroup/transformeR documentation built on Oct. 28, 2023, 5:26 a.m.