Cosmic spikes are often appearing in Raman spectra which were aquired using CCD detectors and need to be removed before further analysis. This function is implemented using the R code provided with Whitaker and Hayes 2018.

crr(x, threshold = 30)

Arguments

x

an object of class hyperSpec.

threshold

numeric.

Value

an object of class hyperSpec with cosmic rays removed.

References

Whitaker, Darren A., Hayes Kevin, A simple algorithm for despiking Raman spectra, Chemometrics and Intelligent Laboratory Systems, Volume 179, 2018, Pages 82-84, https://doi.org/10.1016/j.chemolab.2018.06.009.

Examples

if (FALSE) { chondro_spike <- chondro # add spikes chondro_spike[[20, , 800]] <- 5000 chondro_spike[[50, , 1400]] <- 4000 chondro_spike[[50, , 1200]] <- 5000 plot(chondro_spike) # despike despiked <- crr(chondro_spike) plot(despiked) }