Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cieCMFdata =
- Import["cie2deg.csv"]; (* Get this file here: \
- http://www.cvrl.org/lumindex.htm *)
- {x, y, z, ix, iy, iz} =
- Interpolation[Transpose[{cieCMFdata[[All, 1]], #}],
- InterpolationOrder -> 1] & /@
- Join[Transpose[cieCMFdata[[All, 2 ;; 4]]],
- Transpose[Accumulate[cieCMFdata[[All, 2 ;; 4]]]]/
- Total[cieCMFdata[[All, 2 ;; 4]]]];
- xyz[\[Lambda]_] := {x[\[Lambda]], y[\[Lambda]], z[\[Lambda]]}
- xy[\[Lambda]_] := {#1, #2}/(#1 + #2 + #3) & @@ xyz[\[Lambda]]
- ixyz[e_] := {ix[e], iy[e], iz[e]}
- ixyz[s_, e_] := ixyz[e] - ixyz[s]
- Row[{Plot[{x[\[Lambda]], y[\[Lambda]], z[\[Lambda]]}, {\[Lambda], 385,
- 745}, PlotStyle -> {Red, Green, Blue}, ImageSize -> 360],
- Plot[{ix[\[Lambda]], iy[\[Lambda]], iz[\[Lambda]]}, {\[Lambda], 385,
- 745}, PlotStyle -> {Red, Green, Blue}, ImageSize -> 360]}]
- XYYToXYZ[xyY_] := {xyY[[3]]/xyY[[2]] * xyY[[1]], xyY[[3]],
- xyY[[3]]/xyY[[2]] * (1 - xyY[[2]] - xyY[[1]])}
- XYZToXYY[XYZ_] := {XYZ[[1]]/Total[XYZ], XYZ[[2]]/Total[XYZ], XYZ[[2]]}
- map = Join @@
- Table[Join @@
- Table[Table[{XYZToXYY[ixyz[a, b] + {1, 1, 1} - ixyz[c]], {a, b,
- c}}, {c, b + 5, 745, 5}], {b, a + 5, 745, 5}], {a, 385, 745,
- 5}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement