Description Usage Arguments Details See Also Examples
The bulk of the computational time for regridding lies in calculating the area-weighted projection matrix. This functions allows you to pre-calculate the projection matrix to speed up regridding.
1 | getProjectionMatrix(orgArea, projArea, verbose = FALSE)
|
orgArea |
A |
projArea |
A |
verbose |
logical. Print info as we go? |
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 appropriate for all variable types and grid shifts. Use with caution.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | numOrgLon <- 3
numOrgLat <- 3
orgLon <- matrix(seq(0, 360-360/numOrgLon, by=360/numOrgLon) + 360/numOrgLon/2,
nrow=numOrgLon, ncol=numOrgLat)
orgLat <- matrix(seq(-90, 90-180/numOrgLat, by=180/numOrgLat) + 180/numOrgLat/2,
nrow=numOrgLon, ncol=numOrgLat, byrow=TRUE)
orgArea <- list(lon = orgLon, lat=orgLat)
numProjLon <- 2
numProjLat <- 2
projLon <- matrix(seq(0, 360-360/numProjLon, by=360/numProjLon) + 360/numProjLon/2,
nrow=numProjLon, ncol=numProjLat)
projLat <- matrix(seq(-90, 90-180/numProjLon, by=180/numProjLon) + 180/numProjLon/2,
nrow=numProjLon, ncol=numProjLat, byrow=TRUE)
projArea <- list(lon = projLon, lat=projLat)
transferMatrix <- getProjectionMatrix(orgArea = orgArea, projArea=projArea)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.