mosaic_sam: Mosaic SAM

Description Usage Arguments Value See Also Examples

View source: R/mosaic_sam.R

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

1
2
3
4
5
6
7
8
9
mosaic_sam(
  info,
  sref,
  derivative = NULL,
  base_corr = TRUE,
  FUN = NULL,
  n_cores = NULL,
  temporal = FALSE
)

Arguments

info

SpectralInfo object.

sref

SpectralReference object.

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

1
2
x <- mosaic_info(base::system.file("extdata/mosaic.dmt", package = "uFTIR"))
mosaic_sam(x, primpke, n_cores = 1, temporal = TRUE)

uFTIR documentation built on Oct. 25, 2021, 9:08 a.m.