remove_SignalBackground: Remove Signal Background from 'RLum.Data.Curve' Objects

View source: R/remove_SignalBackground.R

remove_SignalBackgroundR Documentation

Remove Signal Background from RLum.Data.Curve Objects

Description

Convenient (background) of luminescence curves using merge_RLum

Usage

remove_SignalBackground(
  object,
  object_bg = NULL,
  recordType = NULL,
  clean_up = TRUE
)

Arguments

object

RLum.Analysis (required): A non-empty RLum.Analysis object with, e.g., OSL/IRSL/TL curves or a list of such object. If a list is provided non-conform list elements are silently removed from the list

object_bg

RLum.Data.Curve, a list of such objects, a matrix or numeric (optional): Sets the background as a curve that is subtracted from the record types set with recordType. If you provide a matrix or numeric internally, everything is coerced to a RLum.Data.Curve object. If you desire full freedom, you can construct a list of RLum.Data.Curve objects.

recordType

character (optional): provide the recordType subject to the background subtraction. Subsequent curve selection uses get_RLum. If set to NULL the record type of highest occurrence will be used. Example: recordType = "TL (UVVIS)"

clean_up

logical (with default): enable/disable background curve removal after background subtraction. If object_bg is set, nothing is removed from the input object as the background is already stored separately.

Details

The function aims to simplify a frequently encountered task: subtracting curves or backgrounds from luminescence curves, such as OSL, TL, or RF. The function presumes that if curves are presented in pairs, for instance, TL - TL, the second curve represents a background signal that needs to be removed from the first curve. Following the removal, the background curve is discarded from the dataset. Alternatively, custom background curves can be provided, which are then utilised for the subtraction. In essence, the function utilises the merge_RLum function but simplifies the selection of pairs and curves.

Value

Returns an RLum.Analysis object or a list of such objects.

Function version

0.1.0

Author(s)

Sebastian Kreutzer, Institute of Geography, Heidelberg University (Germany)

See Also

get_RLum, merge_RLum, RLum.Analysis,RLum.Data.Curve

Examples


## load example dataset
xsyg <- read_XSYG2R(
system.file("extdata/XSYG_file.xsyg", package = "Luminescence"),
fastForward = TRUE,
verbose = FALSE)

## remove constant background from OSL curves
remove_SignalBackground(
object = xsyg,
object_bg = 100,
recordType = "OSL (UVVIS)")

## use a more elaborate examples
## with two TL curves (2nd is background)
xsyg_v1 <- set_RLum("RLum.Analysis", records = c(
 rep(xsyg[[1]]@records[[1]], 2),
 xsyg[[1]]@records[[4]],
 xsyg[[1]]@records[[4]],
 rep(xsyg[[1]]@records[[10]], 2),
 xsyg[[1]]@records[[4]],
 xsyg[[1]]@records[[4]]))

## remove background and strip background
## curves from the object
o <- remove_SignalBackground(
 object = xsyg_v1,
 recordType = "TL (UVVIS)")


R-Lum/Luminescence documentation built on June 9, 2025, 2:40 p.m.