aphalo / ooacquire

Acquire spectral data and control array spectrometers from Ocean Optics from within R
https://docs.r4photobiology.info/ooacquire
0 stars 0 forks source link

Performance bottleneck due to slit correction #15

Closed aphalo closed 6 months ago

aphalo commented 6 months ago

To my surprise, after other improvements in performance, the performance bottleneck in function s_irrad_corrected() is in the call to the C++-coded function for the tail correction of the slit function. Improving this has low priority as the processing time is around 26 ms per spectrum.

aphalo commented 6 months ago

The bottleneck was caused by the use of an unnecessarily wide moving window for the computation. Reducing it to about 20 nm from 150 nm, decreased the processing time from 26 ms to about 8 ms per spectrum. Further reduction of the window size may be tolerable, but could make it necessary to recompute the calibration coefficients.