Take readings according to parameters from a list of settings and a protocol defined by a vector of names.
Usage
acq_raw_mspct(
descriptor,
acq.settings,
f.trigger.on = f.trigger.message,
f.trigger.off = NULL,
triggers.enabled = character(),
seq.settings = list(initial.delay = 0, start.boundary = "none", step.delay = 0,
num.steps = 1L),
protocol = c("light", "filter", "dark"),
user.label = "",
where.measured = data.frame(lon = NA_real_, lat = NA_real_),
pause.fun = NULL,
verbose = TRUE,
...
)
Arguments
- descriptor
list as returned by function
get_oo_descriptor()
.- acq.settings
list as returned by functions
tune_acq_settings()
orretune_acq_settings()
oracq_settings()
.- f.trigger.on, f.trigger.off
function Functions to be called immediately before and immediately after a measurement. See
acq_raw_spct
for details.- triggers.enabled
character vector Names of protocol steps during which trigger functions should be called.
- seq.settings
list with members "initial.delay", "step,delay" numeric values in seconds, "num.steps" integer.
- protocol
vector of character strings.
- user.label
character string to set as label.
- where.measured
data.frame with at least columns "lon" and "lat" compatible with value returned by
ggmap::geocode()
.- pause.fun
function used for handling protocol transitions.
- verbose
ogical to enable or disable warnings.
- ...
passed to
pause.fun
(ignored by the default function).
Value
A raw_mspct object. The names and number of member spectra are
determined by protocol
, and the number of columns in each member
spectrum is determined by acq.settings
.
Details
Function acq_raw_mspct
acquires directly from a spectrometer
a collection of spectra. The settings used for the acquisition of each
member spectrum are the same, and are given by the argument passed to
acq.settings
. The number of numbers and their names are given by the
argument passed to protocol
.
Two types of light sources can be measured, for continuous-emission light
sources, the integration time can at later steps used to compute irradiance.
In the case of flashes, the duration of the exposure is unknown and
irradiance cannot be computed, while spectral energy per flash can be
computed if the number of flashes is known. The argument to
num.exposures
must be set to the number of flashes.
Two parameters accept functions as arguments, and default to functions that
request the operator to trigger the flash or change the light conditions
according to the names of the steps in the argument to protocol
.
Sequences of light measurements using single "dark" and "filter"
measurements are scheduled by setting the four members of the named list
passed as argument to seq.settings
. The member initial.delay
is numeric and gives a minimum delay in seconds before the start of
measurements with a default of 0s. Member step.delay
is numeric and
gives the delay in seconds between successive "light" measurements. In
most cases a vector of length one is used as time delta in seconds. Any
vector shorter than the number of steps will be extended with
rep_len()
, and the values interpreted as the time increment
in seconds between the start of successive measurements. If the length is
the same as "num.steps", and the values are monotonically increasing, they
are interpreted as time offsets from the start of the sequence. Member
start.boundary
can take one of "none", "second", "minute" or "hour"
indicating the unit to which the start of the series should be scheduled,
e.g. the next minute and 0s, for "minute". Member num.steps
must
be an integer between 1 and small thousands indicating the number of time
steps in the series.
Note
Obviously the duration of the time steps must be longer than the time that a measurement takes. This time can be significantly more than the sum of integration times, as there is considerable overhead in both the OmniDriver Java code, in USB communication, in the spectrometer itself and in R. The overhead depends strongly on the model of spectrometer.
No multitasking is used or supported, so R waits for the spectrometer to answer. The operating system and other programs are not blocked, but the current R instance is.
See also
acq_raw_spct
which is used to acquire each member
spectrum. Computations on date times are done with
lubridate
.
Other raw-counts-spectra acquisition functions:
acq_raw_spct()
,
hs_acq_raw_mspct()