View source: R/read-ooov-file.r
| read_oo_ovirrad | R Documentation |
Reads the spectral data and in addition parses the header of a energy irradiance data file as output by OceanView. OceanView is a program from Ocean Optics used to measure UV, visible and NIR radiation with array spectrometers from the same company. OceanView replaces the no longer supported SpectraSuite program.
read_oo_ovirrad(
file,
date = NULL,
geocode = NULL,
label = NULL,
tz = NULL,
locale = readr::default_locale(),
range = NULL
)
file |
character string Path to the file to be read, following R's use of forward slashes as separator for folder names. |
date |
a |
geocode |
A data frame with columns |
label |
character string to which to set the |
tz |
character A time zone recognized by R. If |
locale |
The locale controls defaults that vary from place to place.
The default locale is US-centric (like R), but you can use
|
range |
a numeric vector of length two, or any other object for which
function |
The header of the file is first decoded and parsed to extract the
time of data acquisition and serial number of the spectrometer, and to
locate the start of the spectral data. The fields are located by name.
The spectral irradiance is re-expressed in W m^{-2} nm^{-1} and
returned as an object of class source_spct
with metadata stored in attributes when.measured,
what.measured, and how.measured set to values extracted from
the header. The value stored in the how.measured attribute includes
the User: and Serial Number: values extracted from the file header.
If an argument is passed to parameter geocode, its value is
saved in attribute where.measured. The file header in whole
is copied to attribute file.header. The object's comment
always gives a text that includes the file name, time of import, function
name and the version of packages 'photobiology' and 'photobiologyInOut'
used.
A source_spct object with columns w.length with
wavelengths in nanometres and s.e.irrad with spectral energy
irradiance in W m^{-2} nm^{-1}, attributes comment,
what.measured, when.measured, how.measured,
where.measured and file.header containing metadata for
the spectrum.
# energy spectral irradiance file
file.name <-
system.file("extdata", "spectrum.OVIrrad",
package = "photobiologyInOut", mustWork = TRUE)
ooov.spct <-
read_oo_ovirrad(file = file.name,
locale = readr::locale("en",
decimal_mark = ",",
grouping_mark = "",
tz = "Europe/Warsaw"))
ooov.spct
getWhenMeasured(ooov.spct)
getWhatMeasured(ooov.spct)
getHowMeasured(ooov.spct)
cat(comment(ooov.spct))
ooov_clipped.spct <-
read_oo_ovirrad(file = file.name,
locale = readr::locale("en",
decimal_mark = ",",
grouping_mark = "",
tz = "Europe/Warsaw"),
range = c(280, NA))
ooov_clipped.spct
getWhenMeasured(ooov_clipped.spct)
getWhatMeasured(ooov_clipped.spct)
getHowMeasured(ooov_clipped.spct)
cat(comment(ooov_clipped.spct))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.