Skip to contents

Calculate lambda REMP (Red-Edge Minimum Point), the wavelength at which the first derivative of reflectance crosses zero within a defined search range.

Usage

hsi_calc_remp(
  x,
  search_range = c(660, 680),
  index_name = NULL,
  filename = "",
  overwrite = FALSE,
  ...
)

Arguments

x

A SpatRaster with the first derivative of reflectance. Compute with hsi_smooth_savgol(x, m = 1).

search_range

Numeric vector of length 2. Wavelength range in nm to search for the red-edge minimum point. Default c(660, 680).

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 lambdaREMP values (wavelength in nm).

Details

Lambda REMP is the inflection point where reflectance transitions from decreasing to increasing — typically between 660–680 nm — and is sensitive to chlorophyll-a concentration.

The algorithm:

  1. Subsets the derivative raster to search_range.

  2. Identifies zero-crossings using gsignal::zerocrossing().

  3. Uses linear interpolation to find the exact wavelength where the derivative equals zero.

  4. Falls back to the wavelength nearest zero if no crossing is found.

References

Ghanbari, H., Zilkey, D.R., Gregory-Eaves, I., Antoniades, D., 2023. A new index for the rapid generation of chlorophyll time series from hyperspectral imaging of sediment cores. Limnology and Oceanography: Methods 21, 703-717. doi:10.1002/lom3.10576

Examples

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

x_deriv <- hsi_smooth_savgol(x, m = 1)

x_remp <- hsi_calc_remp(x_deriv)

x_remp <- hsi_calc_remp(x_deriv, search_range = c(665, 690))

x_remp <- hsi_calc_remp(
  x_deriv,
  index_name = "remp",
  filename = "output_remp.tif",
  overwrite = TRUE
)
} # }