I'm trying to create a script taking my experimental values of measured radiance and turn it into xyz and rgb colour values. I import table with colour matching functions from here -http://cvrl.ucl.ac.uk/cmfs.htm
But I'm running into a trouble, because the step of my measured data goes like this: 400nm, 403.535nm, 407.071nm, 410.606nm, etc and I don't know how to get it to match the one from colour matching functions to get this code to work:

Calc[radiance_] :=
{P = radiance},
X = Δλ*Total[wx*P];
Y = Δλ*Total[wy*P];
Z = Δλ*Total[wz*P];

x = X/(X + Y + Z);
y = Y/(X + Y + Z);
z = Z/(X + Y + Z); Return[XYZColor[x, y, z]];

  • 1
    $\begingroup$ Possible duplicate: mathematica.stackexchange.com/q/11480/12 (not that VisibleSpectrum has been fixed since then) $\endgroup$ – Szabolcs Apr 12 at 12:55
  • $\begingroup$ Doesn't VisibleSpectrum calculate from single number only? I have a whole array of radiance values with corresponding wavelegths $\endgroup$ – QookieCan Apr 12 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.