grid2PCs | R Documentation |
Projection of a grid onto a user-defined EOF
grid2PCs(prinCompObj, grid, n.pcs = NULL)
prinCompObj |
An object created by |
grid |
Input grid to project. Multigrids are not allowed. |
n.pcs |
Number of principal components to be retained. Default to the number of EOFs contained in the input |
The function is intended to project a grid onto user specified EOFs, contained in prinCompObj
.
Note that the grid should have the same spatial extent and resolution than the original EOF, so input grids from
different models should be first interpolated. Also, to ensure consistency, both objects should contain the same
variable name.
Note that the function is not currently implemented to deal with decadal predictions (i.e., 'runtime' dimension is not handled)
A list, each component corresponding to a member (a list of length 1 if the projected grid is not multimember),
containing a matrix of PCs, being the number of columns defined by n.pcs
, and the number of rows by the
length of the time dimension.
J Bedia
prinComp
for EOF analysis.
Other pca:
PC2grid()
,
gridFromPCA()
,
prinComp()
require(climate4R.datasets)
# Obtain the Sea-level pressure PCs of CFSv2 forecast using the NCEP reanalysis EOF:
data("NCEP_Iberia_psl")
NCEP_psl_PCAobject <- prinComp(NCEP_Iberia_psl, v.exp = .95)
data("CFS_Iberia_psl")
# Need to be in the same spatial coordinates
CFS_psl_grid <- interpGrid(CFS_Iberia_psl, new.coordinates = getGrid(NCEP_Iberia_psl))
# Need to have the same short name of the variable
CFSv2_PCs <- grid2PCs(NCEP_psl_PCAobject, grid = CFS_psl_grid)
str(CFSv2_PCs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.