Extend metamerism index with spectral correction. #1382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends previous metamerism implementation (#1374) with spectral correction. One day late for 0.47 release 😵
To achieve this, we need to compute a matrix that contains all integration weights when integrating sd to XYZ. As we are already doing this in function sd_to_XYZ_integration, I was able to extract the relevant part into a new helper function which sd_to_XYZ_integration is now using (same math but slightly different formulation, see image).
(for notation, e.g. R x S means element-wise multiplication, NOT dot product / matrix multiplication)
Preflight
Code Style and Quality
colour,colour.models.Following tests failed
TOTAL 44443 9955 78%
============================= slowest 5 durations =============================
22.91s call colour/recovery/tests/test_jakob2019.py::TestLUT3D_Jakob2019::test_size
16.24s call colour/notation/tests/test_munsell.py::TestxyY_to_munsell_specification::test_xyY_to_munsell_specification
6.78s call colour/utilities/tests/test_network.py::TestParallelForMultiProcess::test_ParallelForMultiProcess
6.66s call colour/io/luts/lut.py::colour.io.luts.lut.LUT3D.invert
6.33s call colour/volume/tests/test_rgb.py::TestRGB_colourspaceVisibleSpectrumCoverageMonteCarlo::test_RGB_colourspace_visible_spectrum_coverage_MonteCarlo
=========================== short test summary info ===========================
FAILED colour/io/image.py::colour.io.image.read_image_Imageio
FAILED colour/io/tests/test_image.py::TestWriteImageImageio::test_write_image_Imageio_exr
FAILED colour/io/tests/test_image.py::TestReadImageImageio::test_read_image_Imageio
========== 3 failed, 3683 passed, 17 skipped, 225 warnings in 44.77s ==========
Documentation