specfeat: Function to isolate absorption features

View source: R/continuum_features.R

specfeatR Documentation

Function to isolate absorption features


Function isolates absorption features from band depth or ratio transformed reflectance spectra.


specfeat(x, FWL, tol = 1.0e-7)



Object of class Speclib containing the band depth or ratio transformed reflectance spectra.


A vector containing one wavelength included in each feature to be isolated, e.g. the major absorption features. Features which include these specified wavelengths will be isolated.


The tolerance of the band depth which defines a wavelength as a start or end point of a feature. Usually a band depth of 0 or a ratio of 1 indicates feature limits, however, better results are achieved if slightly deviating values are tolerated.


A feature is defined as the part of the spectrum between two fix points in the transformed spectra (band depth values of 0). This function separates features at wavelengths of interest according to this rule. Hence it allows a subsequent characterization of the features of interest, e.g. via feature_properties or visual inspection via plot.Specfeat. The typical workflow to obtain feature properties is to first calculate the band depth transformSpeclib, then isolate the absorption features specfeat. Optionally, cut_specfeat allows to cut the features at specified wavelengths. Finally use feature_properties to retrieve characteristics of the features.


An object of class Specfeat containing the isolated features.


Hanna Meyer and Lukas Lehnert

See Also

transformSpeclib, cut_specfeat, Specfeat, plot.Specfeat, feature_properties



## Transform speclib
bd <- transformSpeclib(spectral_data, method = "sh", out = "bd")

##Example to isolate the features around 450nm, 700nm, 1200nm and 1500nm.
featureSelection <- specfeat(bd, c(450,700,1200,1500))

## Plot features

## Advanced plotting example
plot(featureSelection, 1:2, stylebysubset = "season")

plot(featureSelection, 1:2, stylebysubset = "season", changecol = FALSE, 
     changetype = TRUE)

hsdar documentation built on March 18, 2022, 6:35 p.m.