Description Usage Arguments Value Author(s) Examples
View source: R/selbox.get.closest.ngridcells.R
selbox.get.closest.gridcell
determines the n closest
climate model grid cells for a given lon/lat coordinate pair (target).
Criterion: smallest Euclidean distance in lon-lat space. Return error if
target lies completely out of grid range (as defined by grid cell centers).
1 | selbox.get.closest.ngridcells(lon.point, lat.point, file.lonlatgrid, n)
|
lon.point |
Real-world longitude of target (decimal system). |
lat.point |
Real-world latgitude of target (decimal system). |
file.lonlatgrid |
Filename of Rdata file containing list (coords) of grid lon and lat coordinates (matrices longrid and latgrid). Output of function selbox.nclonlat.to.rdata. |
n |
Number of closest grid cells to determine. |
Two-element Matrix [n,2] containing the x-(lon) and the y-indices (lat) of the n closest grid cells.
Sven Kotlarski (MeteoSwiss)
1 2 3 4 5 6 | ## Not run:
# Find the 10 closest grid cells for coordinate longitude 10.38 and
# latitude 42.25
selbox.get.closest.gridcell(10.38,42.25,file.lonlatgrid,10)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.