Skip to content

How to initialise a colour.MultiSpectralDistributions class instance with millions of spectra? #1293

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

You must be logged in to vote

Hello,

This is not a defect and we probably ought to update the documentation in that regard but you should not be using colour.MultiSpectralDistributions in that instance but a numpy.NDArray instead.

Under the hood, colour.MultiSpectralDistributions uses instances of colour.SpectralDistribution which in turn is derived from colour.continuous.Signal class which is an interpolator so that one can sample the spectrum at any arbitrary point. This offers a lot of flexibility for many things but it is, given the above, going to be heavy when using thousands or more spectra because of initialisation time and memory cost.

In the situation where you are, an array is required and you will find out…

Replies: 1 comment

Comment options

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

This discussion was converted from issue #1292 on September 12, 2024 07:04.