ooacquire 0.4.x

ooacquire: Acquire Data from OO Spectrometers

R Package Update
Author

Pedro J. Aphalo

Published

2023-06-10

Modified

2024-02-26

Keywords

ooacquire pkg

Note

I will update this same post in the case of minor version updates, and start a new post when the first version in the 0.5.x series is developed. Differences between versions are listed in detail in the NEWS file. Installation instructions are given in the README file.

Overview of changes

Version 0.4.5 Update the tail correction functions to use a narrower moving window (20 nm instead of 150 nm), with very little impact on the returned values and a 70% reduction in execution time. By default, “trim” calibration-related metadata attributes in the objects containing the computed spectral irradiance.

Versions 0.4.3 and 0.4.4 Implement repeated measurements of spectral irradiance and spectral fluence, including repeated time series. Adjust the UI to support the new features, improve consistency and shorten the text lines to make it easier to use with small screens. Show more of the current settings. Optimize performance and test thoroughly. Implement asynchronous file saving using package ‘mirai’. Profile and optimise code in ‘ooacquire’ and imported functions from ‘photobiology’. Test the acquisition of time series of up to 10000 spectra at high speed and their conversion from raw-counts to spectral irradiance.

Improve the documentation, by including two vignettes only in the on-line documentation. This makes it easier to add diagrams and flowcharts. The algorithms are described in more detail than before in article ‘ooacquire’: Spectral Irradiance Algorithms and the tutorial ‘ooacquire’: Spectral Irradiance Measurement about acquisition of spectral irradiance and spectral fluence, describing the UI in detail and the differences among interface modes of function acq_irrad_interactive().

Version 0.4.2 Tracks a change in ‘photobiology’ (>= 0.11.0), and depends on these newer version. The vignette is also updated to work correctly with ‘ggspectra’ (>= 0.3.12).

Versions 0.4.0 and 0.4.1 have full support for acquisition of time series of spectra. Version 0.4.1 adds checks for two conditions that are frequent when acquiring time series of spectra: 1) increased dark counts in only a part of the detector array, and 2) changes in irradiance between successive exposures when using integration time bracketing for HDR (high dynamic range) measurements. In the case of 1) all that is possible is to issue a warning, set an attribute to mark the spectrum as failing the quality control and expect the operator to solve the overheating problem. In the case of 2) merging of spectra taken with different integration times is skipped if they are not consistent and a message is emitted. This ensures that spectra with distorted shape can be avoided at the cost of a decrease in dynamic range in those cases that HDR cannot be validly applied.

The logic of the current user interface modes in described in detail in a tutorial. The most important new feature is the automatic acquisition of time series of spectra.

Time series of spectra

Three approaches to the acquisition of time series of spectra are supported: a) buffered, which is the fastest, as spectra are retrieved by the driver to a memory buffer, so that measurements take place non-stop, with the previous spectrum being transferred to the computer while the current one is being acquired. It is used when the step delay is set to 0 s and no HDR bracketing is used, i.e., no settings need to be modified in the spectrometer while acquiring the whole time series. b) fast, minimizes the delay with HDR bracketing. It is slower than buffered as acquisition of spectra stops and restarts when settings are modified, and because spectra are retrieved directly by R without buffering. fast acquisition is enabled when step delay is 0 s but HDR bracketing is in use. c) timed, the user sets the time interval at which the successive spectra will be acquired. This approach is enabled whenever the step delay is more than zero, with the caveat that an estimate of the time taken by individual measurements will be computed and this estimate used to limit the shortest accepted setting for step delay. If the step delay is deemed too short, it will be changed to zero and spectra acquired using either the fast or the buffered approach, or to the step delay set to the estimated duration.

Before using the new "series" mode for acquiring spectra at a rate faster than about once per minute, please read the ‘ooacquire’ vignette that describes acquisition of spectra. This is crucial as timing considerations are far from straightforward because of how spectrometers work.

Plans for the near future

If spectrometers are maintained at constant temperature, measurement of long time series spanning even multiple days is possible. For this type of measurements, regular timed saving to disk of time-series-data chunks becomes necessary for reliability.

Note

Documentation web site includes all help pages, with output from all examples and vignettes in HTML format .

Please raise issues concerning bugs or enhancements to this package through GitHub at https://github.com/aphalo/ooacquire/issues. Pull requests are also welcome.