Learn R Programming

Luminescence (version 0.3.4)

apply_CosmicRayRemoval: Function to remove cosmic rays from an RLum.Data.Spectrum S4 class objects

Description

The function provides several methods for cosmic ray removal and spectrum smoothing for an RLum.Data.Spectrum S4 class objects

Usage

apply_CosmicRayRemoval(object, method = "Pych", method.Pych.smoothing = 2, 
    method.Pych.histogram.plot = FALSE, silent = FALSE, ...)

Arguments

object
RLum.Data.Spectrum (required): S4 object of class RLum.Data.Spectrum
method
character (with default): Defines method that is applied for cosmic ray removal. Allowed methods smooth (smooth), smooth.spline
method.Pych.smoothing
integer (with default): Smoothing parameter for cosmic ray removal according to Pych (2003). The value defines how many neighboring values in each frame are used for smoothing (e.g. 2 mean
method.Pych.histogram.plot
logical (with default): If TRUE the histograms used for the cosmic-ray removal are returned as plot including the used threshold. Note: A separat plot is returned for each frame!,
silent
logical (with default): Option to suppress terminal output
...
further arguments and graphical parameters that will be passed to the smooth function.

Value

  • Returns same object as input (RLum.Data.Spectrum)

bold

method = "smooth"

cr

Method uses the function smooth to remove cosmic rays. Arguments that can be passed are: kind, twiceit method = "smooth.spline" Method uses the function smooth.spline to remove cosmic rays. Arguments that can be passed are: spar How to combine methods? Different methods can combined by applying the method repeatedly on the dataset (see example).

Function version

0.1.2 (2014-06-04 18:50:49)

Details

method = "Pych" This method applies the cosmic-ray removal algorithm described by Pych (2003). Some aspects that are different to the publication:
  • For interpolation between neighbouring values the median and not the mean is used.
The number of breaks to construct the histogram is set to: length(number.of.input.values)/2

References

Pych, W., 2003. A Fast Algorithm for Cosmic-Ray Removal from Single Images. Astrophysics 116, 148-153. http://arxiv.org/pdf/astro-ph/0311290.pdf?origin=publication_detail

See Also

RLum.Data.Spectrum, smooth, smooth.spline, apply_CosmicRayRemoval

Examples

Run this code
##(1) - use with your own data and combine (uncomment for usage)
## run two times the default method and smooth with another method
## your.spectrum <- apply_CosmicRayRemoval(your.spectrum, method = "Pych")
## your.spectrum <- apply_CosmicRayRemoval(your.spectrum, method = "Pych")
## your.spectrum <- apply_CosmicRayRemoval(your.spectrum, method = "smooth")

Run the code above in your browser using DataLab