Closed aphalo closed 1 year ago
Once this is implemented, there will be a guarantee that normalization multipliers are always valid. Possibly, we will need to label new spct objects as of version 3 to easily check this. A couple of versions later, we could implement the reversion of normalization. But, would this be of any use? Possibly not. This needs to be thought out as rounding errors could make reverted data different from the original.
setNormalized()
needs to be updated, adding a warning, as setting only a logical without the normalization data makes tests fail in multiple places, especially in 'ggspectra'.
This is now implemented. One could in principle undo the previous normalization before a new normalization so that the new scale factors would be expressed relative to the original data in physical units. This is possible only for objects created with recent versions of 'photobiology'. The reversion of normalization can be implemented as an internal function and called before applying a new normalization. This is needed only when the variable or quantity to be renormalized is not linearly related to the one already normalized. When changing the normalization criterion without changing the data column, the current implementation adjusts the norm.factors to remain valid, otherwise they are set to NA.
The improved approach implemented in v0.10.15 in e2q() and q2e() needs to be implements also in Afr2T, A2T, etc., any2T, etc.