##(1) - simple transformation
##load CW-OSL curve data
data(ExampleData.CW_OSL_Curve, envir = environment())
##transform values
values.transformed<-CW2pHMi(ExampleData.CW_OSL_Curve)
##plot
plot(values.transformed$x, values.transformed$y.t, log = "x")
##(2) - load CW-OSL curve from BIN-file and plot transformed values
##load BINfile
#BINfileData<-readBIN2R("[path to BIN-file]")
data(ExampleData.BINfileData, envir = environment())
##grep first CW-OSL curve from ALQ 1
curve.ID<-CWOSL.SAR.Data@METADATA[CWOSL.SAR.Data@METADATA[,"LTYPE"]=="OSL" &
CWOSL.SAR.Data@METADATA[,"POSITION"]==1
,"ID"]
curve.HIGH<-CWOSL.SAR.Data@METADATA[CWOSL.SAR.Data@METADATA[,"ID"]==curve.ID[1]
,"HIGH"]
curve.NPOINTS<-CWOSL.SAR.Data@METADATA[CWOSL.SAR.Data@METADATA[,"ID"]==curve.ID[1]
,"NPOINTS"]
##combine curve to data set
curve<-data.frame(x = seq(curve.HIGH/curve.NPOINTS,curve.HIGH,
by = curve.HIGH/curve.NPOINTS),
y=unlist(CWOSL.SAR.Data@DATA[curve.ID[1]]))
##transform values
curve.transformed <- CW2pHMi(curve)
##plot curve
plot(curve.transformed$x, curve.transformed$y.t, log = "x")
##(3) - produce Fig. 4 from Bos & Wallinga (2012)
##load data
data(ExampleData.CW_OSL_Curve, envir = environment())
values <- CW_Curve.BosWallinga2012
##open plot area
plot(NA, NA,
xlim=c(0.001,10),
ylim=c(0,8000),
ylab="pseudo OSL (cts/0.01 s)",
xlab="t [s]",
log="x",
main="Fig. 4 - Bos & Wallinga (2012)")
values.t<-CW2pLMi(values, P=1/20)
lines(values[1:length(values.t[,1]),1],CW2pLMi(values, P=1/20)[,2],
col="red" ,lwd=1.3)
text(0.03,4500,"LM", col="red" ,cex=.8)
values.t<-CW2pHMi(values, delta=40)
lines(values[1:length(values.t[,1]),1],CW2pHMi(values, delta=40)[,2],
col="black", lwd=1.3)
text(0.005,3000,"HM", cex=.8)
values.t<-CW2pPMi(values, P=1/10)
lines(values[1:length(values.t[,1]),1],CW2pPMi(values, P=1/10)[,2],
col="blue", lwd=1.3)
text(0.5,6500,"PM", col="blue" ,cex=.8)
Run the code above in your browser using DataLab