Normalize spectra by removing the spectral continuum to highlight absorption
features. The continuum is the convex hull connecting local maxima across
the spectrum. Requires the
prospectr package.
Arguments
- x
A
SpatRasterwith hyperspectral data.- 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 continuum-removed values.
Details
Output values are bounded [0, 1] by definition — each band is divided by
its continuum value.
Degenerate spectra for which no valid continuum exists (e.g. cracks,
all-zero or constant spectra, pixels containing NA) return NA in all
bands instead of aborting the computation. Inspect the NA pattern of the
result if coverage looks unexpectedly sparse.
Wavelengths are taken from band names. If band names cannot be converted to numeric wavelengths, band indices are used instead and a warning is issued.
Computationally intensive; consider applying to subsets or regions of
interest rather than full-resolution data. For full-raster processing,
hsi_tiled() can distribute the workload across parallel workers.
See also
Other HSI Transformations:
hsi_apply_mnf(),
hsi_calc_difference(),
hsi_calc_mnf(),
hsi_calc_ndi(),
hsi_calc_raba(),
hsi_calc_rabd(),
hsi_calc_ratio(),
hsi_calc_rcv(),
hsi_calc_reflectance(),
hsi_calc_remp(),
hsi_calc_rmean(),
hsi_calc_rmedian(),
hsi_calc_rsd(),
hsi_calc_stretch(),
hsi_destripe(),
hsi_smooth_median(),
hsi_smooth_savgol(),
hsi_tiled(),
hsi_write_scaled()
Examples
if (FALSE) { # \dontrun{
x <- terra::rast("REFLECTANCE_testdata.tif")
x_crem <- hsi_remove_continuum(x)
x_crem <- hsi_remove_continuum(
x,
filename = "output_crem.tif",
overwrite = TRUE
)
} # }