read.txt.Renishaw: import Raman measurements from Renishaw ASCII-files

scan.txt.RenishawR Documentation

import Raman measurements from Renishaw ASCII-files

Description

import Raman measurements from Renishaw (possibly compressed) .txt file.

Usage

scan.txt.Renishaw(...)

scan.zip.Renishaw(...)

read.txt.Renishaw(
  file = stop("file is required"),
  data = "xyspc",
  nlines = 0,
  nspc = NULL
)

read.zip.Renishaw(
  file = stop("filename is required"),
  txt.file = sub("[.]zip", ".txt", basename(file)),
  ...
)

Arguments

...

Arguments for read.txt.Renishaw

file

file name or connection

data

type of file, one of "spc", "xyspc", "zspc", "depth", "ts", see details.

nlines

number of lines to read in each chunk, if 0 or less read whole file at once.

nlines must cover at least one complete spectrum,i.e. nlines must be at least the number of data points per spectrum. Reasonable values start at 1e6.

nspc

number of spectra in the file

txt.file

name of the .txt file in the .zip archive. Defaults to zip file's name with suffix .txt instead of .zip

Details

The file may be of any file type that can be read by gzfile (i.e. text, or zipped by gzip, bzip2, xz or lzma). .zip zipped files need to be read using read.zip.Renishaw.

Renishaw .wxd files are converted to .txt ASCII files by their batch converter. They come in a "long" format with columns (y x | time | z)? wavelength intensity. The first columns depend on the data type.

The corresponding possibilities for the data argument are:

data columns
"spc" wl int single spectrum
"zspc", "depth" z wl int depth profile
"ts" t wl int time series
"xyspc" y x wl int 2d map

This function allows reading very large ASCII files, but it does not work on files with missing values (NAs are allowed).

If the file is so large that it sould be read in chunks and nspc is not given, read.txt.Renishaw tries to guess it by using wc (if installed).

Value

the hyperSpec object

Author(s)

C. Beleites

See Also

read.txt.long, read.txt.wide, scan


hyperSpec documentation built on May 29, 2024, 7:28 a.m.