Skip to contents

Calculate Relative Absorption Band Depth (RABD)

Usage

hsi_calc_rabd(
  x,
  continuum_edges,
  absorption_band,
  index_type,
  index_name = NULL,
  filename = "",
  overwrite = FALSE,
  ...
)

Arguments

x

A SpatRaster with hyperspectral data.

continuum_edges

Numeric vector of length 2. Continuum anchor wavelengths in nm.

absorption_band

Numeric vector. Wavelength(s) in nm to search for trough (absorption feature). Single value for "strict" type.

index_type

Character. Type of RABD index. One of:

"max"

Flexibly find the lowest reflectance within the trough range.

"strict"

Use a specific wavelength as the trough.

"mid"

Use the midpoint between the min and max trough wavelength.

index_name

Character. Name for the output layer. Default NULL.

filename

Character. Output filename. Default "" keeps result in memory.

overwrite

Logical. Overwrite existing file. Default FALSE.

...

Additional arguments passed to terra::writeRaster().

Value

A SpatRaster with RABD values.

Examples

if (FALSE) { # \dontrun{
x <- terra::rast("REFLECTANCE_testdata.tif")

x_rabd <- hsi_calc_rabd(
  x,
  continuum_edges = c(590, 730),
  absorption_band = 660:680,
  index_type = "max"
)

x_rabd <- hsi_calc_rabd(
  x,
  continuum_edges = c(590, 730),
  absorption_band = 673,
  index_type = "strict",
  index_name = "rabd673",
  filename = "output_rabd.tif",
  overwrite = TRUE
)
} # }