Welcome to the R package Luminescence version 1.1.0.9000-12 [Built: 2025-08-18 15:28:02 UTC]
A PhD supervisor: 'You are not depressive, you simply have a crappy life.'
Show code
source("../R/plot_OSLcurve.R")source("../R/plot_MultiExponential.R") # core function
for (case in cases) {plot_OSLcurve(case$curve, case$components,title = case$title)cat("\n")}
Changed on/off settings
Show code
for (case in cases) {plot_OSLcurve(case$curve, case$components,show.legend =FALSE,show.intervals =TRUE,show.crosssec =TRUE,show.initial =TRUE)cat("\n")}
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Test other display modes
Vary the argument “display”. Vary also the ggplot2 themes
Display mode: compare_lin with case Atypical low-res measurement with stretched medium component
Display mode: log with case Atypical low-res measurement with stretched medium component
Input data contains signal components with negative intensity (increasing signals). These can not be displayed with logarithmic y-axis and are therefore omitted.
Warning in ggplot2::scale_y_log10(limits = ylim): log-10 transformation
introduced infinite values.
Display mode: compare_log with case Atypical low-res measurement with stretched medium component
Input data contains signal components with negative intensity (increasing signals). These can not be displayed with logarithmic y-axis and are therefore omitted.
Warning in ggplot2::scale_y_log10(limits = ylim): log-10 transformation
introduced infinite values.
Display mode: loglog with case Background-corrected noise
Input data contains signal components with negative intensity (increasing signals). These can not be displayed with logarithmic y-axis and are therefore omitted.
Signal curve contains value equal/lower zero. Values below 0.1 will not be displayed.
Warning in ggplot2::scale_y_log10(limits = ylim): log-10 transformation
introduced infinite values.
Warning in transformation$transform(x): NaNs wurden erzeugt
Warning in transformation$transform(x): NaNs wurden erzeugt
Warning in ggplot2::scale_y_log10(limits = ylim): log-10 transformation
introduced infinite values.
Warning: Removed 24 rows containing missing values or values outside the scale range
(`geom_line()`).
Display mode: LM with case Background-corrected noise
Display mode: res with case Increasing signal
Display mode: tab with case Increasing signal
Display mode: raw with case Increasing signal
Input object 'curve' has more than two columns. Just the first two are used to define time and signal
Show code
# Repeat test but with for (display_mode in modes) { case <-sample(cases, size =1)[[1]] # Random casecat("Display mode:", display_mode, "with case", case$title, "\n")tryCatch({plot_OSLcurve(case$curve, case$components,display = display_mode,show.legend =FALSE,show.intervals =TRUE,theme.set =sample(themes, size =1)[[1]]) },error =function(e) {message("FOUND ERROR", conditionMessage(e))})cat("\n")}
Display mode: lin with case Increasing signal
Display mode: compare_lin with case Increasing signal
Display mode: log with case Atypical low-res measurement with stretched medium component
Input data contains signal components with negative intensity (increasing signals). These can not be displayed with logarithmic y-axis and are therefore omitted.
Warning in ggplot2::scale_y_log10(limits = ylim): log-10 transformation
introduced infinite values.
Display mode: compare_log with case Sharp drop then complex, with many channels
Input data contains signal components with negative intensity (increasing signals). These can not be displayed with logarithmic y-axis and are therefore omitted.
Warning in ggplot2::scale_y_log10(limits = ylim): log-10 transformation
introduced infinite values.
Display mode: loglog with case Increasing signal
Input data contains signal components with negative intensity (increasing signals). These can not be displayed with logarithmic y-axis and are therefore omitted.
Warning in ggplot2::scale_y_log10(limits = ylim): log-10 transformation
introduced infinite values.
Display mode: LM with case Typical quartz OSL curve
Display mode: res with case Background-corrected noise
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Display mode: tab with case Typical quartz OSL curve
Display mode: raw with case Increasing signal
Input object 'curve' has more than two columns. Just the first two are used to define time and signal
Decay rates (s^-1):
Cycle Comp. 1 Comp. 2 RSS F-value
K = 1 0.4594 359.9 Inf
K = 2 0.4594 0.4594 359.9 -4.76e-09
Left loop because F-test value (F = -4.76e-09) fell below threshold value (F = 3)
-> The F-test suggests the K = 1 model
Photoionisation cross sections (cm^2):
Cycle Comp. 1 Comp. 2
K = 1 6.47e-18 (Medium)
K = 2 6.47e-18 (Medium) 6.47e-18 (Medium.a)
-> Most known quartz OSL components found in the K = 2 model
Show code
# Display resultsplot_OSLcurve(curve, components)
Use RLum objects as input
Show code
# Load example data setdata_path <-system.file("examples", "FB_10Gy_SAR.bin", package ="OSLdecomposition")data_set <- Luminescence::read_BIN2R(data_path, fastForward =TRUE,verbose =FALSE)# Separate componentsdata_set_decomposed <-RLum.OSL_decomposition(data_set, decay_rates =c(0.8, 0.05))
STEP 2.1 ----- Define signal bin intervals -----
OSL curve template necessary but not given. Obtain and use global average curve:
[sum_OSLcurves()]: Built global average curve from arithmetic means from first 999 data points of all 154 OSL records
(time needed: 2.37 s)
Find intervals with lowest component cross correlation by maximising the denominator determinant in Cramers rule:
Maximum determinant = 0.7728 with interval dividing channels at i = 37
(time needed: 0.12 s)
STEP 2.2 ----- Decompose each OSL curve -----
Calculate signal intensity n in each OSL by ' det+nls ' algorithm with empiric error estimation
Table of input decay constants and signal bin intervals for [decompose_OSLcurve()]:
name lambda t.start t.end ch.start ch.end
1 Component 1 0.80 0.000000 3.696296 1 37
2 Component 2 0.05 3.696296 99.800003 38 999
...........
Successfully decomposed 154 records
(time needed: 0.95 s)
Show code
cat("\nCase 1: Use raw RLum.Data.Curve as input\n")
Case 1: Use raw RLum.Data.Curve as input
Show code
plot_OSLcurve(data_set[[4]]@records[[1]])
Warning in plot_OSLcurve(data_set[[4]]@records[[1]]): No component curve given
neither in 'components' nor in 'curve'. Set 'display' = 'raw'
Show code
cat("\nCase 2: Use decomposed RLum.Data.Curve as input\n")
Warning in plot_OSLcurve(data_set_decomposed[[4]]@records[[1]]@data): No
component curve given neither in 'components' nor in 'curve'. Set 'display' =
'raw'
Show code
cat("\nCase 4: Use invalid RLum object as input\n")
Input object 'curve' has more than two columns. Just the first two are used to define time and signal
Input object 'curve' has more than two columns. Just the first two are used to define time and signal
TEST ERROR nicht-numerisches Argument für binären Operator
Don’t show plot
Show code
case <-sample(cases, size =1)[[1]] # Random caseplot_obj <-plot_OSLcurve(case$curve, case$components, hide.plot =TRUE)# Try to display by itselfplot_obj
# Try to display with gridExtra functiongridExtra::grid.arrange(plot_obj)
Save plot as file it
The first plot is saved as PNG file and shown, the second plot is saved as PDF file and not shown. Both are saved in the working directory (D:/01_OSLdecomp/OSLdecomposition/module_tests). Please check and delete both files after executing this test.