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

A more elegant way of handling molar cross sections vs absorption spectra is needed #4

Open aphalo opened 3 years ago

aphalo commented 3 years ago

Using filter_spct objects to store spectral molar cross sections is clumsy unless we add a way to store this information in an attribute. This is likely to be enough. Creating a class derived from filter_spct could also work as it would inherit most of the functionality. In either case this seems a rather major undertaking as it may break old code. NEEDS TO BE DONE BEFORE FIRST COMPLETE DRAFT OF THE BOOK.

aphalo commented 3 years ago

IUPAC recommends use of "molar attenuation" instead of molar cross section. SI unit is m2/mol.

aphalo commented 2 years ago

After a false start, best option seems to be to define a new class attenuation_spct to store attenuation coefficientes (initially with support for mole based expression but later possibly adding support for mass-based coefficients).

aphalo commented 2 years ago

This is now implemented for the most part. For consistency with the names used for other classes, I named the new class solute_spct. Objects of this class have an attribute called solute.properties containing the metadata about the solute such as molecular weight, name and formula. The update should not break any existing code. As of 21 May 2022 some additional testing is needed as well as some additional edits to the vignettes before release.

aphalo commented 2 years ago

This preliminary implementation was submitted today to CRAN as version 0.10.11 of 'photobiology'. It will still take several months before methods are implemented and well tested. This preliminary implementation will make it possible to start implementing the support of these classes in package 'ggspectra' and transferring some of the data in 'photobiologyPlants' to objects of these classes.

aphalo commented 9 months ago

I have been too busy to make progress with this, but hopefully I will be able to add unit tests and additional methods for the release of version 0.11.2