Reads a gamma ray spectrum file.

read(file, ...)

# S4 method for character
read(file, extensions = c("cnf", "tka"),
  skip = NULL, ...)

Arguments

file

A character string giving the path of files to be imported.

...

Extra parameters passed to read_xyData.

extensions

A character vector specifying the possible file extensions. It must be one or more of "cnf", "tka".

skip

A list of numeric vectors or of logical scalars (re-cycled to the number of files to be imported). If numeric, the corresponding chanels of the data file will be skipped. If TRUE, it will try to automatically process the spectrum: all channels before the first maximum will be skipped. If NULL (the default), all data are imported.

Value

An object of class GammaSpectra.

Note

Only supports Canberra CNF and TKA files.

See also

Examples

# Import a Canberra CNF file cnf_file <- system.file("extdata/test_CNF.cnf", package = "gamma") (cnf_spectrum <- read(cnf_file))
#> Gamma spectrum: #> Reference: test_CNF #> Instrument: InSpector 1000 #> Date: 2019-02-07 11:48:18 #> Number of chanels: 1024 #> Energy range (keV): -7 - 3124.91 #> Dose rate: not known
# Import a TKA file tka_file <- system.file("extdata/test_TKA.tka", package = "gamma") (tka_spectrum <- read(tka_file))
#> Gamma spectrum: #> Reference: test_TKA #> Instrument: unknown #> Date: 2019-06-06 20:06:50 #> Number of chanels: 1024 #> Energy range (keV): not calibrated #> Dose rate: not known
# Import all files in a given directory # Skip the 35 first chanels spc_dir <- system.file("extdata/", package = "gamma") (spc_spectra <- read(spc_dir, skip = 1:35))
#> A collection of 2 gamma spectra: test_CNF, test_TKA