Learn R Programming

sits (version 1.1.0)

sits_mixture_model: Multiple endmember spectral mixture analysis

Description

Create a multiple endmember spectral mixture analyses fractions images. To calculate the fraction of each endmember, the non-negative least squares (NNLS) solver is used. The NNLS implementation was made by Jakob Schwalb-Willmann in RStoolbox package (licensed as GPL>=3).

Usage

sits_mixture_model(
  cube,
  endmembers_spectra,
  memsize = 1,
  multicores = 2,
  output_dir = getwd(),
  rmse_band = TRUE,
  remove_outliers = TRUE,
  progress = TRUE
)

Value

a sits cube with the generated fractions.

Arguments

cube

A sits data cube.

endmembers_spectra

Reference endmembers spectra in a tibble format. (see details below).

memsize

Memory available for mixture model (in GB).

multicores

Number of cores to be used for generate the mixture model.

output_dir

Directory for output file.

rmse_band

A boolean indicating whether the error associated with the linear model should be generated. If true, a new band with the errors for each pixel is generated using the root mean square measure (RMSE). Default is TRUE.

remove_outliers

A boolean indicating whether values larger and smaller than the limits in the image metadata, and missing values should be marked as NA. This parameter can be used when the cloud component is added to the mixture model. Default is TRUE.

progress

Show progress bar? Default is TRUE.

Author

Felipe Carvalho, felipe.carvalho@inpe.br

Felipe Carlos, efelipecarlos@gmail.com

Rolf Simoes, rolf.simoes@inpe.br

Alber Sanchez, alber.ipia@inpe.br

References

RStoolbox package (https://github.com/bleutner/RStoolbox/)

Examples

Run this code
if (sits_run_examples()) {
   # --- Create a cube based on a local MODIS data
   data_dir <- system.file("extdata/raster/mod13q1", package = "sits")

   modis_cube <- sits_cube(
       source = "BDC",
       collection = "MOD13Q1-6",
       data_dir = data_dir,
       delim = "_"
   )

   endmembers_spectra <- tibble::tibble(
       type = c("vegetation", "not-vegetation"),
       NDVI = c(8500, 3400)
   )

   mixture_cube <- sits_mixture_model(
       cube = modis_cube,
       endmembers_spectra = endmembers_spectra,
       memsize = 4,
       multicores = 2,
       output_dir = tempdir()
   )
}

Run the code above in your browser using DataLab