Skip to contents

Find member names matching the different stages of a measurement protocol.

Usage

find_spct_names(
  x,
  qty = "s.irrad",
  verbose = getOption("photobiology.verbose", default = FALSE)
)

Arguments

x

raw_spct or list object with named members.

qty

character The physical quantity whose calculation the spectra in x are intended for. Currently only "s.irrad" is supported.

verbose

logical If TRUE issue informative messages.

Value

A named list of character vectors containing member names for each stage of a measurement protocol.

Details

When qty = "irrad" is passed in the call, search for members of x with names containing each of the character strings "dark", "filter", and "light", returning them in a list of character vectors with members named "dark", "filter", and "light". In case of no matching names in x the corresponding member of the returned list is missing. Thus, when no matches are found for any of the three strings, the object returned is list(), the empty list.

When data have been acquired with `acq_irrad_interactive()` both single and time series measurements and all default protocols are supported when using default measurement protocols or if user created protocols use names that contain suitable matched strings embedded.

When data are imported with `read_files2mspct()` the names are always set by the user, and for this function to work correctly, the names used must contain suitable matched strings embedded.

When x contains members named not following the convention expected by find_spct_names(), a mapping of member names to protocol steps can be created using a different approach, either manually or in user written code.

See also

Function find_spct_names() is used to set the default argument for formal parameter spct.names in s_irrad_corrected() and s_irrad_update().

Examples

find_spct_names(x = white_grow_LED.raw_mspct)
#> $dark
#> [1] "dark"
#> 
#> $light
#> [1] "light"
#> 
find_spct_names(x = white_grow_LED.raw_mspct, verbose = TRUE)
#> Found data for protocol: "dark, light" with 1 "light" spectrum.
#> $dark
#> [1] "dark"
#> 
#> $light
#> [1] "light"
#> 
find_spct_names(x = sun001.raw_mspct, verbose = TRUE)
#> Found data for protocol: "dark, filter, light" with 1 "light" spectrum.
#> $dark
#> [1] "dark"
#> 
#> $filter
#> [1] "filter"
#> 
#> $light
#> [1] "light"
#>