Skip to contents

Take one spectral measurement which depending on the settings can consist in multiple raw spectra meant to represent a SINGLE observation after conversion into calibrated data, such as in the case of bracketing of integration time for HDR.

Usage

acq_raw_spct(
  descriptor,
  acq.settings,
  f.trigger.on = f.trigger.message,
  f.trigger.off = NULL,
  what.measured = NA,
  where.measured = data.frame(lon = NA_real_, lat = NA_real_),
  set.all = TRUE,
  verbose = TRUE
)

Arguments

descriptor

list as returned by function get_oo_descriptor.

acq.settings

list as returned by functions tune_acq_settings.

f.trigger.on, f.trigger.off

function Functions to be called immediately before and immediately after a measurement.

what.measured

value used to set attribute.

where.measured

data.frame with at least columns "lon" and "lat" compatible with value returned by ggmap::geocode().

set.all

logical resend or not all instrument settings.

verbose

logical to enable or disable warnings.

Value

A raw_spct object with one column w.length and one column counts, or two or more columns counts1, counts2, ... containing raw counts data. The number of columns with raw counts is determined by acq.settings, with multiple columns in the case of integration time bracketing or HDR.

Details

This function acquires one raw-detector-counts spectrum from a spectrometer, using the descriptor to connect to the spectrum and retrieve the valid range for settings. The settings in acq.settings are first sent to the spectrometer and the values retrieved in case the spectrometer has overridden the requested settings. Subsequently a spectrum, possibly obtained by averaging multiple spectra in the spectrometer is acquired, and the spectrometer queried on whether data are valid or not.

Function acq_raw_spct() can optionally call two functions, one at the start of the measurement and another one after it ends. f.trigger.on() can be used for example when measuring the output from a xenon flash lamp, to trigger a given number of light flashes. In other cases f.trigger.on() and f.trigger.off() can be used together to start and end a concurrent measurement or any other action using a relay controlled by code in a function defined by the user.

The functions passed as arguments to f.trigger.on() and f.trigger.off() should return very quickly when called, so as not to disturb the timing of the measurements of spectra as these start only after f.trigger.on() returns to the caller.

The first formal parameter of f.trigger.on() should handle as input an integer value indicating the number of events to trigger and a second argument giving the delay in seconds between pulses. Of course the arguments can be ignored if not needed, but should accepted. f.trigger.off() currently expects no arguments. Example scripts are provided for YoctoPuce USB modules.

The default function, displays a message asking the user to manually trigger the flash a number of times that depends on the settings in acq.settings.

See also

acq_raw_mspct which can be used to acquire multiple spectra according to a user defined protocol.

Other raw-counts-spectra acquisition functions: acq_raw_mspct(), hs_acq_raw_mspct()