selbox.get.closest.ngridcells: Determine the n closest climate model grid cells

Description Usage Arguments Value Author(s) Examples

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

Description

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

Usage

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

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.

n

Number of closest grid cells to determine.

Value

Two-element Matrix [n,2] containing the x-(lon) and the y-indices (lat) of the n closest grid cells.

Author(s)

Sven Kotlarski (MeteoSwiss)

Examples

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)

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