Skip to content

"colour.SpectralDistribution.align" method with non-uniform shapes? #728

Answered by KelSolaar
briend asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @briend,

There is no direct way to do that indeed. You could however manually extract the values as follows:

from colour import SpectralDistribution, ILLUMINANTS_SDS

data = {
    467: 0.0,
    495: 0.0,
    532: 0.0,
    570: 0.0,
    580: 0.0,
    590: 0.0,
    630: 0.0
}
sd = SpectralDistribution(data)

illuminant = SpectralDistribution(ILLUMINANTS_SDS['D65'][sd.wavelengths], sd.wavelengths)

print(illuminant)

[[ 467.      115.746 ]
 [ 495.      109.082 ]
 [ 532.      107.0322]
 [ 570.       96.3342]
 [ 580.       95.788 ]
 [ 590.       88.6856]
 [ 630.       83.2886]]

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by KelSolaar
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #493 on January 16, 2021 22:51.