The versions of the packages uploaded yesterday have several enhancements, and a few backwards incompatibilities (hopefully only in functions mostly used internally). The new versions are not yet optimized for speed, so for performance-critical code, stick for a while with earlier versions. The changes are many, and I hope give a more intuitive user interface. The new, more transparent way of doing calculations has a toll on performance. Consequently the “old” functions remain available for use in speed-critical code and for backwards compatibility. Some additional changes are planned for coming weeks.
The main improvement is the use of object-oriented programming. Now spectra are “S3” objects. This allows the definition specific versions of generic functions (e.g. print, range, etc.) and operators (e.g. +, -, *, /) for spectra. These are already working for spectral irradiance and spectral transmittance, but may still have some hidden bugs. Data for many additional filters has been added.
Most other packages, except those related to photoreceptors, have been also updated.
Please, report any problems and/or oddities to me.
This a major update with important new functionality added, but should still be backwards compatible with old code.
w_length2rgb() calculation of equivalent RGB values for monochromatic light.
s.e.irrad2rgb() calculation of equivalent RGB values from spectral (energy) irradiance.
For both functions, the chromaticity coordinates data defaults to the proposed CIE 2006 standard (2 degrees), but others can be used.
The package now includes these data as chromaticity coordinates (CC) and colour matching functions (CMF), for both 2 degrees and 10 degrees.
min(), max(), range(), mean(), center_wl(), color() and labels() have now versions for wavebands. The values returned by color() and labels() are likely to change, the hue and luminance and text, respectively will change for certain in the next version as I am not totally happy with this first version.
The vignette User Guide was expanded to include several examples of the use of the new functions. The main use of most of these functions is in plot annotation, but may be also useful when information about wavebands needs to accessed.
I just uploaded source and binaries to the repository. Please, check the User Guide for more information and report back to me with any problems or suggestions.