read.OceanView.header: [!] Read header lines of OceanView file

View source: R/read.OceanView.header.R

read.OceanView.headerR Documentation

[!] Read header lines of OceanView file

Description

Read header lines with non-spectroscopic information of OceanView (version 1.5.2) file.

Usage

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
)

Arguments

file

(string) A name of OcenView file .

dec

("." | ",") The character used in the file for decimal points , e.g. period (".") or comma (",").

n

(integer) Number of header lines to be scanned . Default is 17. These lines include the header line indicated in last_headerline_text.

software

("OceanView" | "OOIBase32") Name of software, that created the file.

version_

("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".

software_info

(string) A combination of software and its version_.

last_headerline_text

(string) A string, that indicates the last header line. Default is ">>>>>Begin Spectral Data<<<<<".

text

(strings) Text of header as if it was read with function readLines. If text is provided, file is ignored.

Value

A dataframe with information, extracted from headerlines.

Author(s)

Vilmantas Gegzna

See Also

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()

Examples


# Read from file: -------------------------------------------


## Not run: 
 read.OceanView.header("MySpectra.txt")

## End(Not run)

# 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)
print(DF)


# 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<<<<<


GegznaV/spHelper documentation built on April 16, 2023, 1:42 p.m.