Description Usage Arguments Details Value Function version How to cite Author(s) References See Also Examples
View source: R/apply_CosmicRayRemoval.R
The function provides several methods for cosmicray removal and spectrum smoothing RLum.Data.Spectrum objects and such objects embedded in list or RLum.Analysis objects.
1 2 3 4 5 6 7 8 9 10  apply_CosmicRayRemoval(
object,
method = "smooth",
method.Pych.smoothing = 2,
method.Pych.threshold_factor = 3,
MARGIN = 2,
verbose = FALSE,
plot = FALSE,
...
)

object 
RLum.Data.Spectrum or RLum.Analysis (required): input
object to be treated. This can be also provided as list. If an RLum.Analysis object
is provided, only the RLum.Data.Spectrum objects are treated. Please note: this mixing of
objects do not work for a list of 
method 
character (with default):
Defines method that is applied for cosmic ray removal. Allowed methods are

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., 
method.Pych.threshold_factor 
numeric (with default): Threshold for zerobins in the histogram. Small values mean that more peaks are removed, but signal might be also affected by this removal. 
MARGIN 
integer (with default): on which part the function cosmic ray removal should be applied on:
Note: This argument currently only affects the methods 
verbose 
logical (with default): Option to suppress terminal output., 
plot 
logical (with default):
If 
... 
further arguments and graphical parameters that will be passed to the smooth function. 
method = "Pych"
This method applies the cosmicray 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
For further details see references below.
method = "smooth"
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 be combined by applying the method repeatedly to the dataset (see example).
Returns same object as input.
0.3.0
Kreutzer, S., 2020. apply_CosmicRayRemoval(): Function to remove cosmic rays from an RLum.Data.Spectrum S4 class object. Function version 0.3.0. In: Kreutzer, S., Burow, C., Dietze, M., Fuchs, M.C., Schmidt, C., Fischer, M., Friedrich, J., 2020. Luminescence: Comprehensive Luminescence Dating Data Analysis. R package version 0.9.7. https://CRAN.Rproject.org/package=Luminescence
Sebastian Kreutzer, IRAMATCRP2A, UMR 5060, CNRS  Université Bordeaux Montaigne (France) , RLum Developer Team
Pych, W., 2003. A Fast Algorithm for CosmicRay Removal from Single Images. Astrophysics 116, 148153. http://arxiv.org/pdf/astroph/0311290.pdf?origin=publication_detail
RLum.Data.Spectrum, RLum.Analysis, smooth, smooth.spline, apply_CosmicRayRemoval
1 2 3 4 5  ##(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")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.