A question about "Tristimulus Values Conversion" #721
-
I have a spectral data with different interval. How could I converse the data into XYZ value? the data is
I tried use spd_to_XYZ() function, the error occured.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hello Edwards,
In order to convert spd into XYZ, you need to specify the CMF (Color Matching Functions) and the illuminant. See code example attached.
FYI: This code if part of the many examples provided as part of the library, you should explore them.
Best,
JD
JD Vandenberg
… On Jan 3, 2019, at 7:31 AM, Edward Amons ***@***.***> wrote:
I have a spectral data with different interval. How could I converse the data into XYZ value?
the data is
{378.399994: 752.0,
380.700012: 800.0,
382.899994: 700.0,
385.200012: 660.0,
387.5: 600.0,
389.700012: 752.0,
392.0: 708.0,
394.299988: 1080.0,
396.5: 812.0,
398.799988: 916.0,
401.100006: 680.0,
403.399994: 568.0,
405.600006: 516.0,
407.899994: 820.0,
410.200012: 992.0,
412.5: 336.0,
414.799988: 300.0,
417.100006: 516.0,
419.299988: 332.0,
421.600006: 636.0,
423.899994: 376.0,
426.200012: 604.0,
.... # It's too long, so I didn't put all of it here
973.099976: 864.0,
975.799988: 408.0,
978.400024: 396.0,
981.099976: 620.0,
983.700012: 604.0,
986.299988: 612.0,
989.0: 236.0,
991.599976: 656.0,
994.299988: 536.0,
996.900024: 748.0,
999.599976: 868.0,
1002.200012: 496.0}
I tried use spd_to_XYZ() function, the error occured.
ValueError: Tristimulus values conversion from spectral data according to practise "ASTM E308-15" should be performed on spectral data with measurement interval of 1, 5, 10 or 20nm!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#452>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AJA7LLVEkGu_s2Rp5i44xGigZjJN8Qdrks5u_iJggaJpZM4ZoScI>.
|
Beta Was this translation helpful? Give feedback.
-
@Edwardlin-zlt : I cannot see the code @jdvandenberg shared but in that very precise case you need to perform the interpolation beforehand. Assuming your
Interpolation happens in-place and the default settings should work for typical spectral reflectance/transmittance/absorptance distributions. |
Beta Was this translation helpful? Give feedback.
@Edwardlin-zlt : I cannot see the code @jdvandenberg shared but in that very precise case you need to perform the interpolation beforehand. Assuming your
colour.SpectralPowerDistribution
(colour.SpectralDistribution
indevelop
) class instance is calledsd
, you just need to do that:sd.interpolate(colour.SpectralShape(interval=1))
Interpolation happens in-place and the default settings should work for typical spectral reflectance/transmittance/absorptance distributions.