
Read '.TXT' File(s) Saved by LI-COR's LI-180 spectroradiometer.
Source:R/read-licor-txt.r
read_li180_txt.Rd
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. IfNULL
, the default, the date is extracted from the file header.- geocode
A data frame with columns
lon
andlat
used to set attribute"where.measured"
.- label
character string, but if
NULL
the value offile
is used, and ifNA
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.
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.
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
.
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
#> Object: source_spct [401 x 2]
#> Wavelength range 380-780 nm, step 1 nm
#> Label: File: LI-180-irradiance.txt
#> Measured on 2021-03-02 09:24:26 UTC
#> Variables:
#> w.length: Wavelength [nm]
#> s.e.irrad: Spectral energy irradiance [W m-2 nm-1]
#> --
#> # A tibble: 401 × 2
#> w.length s.e.irrad
#> <dbl> <dbl>
#> 1 380 0.0275
#> 2 381 0.0280
#> 3 382 0.0285
#> 4 383 0.0287
#> 5 384 0.0289
#> 6 385 0.0298
#> 7 386 0.0306
#> 8 387 0.0311
#> 9 388 0.0318
#> 10 389 0.0326
#> # ℹ 391 more rows
getWhenMeasured(licor180.spct)
#> [1] "2021-03-02 09:24:26 UTC"
getWhatMeasured(licor180.spct)
#> [1] "File: LI-180-irradiance.txt"
cat(comment(licor180.spct))
#> LICOR LI-180 file 'LI-180-irradiance.txt' imported on 2025-03-10 15:48:22.574621 UTC
#> Model Name LI-180
#> Serial Number A18M0157
#> Time 2021/03/02_09:24:26
#> PPFD 129.879440
#> PFD 171.178452
#> PFD-UV 2.336031
#> PFD-B 33.417435
#> PFD-G 46.992531
#> PFD-R 49.469433
#> PFD-FR 38.963074
#> Custom1(655~665nm) 5.057602
#> Custom2(725~735nm) 4.957998
#> Custom3(650~670nm) 10.137251
#> Custom4(720~740nm) 9.965228
#> UV% 1.364676
#> B% 19.521980
#> G% 27.452354
#> R% 28.899324
#> FR% 22.761662
#> Custom1% 2.954579
#> Custom2% 2.896391
#> Custom3% 5.922037
#> Custom4% 5.821544
#> R:B 1.480348
#> R:FR 1.269649
#> R:G 1.052708
#> B:G 0.711122
#> UV:B 0.069905
#> UV:FR 0.059955
#> B:G:R 0.000000
#> B:R:FR 0.000000
#> UV:B:G:R:FR 0.000000
#> Ratio1(Custom1:Custom2) 1.020090
#> Ratio2(Custom3:Custom4) 1.017262
#> Ratio3 0.000000
#> Ratio4 0.000000
#> LambdaP 495.000000
#> LambdaPV 106.211479
#> LambdaD 554.000000
#> LUX 7366.741699
#> IRR 35.163498
#> fc 684.641418
#> I-Time 92.000000