Learn R Programming

RCMIP5 (version 1.2.0)

regrid: Project the values of a cmip5data object onto a new grid

Description

Project the values of a cmip5data object onto a new grid

Usage

regrid(orgVar, projLat, projLon, orgArea = NULL, projArea = NULL, projectionMatrix = NULL, verbose = FALSE)

Arguments

orgVar
A cmip5data object to be regridded
projLat
TODO
projLon
TODO
orgArea
TODO
projArea
A cmip5data object or list with lat (latitude) and log (longitude) matricies of the projection grid
projectionMatrix
TODO
verbose
logical. Print info as we go?

Value

A cmip5data object, whose val is the area-weighted regrided variable passed in orgVar parameter. A projectionMatrix field is also added recording projection matrix used in regridding; this can be reused for later variables with the same regridding.

Details

This function calculates the projection matrix to shift one global grid to a second. The relative contribution of an old grid to the new grid is calculated via an area weighting scheme where the area of a grid cell is assumed to be proportional to the degree area of that cell and neighboring cells are assumed to have the same area to degree ratios. This will NOT hold in large grids. Nor is the area weighting scheme appropreate for all variable types and grid shifts. Use with caution.

See Also

getProjectionMatrix