read_li180_txt: Read '.TXT' File(s) Saved by LI-COR's LI-180...

View source: R/read-licor-txt.r

read_li180_txtR Documentation

Read '.TXT' File(s) Saved by LI-COR's LI-180 spectroradiometer.

Description

Reads and parses the header of a data file as output by the LI-180 spectrometer (not to be confused with the LI-1800 spectrometer released in the 1980's by LI-COR) to extract the whole header remark field and also decode whether data is in photon or energy based units. This is a new instrument released in year 2020.

Usage

read_li180_txt(
  file,
  date = NULL,
  geocode = NULL,
  label = NULL,
  tz = NULL,
  locale = readr::default_locale(),
  s.qty = "s.e.irrad"
)

read_m_li180_txt(
  files,
  date = NULL,
  geocode = NULL,
  label = NULL,
  tz = Sys.timezone(),
  locale = readr::default_locale(),
  s.qty = NULL
)

Arguments

file

Path to file as a character string.

date

a POSIXct object to use to set the "when.measured" attribute. If NULL, the default, the date is extracted from the file header.

geocode

A data frame with columns lon and lat used to set attribute "where.measured".

label

character string, but if NULL the value of file is used, and if NA the "what.measured" attribute is not set.

tz

character Time zone used for interpreting times saved in the file header.

locale

The locale controls defaults that vary from place to place. The default locale is US-centric (like R), but you can use locale to create your own locale that controls things like the default time zone, encoding, decimal mark, big mark, and day/month names.

s.qty

character The name of the spectral quantity to be read. One of "s.e.irrad" or "s.q.irrad".

files

A list or vector of character strings.

Details

Function read_m_licor_espd() calls red_licor_espd() for each file in files. See read.table for a description of valid arguments for files.

Value

read_licor_espd() returns a source_spct object with time.unit attribute set to "second" and when.measured attribute set to the date-time extracted from the file header, or supplied by the user. Spectrometer model, serial number and integration time are stored in attributes. The whole file header is saved as a comment while the footer is discarded.

Function read_m_licor_espd() returns a source_mspct object containing one spectrum per file read.

Note

The LI-180 spectroradiometer stores little information of the instrument and settings, possibly because they cannot be altered by the user or configured. The length of the file header does not seem to be fixed, so the start of the spectral data is detected by searching for "380nm".

References

LI-COR Biosciences, Environmental. https://www.licor.com/env/

Examples


  file.name <- 
    system.file("extdata", "LI-180-irradiance.txt", 
                package = "photobiologyInOut", mustWork = TRUE)
                
  licor180.spct <- read_li180_txt(file = file.name)
  
  licor180.spct
  getWhenMeasured(licor180.spct)
  getWhatMeasured(licor180.spct)
  cat(comment(licor180.spct))
  

photobiologyInOut documentation built on Sept. 14, 2024, 5:06 p.m.