Learn R Programming

RsimMosaic (version 1.0.2)

getCloseMatch: Get a tile which is a close match for a pixel in the parameter space

Description

This function will return the filename of a tile that is a close match to a pixel in the parameter space. The nneig matches are selected using a nearest neighbour search (nn2) in the tile library (libraryDataFrame). After the candidates selected, one of the is randomly choosen and its filename is returned by the function.

Usage

getCloseMatch(pixelArray, libraryDataFrame, nneig = 20)

Arguments

pixelArray
The parameters of the pixel to get a similar image from the library in the parameter space.
libraryDataFrame
The tile library containing the data of the tiles in the parameter space.
nneig
Number of neighbours to retrieve in the intermediate test. Only one of the neighbours will be returned to the user.

Value

The filename of a tile that is a close match to a pixel in the parameter space.

See Also

nn2

Examples

Run this code
# Creates the tile library data frame from the example tiles
my2MassTiles <- createLibraryIndexDataFrame(system.file("extdata/2Massier", package="RsimMosaic"))

# Get a close match for the point with parameters (0.2, 0.3, 0.2)
getCloseMatch(c(0.2, 0.3, 0.2), my2MassTiles)

# Get another close match for the point with parameters (0.2, 0.3, 0.2)
getCloseMatch(c(0.2, 0.3, 0.2), my2MassTiles)

Run the code above in your browser using DataLab