selbox.get.closest.gridcell: Determine closest climate model grid cell

Description Usage Arguments Value Author(s) Examples

View source: R/selbox.get.closest.gridcell.R

Description

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).

Usage

1
selbox.get.closest.gridcell(lon.point, lat.point, file.lonlatgrid)

Arguments

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.

Value

Two-element Vector containing the x-(lon) and the y-index (lat) of the closest grid cell.

Author(s)

Sven Kotlarski (MeteoSwiss)

Examples

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)

SvenKotlarski/qmCH2018 documentation built on July 14, 2019, 7:39 p.m.