Learn R Programming

hyperSpec (version 0.98-20120713)

read.spc.KaiserMap: read.spc.KaiserMap imports sets of .spc files of Raman maps written by Kaiser Optical Systems' Hologram software. It may also serve as an example how to write wrapper functions for read.spc to conveniently import specialized sets of .spc files.

Description

read.spc.KaiserMap imports sets of .spc files of Raman maps written by Kaiser Optical Systems' Hologram software. It may also serve as an example how to write wrapper functions for read.spc to conveniently import specialized sets of .spc files.

Import for Thermo Galactic's spc file format These functions allow to import .spc files. A detailed description of the .spc file format is available at https://ftirsearch.com/features/converters/SPCFileFormat.htm.

Usage

read.spc.KaiserMap(files, keys.hdr2data = FALSE,
    keys.hdr2log = TRUE, keys.log2data = NULL,
    keys.log2log = TRUE, glob = TRUE, ...)

read.spc(filename, keys.hdr2data = c("fexper", "fres", "fsource"), keys.hdr2log = c("fdate", "fpeakpt"), keys.log2data = FALSE, keys.log2log = TRUE, log.txt = TRUE, log.bin = FALSE, log.disk = FALSE, hdr = list(), no.object = FALSE)

Arguments

glob
If TRUE the filename is interpreted as a wildcard containing file name pattern and expanded to all matching file names.
...
All further arguments to read.spc.KaiserMap are handed over directly to read.spc.
filename
The complete file name of the .spc file.
files
If glob = TRUE, filename can contain wildcards. Thus all files matching the name pattern in filename can be specified.
keys.hdr2data,keys.hdr2log,keys.log2data,keys.log2log
character vectors with the names of parameters in the .spc file's log block (log2xxx) or header (hdr2xxx) that should go into the extra data (yyy2data) or into the long.description field of the returned hyperSpec object's log (yyy2l
log.txt
Should the text part of the .spc file's log block be read?
log.bin,log.disk
Should the normal and on-disk binary parts of the .spc file's log block be read? If so, they will be put as raw vectors into the hyperSpec object's log.
hdr
A list with fileheader fields that overwrite the settings of actual file's header.

Use with care, and look into the source code for detailed insight on the elements of this list.

no.object
If TRUE, a list with wavelengths, spectra, labels, log and data are returned instead of a hyperSpec object.

This parameter will likely be subject to change in future - use with care.

Value

  • If the file contains multiple spectra with individual wavelength axes, read.spc returns a list of hyperSpec objects. Otherwise the result is a hyperSpec object.

    read.spc.KaiserMap returns a hyperSpec object with data columns x, y, and z containing the stage position as recorded in the .spc files' log.

References

Source development kit and file format specification of .spc files: https://ftirsearch.com/features/converters/SPCFileFormat.htm.

See Also

textio

Examples

Run this code
## get the sample .spc files from ftirsearch.com (see above)
# single spectrum
spc <- read.spc ("BENZENE.SPC")
plot (spc)

# multi-spectra .spc file with common wavelength axis
spc <- read.spc ('IG_MULTI.SPC')
spc

# multi-spectra .spc file with individual wavelength axes
spc <- read.spc ("BARBITUATES.SPC")
plot (spc [[1]], lines.args = list (type = "h"))

Run the code above in your browser using DataLab