Interpolating to another domain
regrid.Rd
Using spatial interpolation this function transforms a geofield to another geometry.
Usage
regrid(infield, newdomain=.Last.domain(),
method="bilin", mask=NULL, newmask=NULL, weights=NULL)
regrid.init(olddomain, newdomain=.Last.domain(),
method="bilin", mask=NULL, newmask=NULL)
Arguments
- infield
A
geofield
object.- olddomain
A
geodomain
object. It may aso be ageofield
, but only the domain attribute is used for initialising the interpolation.- newdomain
A
geodomain
or ageofield
. In the second case, the new domain attribute is taken from this second field. The default value is the.Last.domain()
, the last domain that has been plotted.
#
- ...
Options for
point.interp
.- method
The interpolation method can be bilinear ("bilin"), bicubic ("bicub") or nearest neighbour ("n" or "c"). Additionally, there are two methods for upscaling: "mean" and "median" (the latter is not yet implemented).
- mask, newmask
A mask (grid of same dimension as infield), points with value 0 (or FALSE) are not used for interpolation. You must provide it for both the old and new grid.
- weights
Output from
regrid.init
. By providing such weights, you can save a lot of time if many fields need interpolation.
Details
This routine uses interpolation to transform the data to a new domain (for instance, different grid resolution, different projection...).
If you use Land/Sea masks, it is possible that a "land" point in the new domain lies between 4 "sea" points of the original domain. In that case, the mask is not applied (the interpolation uses force=FALSE
).