read.OceanView.header.Rd
Read header lines with non-spectroscopic information of OceanView (version 1.5.2) file.
read.OceanView.header(
file = NULL,
dec = ".",
n = 17,
software = "OceanView",
version_ = "1.5.2",
software_info = paste(software, version_),
last_headerline_text = ">>>>>Begin Spectral Data<<<<<",
text
)
(string) A name of OcenView file .
("." | ",") The character used in the file for decimal points , e.g.
period ("."
) or comma (","
).
(integer) Number of header lines to be scanned . Default is 17.
These lines include the header line indicated in
last_headerline_text
.
("OceanView" | "OOIBase32") Name of software, that created the file.
("1.5.2" | "1.5.0" | string) A version of OceanView file. Curently supported versions are "1.5.2" (or newer) and "1.5.0".
(string) A combination of software
and its version_
.
(string) A string, that indicates the last header line.
Default is ">>>>>Begin Spectral Data<<<<<"
.
(strings) Text of header as if it was read with function
readLines
. If text
is provided, file
is ignored.
A dataframe with information, extracted from headerlines.
Other spHelper functions for spectroscopy and hyperSpec:
IQR_outliers()
,
binning()
,
file
,
gapDer()
,
hy2mat()
,
hyAdd_Label_wl()
,
hyAdd_Labels_PAP_PD_2014()
,
hyAdd_Labels_TD2009()
,
hyAdd()
,
hyDrop_NA()
,
hyGet_palette()
,
hyRm_palette()
,
mad_outliers()
,
mean_Nsd()
,
median_Nmad()
,
plot_hyPalette()
,
prepare_PAP_RK_2014__MATLAB_failui()
,
read.OOIBase32()
,
read.OceanView()
,
read.sp.csv2()
,
read3csv2hy()
,
replace_spc()
,
sd_outliers()
,
spStat()
,
sp_class_perform()
Other functions to read spectroscopic data:
file
,
read.OOIBase32()
,
read.OceanView()
# Read from file: -------------------------------------------
# \donttest{
if (FALSE) {
read.OceanView.header("MySpectra.txt")
}# }
# Read as text: ---------------------------------------------
header <- c(
"Data from MySpectra.txt Node",
"",
"Date: Fri Jan 15 16:15:16 GMT 2014",
"User: Scientist_1",
"Spectrometer: USB2E2321",
"Trigger mode: 4",
"Integration Time (sec): 1.000000E1",
"Scans to average: 1",
"Electric dark correction enabled: true",
"Nonlinearity correction enabled: true",
"Boxcar width: 0",
"XAxis mode: Wavelengths",
"Number of Pixels in Spectrum: 2048",
">>>>>Begin Spectral Data<<<<<"
)
DF <- read.OceanView.header(text = header)
class(DF)
#> [1] "data.frame"
print(DF)
#> User Spectrometer Date Trigger_mode
#> 1 Scientist_1 USB2E2321 Fri Jan 15 16:15:16 GMT 2014 4
#> Integration_time Integration_time_Units Scans_averaged
#> 1 10 sec 1
#> Electric_dark_correction Nonlinearity_correction Boxcar_width XAxis_mode
#> 1 TRUE TRUE 0 Wavelengths
#> n_pixels_in_spectrum Data_from last_headerline software_info
#> 1 2048 MySpectra.txt 14 OceanView 1.5.2
# Examples of file headerline formats: -----------------------
## An example of header lines in OcenView 1.5.2:
# Data from MySpectra.txt Node
#
# Date: Fri Jan 15 16:15:16 GMT 2014
# User: Scientist_1
# Spectrometer: USB2E2321
# Trigger mode: 4
# Integration Time (sec): 1.000000E1
# Scans to average: 1
# Electric dark correction enabled: true
# Nonlinearity correction enabled: true
# Boxcar width: 0
# XAxis mode: Wavelengths
# Number of Pixels in Spectrum: 2048
# >>>>>Begin Spectral Data<<<<<
## An example of header lines in OcenView 1.5.0:
# Data from MySpectra.txt Node
#
# Date: Fri Jan 15 16:15:16 GMT 2016
# User: Scientist_1
# Spectrometer: USB2E2321
# Autoset integration time: false
# Trigger mode: 4
# Integration Time (sec): 1.000000E1
# Scans to average: 1
# Electric dark correction enabled: true
# Nonlinearity correction enabled: true
# Boxcar width: 0
# XAxis mode: Wavelengths
# Stop averaging: false
# Number of Pixels in Spectrum: 2048
# >>>>>Begin Spectral Data<<<<<