ir_import_spc imports raw infrared spectra from a Thermo Galactic's
.spc file or several of such files. ir_import_spc is a wrapper
function to hyperSpec::read.spc().
ir_import_spc(filenames, log.txt = TRUE)An object of class ir containing the
infrared spectra extracted from the .spc file(s) and the metadata as
extracted by hyperSpec::read.spc(). Metadata variables are:
An integer value representing the number of scans.
The detection gain factor.
The scan speed [kHz].
The wavenumber of the laser.
The name of the detector.
The name of the infrared radiation source.
The duration of purge delay before a measurement [s].
A numeric value representing the zero filling factor.
The name of the apodisation function.
The exponentiation factor used for file compression.
The number of data points in the spectrum
The type of the x variable.
The type of the y variable.
A POSIXct representing the measurement date and time.
The name of the measurement device.
A character vector representing the complete paths to
the .spc files to import.
A logical value indicating whether to import metadata (TRUE)
or not (FALSE). See the details section. If set to FALSE, only the
metadata variables exponentiation_factor to measurement_device listed in
the Value section below are included in the ir object.
Currently, log.txt must be set to FALSE due to a bug in
hyperSpec::read.spc(). This bug fill be fixed in the upcoming weeks and
currently can be circumvented by using the development version of 'hyperSpec'.
See https://github.com/r-hyperspec/hyperSpec/issues/80.
# import a sample .spc file
x <-
ir::ir_import_spc(
system.file("extdata/1.spc", package = "ir"),
log.txt = FALSE
)
Run the code above in your browser using DataLab