Skip to content

Commit

Permalink
0.4.0_[2014-12-16.152224]
Browse files Browse the repository at this point in the history
  • Loading branch information
tzerk committed Dec 16, 2014
1 parent d7f2992 commit 2ee57bd
Show file tree
Hide file tree
Showing 30 changed files with 1,131 additions and 699 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: Luminescence
Type: Package
Title: Package for Luminescence Dating data analysis [upcoming]
Title: Package for Luminescence Dating data analysis
Version: 0.4.0
Date: 2014-XX-XX
Date: 2014-12-19
Author: Sebastian Kreutzer [aut, trl, cre],
Michael Dietze [aut],
Christoph Burow [aut],
Expand All @@ -22,7 +22,7 @@ Maintainer: Sebastian Kreutzer <[email protected]>
Description: Package provides a collection of various R functions for Luminescence Dating data analysis.
Contact: Package Developer Team <[email protected]>
License: GPL-3
Depends: R (>= 3.1.1), utils
Depends: R (>= 3.1.2), utils
Imports: methods, XML, shape, rgl, matrixStats, raster, sp, zoo, bbmle
URL: http://CRAN.R-project.org/package=Luminescence
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
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
31 changes: 24 additions & 7 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NEWS for the R Package Luminescence

Changes in version 0.4.0 (XX XXXX, 2014):
Changes in version 0.4.0 (December 19th, 2014):

New S4-classes, methods:

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

• ‘calc_SourceDoseRate()’: calculating the dose rate of the
irradiation source at the date of measurement based on:
source calibration date, source dose rate, dose rate error.

• ‘get_Layout()’: Helper function to return a list with layout
definitions for more homogenous plotting,

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

• Added argument ‘dtype’ to provide further curve
limitation options,
• add argument ‘dtype’ to provide further curve limitation
options,

• add argument ‘keep.SEL’ to allow a manual curve
selection (advanced users),

• minor code polishing.

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

• parameter ‘at’ to allow user-defined z-tick positions.
• parameter ‘at’ to allow user-defined z-tick positions,

• individual statistical summary order supported (#184).

• ‘plot_DRTResults()’:

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

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

• example y-lim bug removed (#177).
• example y-lim bug removed (#177),

• individual statistical summary order supported (#184).

• ‘plot_KDE()’:

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

• support of error-free data extended (now also for
calculation of kde max) (#178).
calculation of kde max) (#178),

• individual statistical summary order supported (#184).

• ‘plot_GrowthCurve()’:

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

• correct for wrong ‘par()’ resetting,

• minor code polishing and adjustment.

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

• bug for small values fixed, rounding to 0 decimals
replaced by 3 significant digits.
replaced by 3 significant digits,

• individual statistical summary order supported (#184).

• ‘plot_RLum.Analysis()’:

Expand Down
9 changes: 8 additions & 1 deletion R/Analyse_SAR.OSLdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Analyse_SAR.OSLdata<- structure(function(#Analyse SAR CW-OSL measurements.
## Margret C. Fuchs, AWI Potsdam (Germany), TU Bergakademie Freiberg (Germany)\cr

##section<<
## version 0.2.14
## version 0.2.15
# ===========================================================================

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

keep.SEL = FALSE,
### \code{\link{logical}} (default): option allowing to use the \code{SEL} element of the
### \link{Risoe.BINfileData-class} manually. NOTE: In this case any limitation provided by
### \code{run}, \code{set} and \code{dtype} are ignored!

info.measurement = "unkown measurement",
### \link{character} (with default): option to provide information about
### the measurement on the plot output (e.g. name of the BIN or BINX file).
Expand Down Expand Up @@ -118,12 +123,14 @@ if(length(which(sample.data@METADATA["POSITION"]==i))>0){

}

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

##grep all OSL curve IDs
OSL.curveID<-sample.data@METADATA[sample.data@METADATA["SEL"]==TRUE &
Expand Down
14 changes: 12 additions & 2 deletions R/RLum.Results-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
##//////////////////////////////////////////////////////////////////////////////
##==============================================================================
##author: Sebastian Kreutzer
##organisation: IRAMAT-CRP2A, Universite Bordeaux Montaigne/JLU Giessen/Freiberg Instruments
##version: 0.2.5
##organisation: IRAMAT-CRP2A, Universite Bordeaux Montaigne (France)
##version: 0.2.6

##==============================================================================

Expand Down Expand Up @@ -193,6 +193,16 @@ setMethod("get_RLum.Results",

}

##-------------------------------------------------------------
##calc_SourceDoseRate
if(object@originator == "calc_SourceDoseRate") {

return(object@data[[1]])

}



##-------------------------------------------------------------
##plot_GrowthCurve
if(object@originator == "plot_GrowthCurve") {
Expand Down
2 changes: 1 addition & 1 deletion R/RisoeBINfileData-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ setMethod("get_Risoe.BINfileData",
signature=signature(object = "Risoe.BINfileData"),
definition = function(object) {

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

})##end setMethod

Expand Down
81 changes: 69 additions & 12 deletions R/Second2Gray.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,67 @@ Second2Gray <- structure(function(#Converting values from seconds (s) to gray (G

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

##section<<
## version 0.3
## version 0.4
# ===========================================================================

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

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

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

# Integrity tests -----------------------------------------------------------------------------

##(1) data.frame or RLum.Data.Curve object?
if(is(values, "data.frame") == FALSE){

stop("[Second2Gray()] 'values' object has to be of type 'data.frame'!")

}

##(2) data.frame or RLum.Data.Curve object?
if(is(dose_rate, "numeric") == FALSE & is(dose_rate, "RLum.Results") == FALSE){

stop("[Second2Gray()] 'dose_rate' object has to be of type 'numeric' or 'RLum.Results'!")

}

##(3) check for right orginator
if(is(dose_rate, "RLum.Results")){

if(dose_rate@originator != "calc_SourceDoseRate"){

stop("[Second2Gray()] Wrong originator for dose_rate 'RLum.Results' object.")

}else{

dose_rate <- as.numeric(get_RLum.Results(dose_rate, data.object = "dose.rate"))


}

}

# Calculation ---------------------------------------------------------------------------------


De.seconds <- values[,1]
De.error.seconds <- values[,2]


De.gray <- NA
De.error.gray <- NA

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

}else{

stop("[Second2Gray] Error: unknown error calculation method!" )
stop("[Second2Gray()] unsupported error calculation method!" )

}

values <- data.frame(De=De.gray, De.error=De.error.gray)
return(values)


return(values)

# DOCUMENTATION - INLINEDOC LINES -----------------------------------------

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

}, ex=function(){

##(1) for dose taken from the example data help file
##(A) for known source dose rate at date of measurement
## - load De data from the example data help file
data(ExampleData.DeValues, envir = environment())
## - convert De(s) to De(Gy)
Second2Gray(ExampleData.DeValues, c(0.0438,0.0019))





##(B) for source dose rate calibration data
## - calculate source dose rate first
dose_rate <- calc_SourceDoseRate(measurement.date = "2014-01-08",
calib.date <- "2008-03-01",
calib.dose.rate <- 5.95,
calib.error <- 0.04)
# read example data
data(ExampleData.DeValues, envir = environment())

# apply Dose_rate to convert De(s) to De(Gy)
Second2Gray(ExampleData.DeValues, dose_rate)

})
})
10 changes: 5 additions & 5 deletions R/analyse_IRSAR.RF.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ analyse_IRSAR.RF<- structure(function(# Analyse IRSAR RF measurements
## Sebastian Kreutzer, IRAMAT-CRP2A, Universite Bordeaux Montaigne (France) \cr

##section<<
## version 0.2.0
## version 0.2.1
# ===========================================================================

##TODO - keep fit.range in mind for De calculation
Expand Down Expand Up @@ -673,7 +673,7 @@ if(output.plot==TRUE){
type="p",
pch=20,
col="grey",
ylab="Residual [a.u.]",
ylab="Resid. [a.u.]",
#lwd=2,
log="")

Expand All @@ -682,7 +682,7 @@ if(output.plot==TRUE){
}else{
plot(NA,NA,
xlim=c(0,max(temp.sequence.structure$x.max)),
ylab="Residual [a.u.]",
ylab="Resid. [a.u.]",
xlab=xlab,
ylim=c(-1,1)
)
Expand Down Expand Up @@ -769,7 +769,7 @@ if(output.plot==TRUE){
type="p",
pch=20,
col="grey",
ylab="Residual [a.u.]",
ylab="Resid. [a.u.]",
#lwd=2,
log="")

Expand All @@ -787,7 +787,7 @@ if(output.plot==TRUE){
type="p",
pch=20,
col="grey",
ylab="Residual [a.u.]",
ylab="Resid. [a.u.]",
#lwd=2,
log="")

Expand Down
Loading

0 comments on commit 2ee57bd

Please sign in to comment.