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

`TfrType` assumptions and conversions #21

Open aphalo opened 10 months ago

aphalo commented 10 months ago

Was: T2A() and normalise() errors and missing Afr2A() method.

T2A() seems to not work correctly when Tfr == 0 and Rfr != 0. The problem could be caused by a wrongly set TfrType attribute in the data I was using, or could be an error in the computations. In the first case a validity test would be missing and in the second case, a plain bug.

The missing Afr2A() would have been useful for testing and diagnosing the problem, and adding it should be the first step.

aphalo commented 6 months ago

I found one cause of spurious normalization-warning messages due to an optimization used mainly in 'ggspectra'. It is now fixed. Also added support for collections of spectra to normalization-related functions. Afr2A() remains to be implemented. Testing is not yet done. I need to check that the bug raised in this issue is actually fixed and add a unit test.

aphalo commented 6 months ago

Main problem seems to be the poorly documented and possibly inconsistently implemented assumption that A and Afr are always defined as "internal" irrespective of the TfrType setting of the filter_spct object.

aphalo commented 6 months ago

This is for the most part done. As there are some pending taks, I push the Milestone to the next one 0.11.2.