sum_OSLcurves: Combine lists of records to one global average curve

View source: R/sum_OSLcurves.R

sum_OSLcurvesR Documentation

Combine lists of records to one global average curve

Description

This function adds up all records of the same type and calculates the arithmetic mean signals. This is useful to create global average curve with sufficient signal-to-noise ratio for OSL components identification with fit_OSLcurve or to create a signal background reference curve.

Usage

sum_OSLcurves(
  object,
  record_type = "OSL",
  selection = NULL,
  Y_offset = 0,
  verbose = TRUE,
  output.plot = FALSE,
  theme.set = ggplot2::theme_classic(),
  plot.first = FALSE,
  title = NULL,
  filename = NULL
)

Arguments

object

Luminescence::RLum.Analysis, or list of Luminescence::RLum.Analysis, Luminescence::RLum.Data.Curve or data.frame (required): Data set of CW-OSL records.

record_type

character (with default): Type of records which are selected from the input object if it is a RLum object, for example: "OSL","SGOSL" or "IRSL". Does not apply for lists of data.frame.

selection

numeric vector (optional): Vector specifying the indices of elements (aliquots) of a list of Luminescence::RLum.Analysis objects which shall be included.

Y_offset

numeric (with default): Signal offset (background) which will be subtracted from each record.

verbose

logical (with default): Enables console text output.

output.plot

logical (with default): Returns a linear plot as well as a pseudoLM-OSL plot with all data points of all records and the average curve.

theme.set

ggplot2::ggplot2-package object (with default): sets the graphical theme of the output plot. See ggplot2::theme_bw for available themes

plot.first

logical (with default): Plot includes additional drawing of first record_type record of first object list element.

title

character (optional): Plot title. Set title = "auto" for an automatically generated title.

filename

character (optional): File name or path to save the plot as image. If just a file name is given, the image is saved in the working directory. The image type is chosen by the file ending. Both, vector images as well as pixel images are possible. Allowed are .pdf, .eps, .svg (vector graphics), .jpg, .png, .bmp (pixel graphics) and more, see ggplot2::ggsave.

Value

A data.frame of the average signal curve is returned, containing two columns: ⁠$time⁠ and ⁠$signal⁠.

Last updates

2026-03-12, DM: Revised and refactored whole code

  • Function won't accept data sets with varying x-axes and measurement lengths anymore. Now, ONLY records with x-axes IDENTICAL to those of the first record ARE INCLUDED.

  • Accepts list of data.frames as input objects

  • Changed naming and default values of some secondary arguments

  • Faster calculation

  • Plotting is less prone of errors and warnings

  • Enhanced checks of the argument 'selection'

Author(s)

Dirk Mittelstraß, dirk.mittelstrass@luminescence.de

Please cite this package, including its version number. Enter the command citation("OSLdecomposition") to generate the correct reference.

See Also

fit_OSLcurve, RLum.OSL_correction, RLum.OSL_global_fitting

Examples


# 'FB_10Gy' is a dose recovery test with the Fontainebleau quartz
# measured in a lexsyg research with green LED stimulation
data_path <- system.file("examples", "FB_10Gy_SAR.bin", package = "OSLdecomposition")
data_set <- Luminescence::read_BIN2R(data_path, fastForward = TRUE)

# Give average CW-OSL curve back
average_curve <- sum_OSLcurves(data_set)


OSLdecomposition documentation built on March 12, 2026, 5:07 p.m.