upscaleGrid: Horizontal grid upscaling

View source: R/upscaleGrid.R

upscaleGridR Documentation

Horizontal grid upscaling

Description

Aggregates a grid along the target dimensions using user-defined functions.

Usage

upscaleGrid(grid, times = 5, aggr.fun = list(FUN = max, na.rm = TRUE))

Arguments

grid

a grid or multigrid to be aggregated.

times

Degradation times. For instance, if the resolution of grid is 1 degree and times = 2, the resolution of the output grid will be 2 degrees.

aggr.fun

Upscale function. Default retains the maximum value.

Details

The development of a more eficient and fast version of the function is planned.

Value

A grid or multigrid aggregated along the chosen dimension(s).

Author(s)

M. Iturbide

Examples

## Not run: 
require(climate4R.datasets)
data("EOBS_Iberia_pr")
library(visualizeR)
spatialPlot(climatology(EOBS_Iberia_pr))
newgrid <- upscaleGrid(redim(EOBS_Iberia_pr), 
                       times = 2,
                       aggr.fun = list(FUN = "min", na.rm = TRUE))
spatialPlot(climatology(newgrid))

## End(Not run)

SantanderMetGroup/transformeR documentation built on Nov. 25, 2024, 1:25 p.m.