Description Usage Arguments Value Author(s) Examples
View source: R/selbox.get.closest.gridcell.R
selbox.get.closest.gridcell
determines the closest
climate model grid cell for a given lon/lat coordinate pair (target).
Criterion: smallest Euclidean distance in lon-lat space. Returns error
if target lies completely out of grid range (as defined by grid cell
centers).
1 | selbox.get.closest.gridcell(lon.point, lat.point, file.lonlatgrid)
|
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. |
Two-element Vector containing the x-(lon) and the y-index (lat) of the closest grid cell.
Sven Kotlarski (MeteoSwiss)
1 2 3 4 5 | ## Not run:
# Find closest grid cell for coordinate longitude 10.38 and latitude 42.25
selbox.get.closest.gridcell(10.38,42.25,file.lonlatgrid)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.