Learn R Programming

Luminescence (version 0.7.1)

read_SPE2R: Import Princeton Intruments (TM) SPE-file into R

Description

Function imports Princeton Instruments (TM) SPE-files into R environment and provides RLum objects as output.

Usage

read_SPE2R(file, output.object = "RLum.Data.Image", frame.range, txtProgressBar = TRUE)

Arguments

file
character (required): spe-file name (including path), e.g. [WIN]: read_SPE2R("C:/Desktop/test.spe"), [MAC/LINUX]: readSPER("/User/test/Desktop/test.spe")
output.object
character (with default): set RLum output object. Allowed types are "RLum.Data.Spectrum", "RLum.Data.Image" or "matrix"
frame.range
vector (optional): limit frame range, e.g. select first 100 frames by frame.range = c(1,100)
txtProgressBar
logical (with default): enables or disables txtProgressBar.

Value

Depending on the chosen option the functions returns three different type of objects:output.object.RLum.Data.SpectrumAn object of type RLum.Data.Spectrum is returned. Row sums are used to integrate all counts over one channel.RLum.Data.ImageAn object of type RLum.Data.Image is returned. Due to performace reasons the import is aborted for files containing more than 100 frames. This limitation can be overwritten manually by using the argument frame.frange.matrixReturns a matrix of the form: Rows = Channels, columns = Frames. For the transformation the function get_RLum is used, meaning that the same results can be obtained by using the function get_RLum on an RLum.Data.Spectrum or RLum.Data.Image object.

Function version

0.1.0 (2017-02-06 12:37:41)

How to cite

Kreutzer, S. (2017). read_SPE2R(): Import Princeton Intruments (TM) SPE-file into R. Function version 0.1.0. In: Kreutzer, S., Dietze, M., Burow, C., Fuchs, M.C., Schmidt, C., Fischer, M., Friedrich, J. (2017). Luminescence: Comprehensive Luminescence Dating Data Analysis. R package version 0.7.1. https://CRAN.R-project.org/package=Luminescence

Details

Function provides an import routine for the Princton Instruments SPE format. Import functionality is based on the file format description provided by Princton Instruments and a MatLab script written by Carl Hall (s. references).

References

Princeton Instruments, 2014. Princeton Instruments SPE 3.0 File Format Specification, Version 1.A (for document URL please use an internet search machine)

Hall, C., 2012: readSPE.m. http://www.mathworks.com/matlabcentral/fileexchange/35940-readspe/content/readSPE.m

See Also

readBin, RLum.Data.Spectrum, raster

Examples

Run this code


## to run examples uncomment lines and run the code

##(1) Import data as RLum.Data.Spectrum object
#file <- file.choose()
#temp <- read_SPE2R(file)
#temp

##(2) Import data as RLum.Data.Image object
#file <- file.choose()
#temp <- read_SPE2R(file, output.object = "RLum.Data.Image")
#temp

##(3) Import data as matrix object
#file <- file.choose()
#temp <- read_SPE2R(file, output.object = "matrix")
#temp

##(4) Export raw data to csv, if temp is a RLum.Data.Spectrum object
# write.table(x = get_RLum(temp),
#             file = "[your path and filename]",
#             sep = ";", row.names = FALSE)


Run the code above in your browser using DataLab