aphalo / photobiology

Package ‘photobiology’ defines a system of classes for storing spectral data and accompanying methods and operators. This is the core of a suite of R packages for photobiological calculations.
4 stars 1 forks source link

Fully support `_spct` objects containing multiple spectra in long form #23

Open aphalo opened 10 months ago

aphalo commented 10 months ago

Functions like normalise(), fscale(), etc., should as a minimum convert the _spct object containing multiple spectra into an _mspct collection, apply the exisitng methods, and reconstruct the _spct object. This approach is slow but easy to implement ensuring consistent returned values. In the long run, in-place computations to avoid copying of objects could be implemented.

aphalo commented 10 months ago

New support implemented in normalise() and fscale(); support in despike() and spikes() was already implemented but had a fatal bug and would, in addition, return an _mspct() object instead of a _spct object, and is now fixed. Documentation revised.

The existing support in trim_wl() and clip_wl() was updated.

aphalo commented 10 months ago

Support in peaks(), valleys() and wls_at_target() were already implemented but the returned value was a collection instead of spectra in long form, i.e., inconsistent with the input. One of the especializations had a fatal bug, and is now fixed. New support was added to the smooth_spct() methods.

aphalo commented 9 months ago

Pushing the addition of these unit tests to the next milestone. I need to check what tests really need to be added, not many as the newly supported operations simply call the same functions by recursion and iteration, and these operations have their own unit tests already.