Skip to content

Commit 2ee57bd

Browse files
committed
0.4.0_[2014-12-16.152224]
1 parent d7f2992 commit 2ee57bd

30 files changed

+1131
-699
lines changed

DESCRIPTION

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: Luminescence
22
Type: Package
3-
Title: Package for Luminescence Dating data analysis [upcoming]
3+
Title: Package for Luminescence Dating data analysis
44
Version: 0.4.0
5-
Date: 2014-XX-XX
5+
Date: 2014-12-19
66
Author: Sebastian Kreutzer [aut, trl, cre],
77
Michael Dietze [aut],
88
Christoph Burow [aut],
@@ -22,7 +22,7 @@ Maintainer: Sebastian Kreutzer <sebastian.kreutzer@u-bordeaux-montaigne.fr>
2222
Description: Package provides a collection of various R functions for Luminescence Dating data analysis.
2323
Contact: Package Developer Team <team@r-luminescence.de>
2424
License: GPL-3
25-
Depends: R (>= 3.1.1), utils
25+
Depends: R (>= 3.1.2), utils
2626
Imports: methods, XML, shape, rgl, matrixStats, raster, sp, zoo, bbmle
2727
URL: http://CRAN.R-project.org/package=Luminescence
28-
Collate: Analyse_SAR.OSLdata.R analyse_SAR.CWOSL.R analyse_SAR.TL.R analyse_IRSAR.RF.R CW2pLM.R CW2pLMi.R CW2pHMi.R CW2pPMi.R calc_FadingCorr.R calc_FuchsLang2001.R calc_OSLLxTxRatio.R calc_TLLxTxRatio.R Second2Gray.R fit_LMCurve.R fit_CWCurve.R plot_Risoe.BINfileData.R plot_KDE.R plot_GrowthCurve.R plot_Histogram.R plot_RadialPlot.R plot_RLum.R plot_RLum.Analysis.R plot_RLum.Data.Curve.R readBIN2R.R RisoeBINfileData-class.R Risoe.BINfileData2RLum.Analysis.R RLum-class.R RLum.Data-class.R RLum.Data.Curve-class.R RLum.Analysis-class.R RLum.Results-class.R calc_CentralDose.R calc_FiniteMixture.R calc_MinDose.R calc_CommonDose.R calc_CosmicDoseRate.R merge_Risoe.BINfileData.R writeR2BIN.R Risoe.BINfileData2RLum.Data.Curve.R calc_HomogeneityTest.R calc_AliquotSize.R readXSYG2R.R RLum.Data.Spectrum-class.R plot_RLum.Data.Spectrum.R calc_MaxDose.R plot_AbanicoPlot.R plot_DRTResults.R calc_Statistics.R apply_CosmicRayRemoval.R apply_EfficiencyCorrection.R readSPE2R.R RLum.Data.Image-class.R plot_RLum.Data.Image.R get_Layout.R analyse_pIRIRSequence.R merge_RLum.R get_RLum.R merge_RLum.Analysis.R plot_RLum.Results.R zzz.R
28+
Collate: Analyse_SAR.OSLdata.R analyse_SAR.CWOSL.R analyse_SAR.TL.R analyse_IRSAR.RF.R CW2pLM.R CW2pLMi.R CW2pHMi.R CW2pPMi.R calc_FadingCorr.R calc_FuchsLang2001.R calc_OSLLxTxRatio.R calc_TLLxTxRatio.R Second2Gray.R fit_LMCurve.R fit_CWCurve.R plot_Risoe.BINfileData.R plot_KDE.R plot_GrowthCurve.R plot_Histogram.R plot_RadialPlot.R plot_RLum.R plot_RLum.Analysis.R plot_RLum.Data.Curve.R readBIN2R.R RisoeBINfileData-class.R Risoe.BINfileData2RLum.Analysis.R RLum-class.R RLum.Data-class.R RLum.Data.Curve-class.R RLum.Analysis-class.R RLum.Results-class.R calc_CentralDose.R calc_FiniteMixture.R calc_MinDose.R calc_CommonDose.R calc_CosmicDoseRate.R merge_Risoe.BINfileData.R writeR2BIN.R Risoe.BINfileData2RLum.Data.Curve.R calc_HomogeneityTest.R calc_AliquotSize.R readXSYG2R.R RLum.Data.Spectrum-class.R plot_RLum.Data.Spectrum.R calc_MaxDose.R plot_AbanicoPlot.R plot_DRTResults.R calc_Statistics.R apply_CosmicRayRemoval.R apply_EfficiencyCorrection.R readSPE2R.R RLum.Data.Image-class.R plot_RLum.Data.Image.R get_Layout.R analyse_pIRIRSequence.R merge_RLum.R get_RLum.R merge_RLum.Analysis.R plot_RLum.Results.R calc_SourceDoseRate.R zzz.R

NEWS

+24-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
NEWS for the R Package Luminescence
22

3-
Changes in version 0.4.0 (XX XXXX, 2014):
3+
Changes in version 0.4.0 (December 19th, 2014):
44

55
New S4-classes, methods:
66

@@ -42,6 +42,10 @@ Changes in version 0.4.0 (XX XXXX, 2014):
4242
estimating the minimum dose of a De distribution, this
4343
function estimates the maximum dose.
4444

45+
• ‘calc_SourceDoseRate()’: calculating the dose rate of the
46+
irradiation source at the date of measurement based on:
47+
source calibration date, source dose rate, dose rate error.
48+
4549
• ‘get_Layout()’: Helper function to return a list with layout
4650
definitions for more homogenous plotting,
4751

@@ -160,8 +164,11 @@ Changes in version 0.4.0 (XX XXXX, 2014):
160164
• Error message implemented for non OSL data sets (#130,
161165
Georgina King),
162166

163-
• Added argument ‘dtype’ to provide further curve
164-
limitation options,
167+
• add argument ‘dtype’ to provide further curve limitation
168+
options,
169+
170+
• add argument ‘keep.SEL’ to allow a manual curve
171+
selection (advanced users),
165172

166173
• minor code polishing.
167174

@@ -447,7 +454,9 @@ Changes in version 0.4.0 (XX XXXX, 2014):
447454
• bug for small values fixed, rounding to 0 decimals
448455
replaced by 3 significant digits,
449456

450-
• parameter ‘at’ to allow user-defined z-tick positions.
457+
• parameter ‘at’ to allow user-defined z-tick positions,
458+
459+
• individual statistical summary order supported (#184).
451460

452461
• ‘plot_DRTResults()’:
453462

@@ -492,7 +501,9 @@ Changes in version 0.4.0 (XX XXXX, 2014):
492501

493502
• support of summary keywords "kurtosis" and "skewness",
494503

495-
• example y-lim bug removed (#177).
504+
• example y-lim bug removed (#177),
505+
506+
• individual statistical summary order supported (#184).
496507

497508
• ‘plot_KDE()’:
498509

@@ -509,7 +520,9 @@ Changes in version 0.4.0 (XX XXXX, 2014):
509520
• support of ‘par(mfcol())’,
510521

511522
• support of error-free data extended (now also for
512-
calculation of kde max) (#178).
523+
calculation of kde max) (#178),
524+
525+
• individual statistical summary order supported (#184).
513526

514527
• ‘plot_GrowthCurve()’:
515528

@@ -541,6 +554,8 @@ Changes in version 0.4.0 (XX XXXX, 2014):
541554
• fix ‘'EXP+EXP'’ fit as is was broken, due to a coding
542555
error,
543556

557+
• correct for wrong ‘par()’ resetting,
558+
544559
• minor code polishing and adjustment.
545560

546561
• ‘plot_RadialPlot()’:
@@ -550,7 +565,9 @@ Changes in version 0.4.0 (XX XXXX, 2014):
550565
• rug option added,
551566

552567
• bug for small values fixed, rounding to 0 decimals
553-
replaced by 3 significant digits.
568+
replaced by 3 significant digits,
569+
570+
• individual statistical summary order supported (#184).
554571

555572
• ‘plot_RLum.Analysis()’:
556573

R/Analyse_SAR.OSLdata.R

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Analyse_SAR.OSLdata<- structure(function(#Analyse SAR CW-OSL measurements.
99
## Margret C. Fuchs, AWI Potsdam (Germany), TU Bergakademie Freiberg (Germany)\cr
1010

1111
##section<<
12-
## version 0.2.14
12+
## version 0.2.15
1313
# ===========================================================================
1414

1515
input.data,
@@ -45,6 +45,11 @@ Analyse_SAR.OSLdata<- structure(function(#Analyse SAR CW-OSL measurements.
4545
### limits the curves to this two data types. By default all values are allowed.
4646
### See \link{Risoe.BINfileData-class} for allowed data types.
4747

48+
keep.SEL = FALSE,
49+
### \code{\link{logical}} (default): option allowing to use the \code{SEL} element of the
50+
### \link{Risoe.BINfileData-class} manually. NOTE: In this case any limitation provided by
51+
### \code{run}, \code{set} and \code{dtype} are ignored!
52+
4853
info.measurement = "unkown measurement",
4954
### \link{character} (with default): option to provide information about
5055
### the measurement on the plot output (e.g. name of the BIN or BINX file).
@@ -118,12 +123,14 @@ if(length(which(sample.data@METADATA["POSITION"]==i))>0){
118123

119124
}
120125

126+
if(!keep.SEL){
121127
##select all OSL data depending on the run and set
122128
sample.data@METADATA[,"SEL"]<-FALSE
123129
sample.data@METADATA[sample.data@METADATA[,"LTYPE"]=="OSL" &
124130
sample.data@METADATA[,"RUN"]%in%run==TRUE &
125131
sample.data@METADATA[,"SET"]%in%set==TRUE &
126132
sample.data@METADATA[,"DTYPE"]%in%dtype==TRUE, "SEL"] <- TRUE
133+
}
127134

128135
##grep all OSL curve IDs
129136
OSL.curveID<-sample.data@METADATA[sample.data@METADATA["SEL"]==TRUE &

R/RLum.Results-class.R

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
##//////////////////////////////////////////////////////////////////////////////
44
##==============================================================================
55
##author: Sebastian Kreutzer
6-
##organisation: IRAMAT-CRP2A, Universite Bordeaux Montaigne/JLU Giessen/Freiberg Instruments
7-
##version: 0.2.5
6+
##organisation: IRAMAT-CRP2A, Universite Bordeaux Montaigne (France)
7+
##version: 0.2.6
88

99
##==============================================================================
1010

@@ -193,6 +193,16 @@ setMethod("get_RLum.Results",
193193

194194
}
195195

196+
##-------------------------------------------------------------
197+
##calc_SourceDoseRate
198+
if(object@originator == "calc_SourceDoseRate") {
199+
200+
return(object@data[[1]])
201+
202+
}
203+
204+
205+
196206
##-------------------------------------------------------------
197207
##plot_GrowthCurve
198208
if(object@originator == "plot_GrowthCurve") {

R/RisoeBINfileData-class.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ setMethod("get_Risoe.BINfileData",
8787
signature=signature(object = "Risoe.BINfileData"),
8888
definition = function(object) {
8989

90-
cat("[get_Risoe.BINfileData]: No direct access is provided object type. Use the function 'Risoe.BINfileData2RLum.Analysis' for object coercing instead.")
90+
cat("[get_Risoe.BINfileData()]: No direct access is provided object type. Use the function 'Risoe.BINfileData2RLum.Analysis' for object coercing instead.")
9191

9292
})##end setMethod
9393

R/Second2Gray.R

+69-12
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,67 @@ Second2Gray <- structure(function(#Converting values from seconds (s) to gray (G
44

55
# ===========================================================================
66
##author<<
7-
## Sebastian Kreutzer, JLU Giessen (Germany),
8-
## Michael Dietze, GFZ Potsdam (Germany),
7+
## Sebastian Kreutzer, IRAMAT-CRP2A, Universite Bordeaux Montaigne (France),\cr
8+
## Michael Dietze, GFZ Potsdam (Germany),\cr
99
## Margret C. Fuchs, AWI Potsdam (Germany), \cr
1010

1111
##section<<
12-
## version 0.3
12+
## version 0.4
1313
# ===========================================================================
1414

1515
values,
16-
### \link{data.frame} (\bold{required}): measured data (\code{values[,1]}) and data error
17-
### (\code{values [,2]})
16+
### \code{\link{data.frame}} (\bold{required}): input values, structure:
17+
### data (\code{values[,1]}) and data error (\code{values [,2]}) are required
1818

1919
dose_rate,
20-
### \link{vector} (\bold{required}): dose rate in Gy/s and dose rate error in Gy/s
20+
### \code{\linkS4class{RLum.Results}} or \code{\link{vector}} (\bold{required}):
21+
### \code{RLum.Results} needs to be orginated from the function \code{\link{calc_SourceDoseRate}},
22+
### for \code{vector}dose rate in Gy/s and dose rate error in Gy/s
2123

2224
method = "gaussian"
2325
### \link{character} (with default): method used for error calculation
2426
### (\code{gaussian} or \code{absolute}), see details for further information
2527
){
2628

29+
# Integrity tests -----------------------------------------------------------------------------
30+
31+
##(1) data.frame or RLum.Data.Curve object?
32+
if(is(values, "data.frame") == FALSE){
33+
34+
stop("[Second2Gray()] 'values' object has to be of type 'data.frame'!")
35+
36+
}
37+
38+
##(2) data.frame or RLum.Data.Curve object?
39+
if(is(dose_rate, "numeric") == FALSE & is(dose_rate, "RLum.Results") == FALSE){
40+
41+
stop("[Second2Gray()] 'dose_rate' object has to be of type 'numeric' or 'RLum.Results'!")
42+
43+
}
44+
45+
##(3) check for right orginator
46+
if(is(dose_rate, "RLum.Results")){
47+
48+
if(dose_rate@originator != "calc_SourceDoseRate"){
49+
50+
stop("[Second2Gray()] Wrong originator for dose_rate 'RLum.Results' object.")
51+
52+
}else{
53+
54+
dose_rate <- as.numeric(get_RLum.Results(dose_rate, data.object = "dose.rate"))
55+
56+
57+
}
58+
59+
}
60+
61+
# Calculation ---------------------------------------------------------------------------------
62+
63+
2764
De.seconds <- values[,1]
2865
De.error.seconds <- values[,2]
2966

67+
3068
De.gray <- NA
3169
De.error.gray <- NA
3270

@@ -42,13 +80,14 @@ Second2Gray <- structure(function(#Converting values from seconds (s) to gray (G
4280

4381
}else{
4482

45-
stop("[Second2Gray] Error: unknown error calculation method!" )
83+
stop("[Second2Gray()] unsupported error calculation method!" )
4684

4785
}
48-
86+
4987
values <- data.frame(De=De.gray, De.error=De.error.gray)
50-
return(values)
51-
88+
89+
return(values)
90+
5291
# DOCUMENTATION - INLINEDOC LINES -----------------------------------------
5392

5493
##details<<
@@ -77,8 +116,26 @@ Second2Gray <- structure(function(#Converting values from seconds (s) to gray (G
77116

78117
}, ex=function(){
79118

80-
##(1) for dose taken from the example data help file
119+
##(A) for known source dose rate at date of measurement
120+
## - load De data from the example data help file
81121
data(ExampleData.DeValues, envir = environment())
122+
## - convert De(s) to De(Gy)
82123
Second2Gray(ExampleData.DeValues, c(0.0438,0.0019))
124+
125+
126+
127+
128+
129+
##(B) for source dose rate calibration data
130+
## - calculate source dose rate first
131+
dose_rate <- calc_SourceDoseRate(measurement.date = "2014-01-08",
132+
calib.date <- "2008-03-01",
133+
calib.dose.rate <- 5.95,
134+
calib.error <- 0.04)
135+
# read example data
136+
data(ExampleData.DeValues, envir = environment())
137+
138+
# apply Dose_rate to convert De(s) to De(Gy)
139+
Second2Gray(ExampleData.DeValues, dose_rate)
83140

84-
})
141+
})

R/analyse_IRSAR.RF.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ analyse_IRSAR.RF<- structure(function(# Analyse IRSAR RF measurements
77
## Sebastian Kreutzer, IRAMAT-CRP2A, Universite Bordeaux Montaigne (France) \cr
88

99
##section<<
10-
## version 0.2.0
10+
## version 0.2.1
1111
# ===========================================================================
1212

1313
##TODO - keep fit.range in mind for De calculation
@@ -673,7 +673,7 @@ if(output.plot==TRUE){
673673
type="p",
674674
pch=20,
675675
col="grey",
676-
ylab="Residual [a.u.]",
676+
ylab="Resid. [a.u.]",
677677
#lwd=2,
678678
log="")
679679

@@ -682,7 +682,7 @@ if(output.plot==TRUE){
682682
}else{
683683
plot(NA,NA,
684684
xlim=c(0,max(temp.sequence.structure$x.max)),
685-
ylab="Residual [a.u.]",
685+
ylab="Resid. [a.u.]",
686686
xlab=xlab,
687687
ylim=c(-1,1)
688688
)
@@ -769,7 +769,7 @@ if(output.plot==TRUE){
769769
type="p",
770770
pch=20,
771771
col="grey",
772-
ylab="Residual [a.u.]",
772+
ylab="Resid. [a.u.]",
773773
#lwd=2,
774774
log="")
775775

@@ -787,7 +787,7 @@ if(output.plot==TRUE){
787787
type="p",
788788
pch=20,
789789
col="grey",
790-
ylab="Residual [a.u.]",
790+
ylab="Resid. [a.u.]",
791791
#lwd=2,
792792
log="")
793793

0 commit comments

Comments
 (0)