Why do "colour.plotting.plot_sds_in_chromaticity_diagram_*" definitions produce unexpected chromaticity coordinates? #811
-
I have been using the library to plot chromaticity diagrams for about a year and know just enough to get myself in trouble. Typically I collect data from a spectroradiometer which I plot and I have not noticed any issues but today I loaded a new version of the library and now the points appear to be shifted on the CIE1931 and CIE1976 diagrams from what I measure and from what I calculate. I put together the following to show my problem. Unfortunately, I am not sure of my previous version so I am having a hard time finding anything in the changelog that indicates what may have happened. The "x" markers in the diagrams are what I believe are the correct positions while the circles are the points generated internal to the function. Note the example uses some internally created distributions but I first noticed the problem with measured data.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ChrisABailey, This is a great question and it is pertaining to a change made to improve consistency across the plotting definitions made last year. The cause for the shift is that previously, the illuminant used for plotting (and that could not be changed) was CIE E. It is fine and actually what you want when you plot radiation sources but it is causing issues when you plot reflectance or transmittance spectra. With that in mind, and for consistency with the other plotting definitions, I made D65 the default illuminant used for those definitions: colour/colour/plotting/diagrams.py Line 744 in d634b29 If you change your code to: fig, c31ax = colour.plotting.plot_sds_in_chromaticity_diagram_CIE1931(spectrums, standalone=False, axes=ax1, plot_kwargs={'illuminant': colour.sd_ones()})
fig, c76ax = colour.plotting.plot_sds_in_chromaticity_diagram_CIE1976UCS(spectrums, standalone=False, axes=ax2, plot_kwargs={'illuminant': colour.sd_ones()}) It should work: https://colab.research.google.com/drive/1F8bUn4xEF6nzta2HlF-mkgIhg1wx4Foy?usp=sharing Cheers, Thomas |
Beta Was this translation helpful? Give feedback.
Hi @ChrisABailey,
This is a great question and it is pertaining to a change made to improve consistency across the plotting definitions made last year.
The cause for the shift is that previously, the illuminant used for plotting (and that could not be changed) was CIE E. It is fine and actually what you want when you plot radiation sources but it is causing issues when you plot reflectance or transmittance spectra. With that in mind, and for consistency with the other plotting definitions, I made D65 the default illuminant used for those definitions:
colour/colour/plotting/diagrams.py
Line 744 in d634b29
If you change your code to: