crr: Cosmic ray removal

Description Usage Arguments Value References Examples

View source: R/crr.R

Description

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.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
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)

## End(Not run)

konradmayer/hyperSpec.utils documentation built on May 2, 2021, 4:17 a.m.