Learn R Programming

uFTIR (version 0.1.4)

mosaic_sam: Mosaic SAM

Description

The function performs the spectral angle mapper algorithm chunk by chunk for the mosaics files. It uses the parallel package, and by default all cores -1.

The function uses mosaic_chunk to cast a mosaic tile as a Tile object. Then performs a tile_base_corr, wavealing, and tile_sam to finaly write binary files that hold the Spectral Angle Mapper results in the destination folder (path slot of the SpectralInfo object). The files can be loaded back to R using link{mosaic_compose}.

The function is using the parallel package, as each tile_sam takes a while to complete.

Usage

mosaic_sam(
  info,
  sref,
  derivative = NULL,
  base_corr = TRUE,
  FUN = NULL,
  n_cores = NULL,
  temporal = FALSE
)

Arguments

info

SpectralInfo object.

sref
derivative

whether to apply the first (1) or second (2) derivative before sam. Default NULL.

base_corr

TRUE/FALSE should tile_base_corr be call before processing each chunk?

FUN

A function to be passed to preprocess.It is always applied as if 'data' were a SpectralPack object.

n_cores

The number of cores to parallelize the task. NULL means all cores -1.

temporal

Whether the file should be written in a temporal folder or in the folder where the main file lives.

Value

The folder path where the files where written

See Also

For a single tile application see tile_sam.

Examples

Run this code
# NOT RUN {
x <- mosaic_info(base::system.file("extdata/mosaic.dmt", package = "uFTIR"))
mosaic_sam(x, primpke, n_cores = 1, temporal = TRUE)
# }

Run the code above in your browser using DataLab