Skip to content

Unexpected behaviour with "colour.colorimetry.reshape_sd" definition #1105

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

You must be logged in to vote

Hi @frankkjensen,

The code tries to preserve as much as possible of the original data, there are some explanations in this issue but let me give you some more details. All the magic happens in the colour.SpectralDistribution.interpolate method.

Given the requested shape is (300, 700, 5), the code finds the minimum and maximum wavelength in the distribution of your spectrum: (397.07, 779.67)

  • There is no data before 397.07, thus the next usable point for interpolation is 398
  • There is no data beyond 779.67, thus the previous usable point for interpolation is 779
  • We can thus safely interpolate between 398 and 779 on integer wavelengths
  • The requested shape is (300, 700, 5) thus the effective …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by frankkjensen
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