-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: sd_to_XYZ fail with MultiSpectralDistributions #1280
Comments
Hi @gul916,
Failure on our part to not make that clearer! For what you are trying to achieve here, I would recommend that you either:
XYZ = np.array([colour.sd_to_XYZ(sd, cmfs, ilum_sds) / 100 for sd in colour.SDS_COLOURCHECKERS['babel_average'].values()])
XYZ = colour.sd_to_XYZ(np.transpose(multi_sds.values), cmfs, ilum_sds, method="integration", shape=colour.SpectralShape(380, 730, 10))/100 Cheers, Thomas |
Hi @KelSolaar, |
I will need to dig into the code to understand why it is working. I would not expect it to work but looks like it does indeed. I haven't touched this part of the codebase in a while so maybe it is somehow intentional. I will keep you posted! |
Ok so I took a look, and I understand. Our Integration method is vectorised but we default to the ASTME-308 method and in the specific case of 10nm interval, it goes through the colour.colorimetry.tristimulus_weighting_factors_ASTME2022 definition which is not vectorised. For 5 nm interval it goes through colour.colorimetry.sd_to_XYZ_integration Takeaway:
|
Thank you @KelSolaar for investigating and for your explanation. The first method you proposed with a loop over every single SD was working well. |
This should be fixed in develop. |
I haven't tested the new version but that seems wonderful, many thanks! |
Description
Hello, thank you for this amazing package. It's really powerful and well-documented.
I found a bug when converting a multispectraldistribution to XYZ using 'babel_average' dataset. The expected behavior is obtained when using 'cc_ohta'.
sds = colour.SDS_COLOURCHECKERS['cc_ohta']
Thank you,
gul916
Code for Reproduction
Exception Message
Environment Information
The text was updated successfully, but these errors were encountered: