ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/cri.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 2 months ago) by greg
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# Content
1 {
2 Compute color rendering index based on CIE method.
3 Used by scripts illumcal, reflcal.
4 }
5 sq(x) : x*x;
6
7 upi(i) = (10.872 + .404*c_r/c_k*ci(i) - 4*d_r/d_k*di(i)) /
8 (16.518 + 1.481*c_r/c_k*ci(i) - d_r/d_k*di(i)) ;
9 vpi(i) = 5.520 / (16.518 + 1.481*c_r/c_k*ci(i) - d_r/d_k*di(i)) ;
10
11 Wi(i) = 25 * Yi(i)^(1/3) - 17;
12
13 dE(i) = sqrt( sq(U_ri(i) - 13*Wi(i)*(upi(i)-u_r)) +
14 sq(V_ri(i) - 13*Wi(i)*(vpi(i)-v_r)) +
15 sq(W_ri(i) - Wi(i)) );
16
17 Ri(i) = 100 - 4.6*dE(i);
18
19 cri = (Ri(1)+Ri(2)+Ri(3)+Ri(4)+Ri(5)+Ri(6)+Ri(7)+Ri(8))/8;
20
21 U_ri(i) = select(i, U_r1, U_r2, U_r3, U_r4, U_r5, U_r6, U_r7, U_r8);
22 V_ri(i) = select(i, V_r1, V_r2, V_r3, V_r4, V_r5, V_r6, V_r7, V_r8);
23 W_ri(i) = select(i, W_r1, W_r2, W_r3, W_r4, W_r5, W_r6, W_r7, W_r8);
24
25 {
26 The following was generated by the command:
27
28 lam ref.dat ref{1,2,3,4,5,6,7,8}.dat \
29 | tabfunc {u,v,c,d}_r {U,V,W}_r1 {U,V,W}_r2 \
30 {U,V,W}_r3 {U,V,W}_r4 {U,V,W}_r5 \
31 {U,V,W}_r6 {U,V,W}_r7 {U,V,W}_r8
32
33 then modified to eliminate the functional nature.
34 }
35 i_cct = fx`p17860(cct); { replaced in select calls below }
36
37 X`p17860(i)=select(i,2300,2400,2500,2600,2700,2800,2900,3000,
38 3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,
39 4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,
40 5500,5600,5700,5800,5900,6000,6100,6500,7000,7500,8000,8500,
41 9000,9500,10000,10500,11000,12000,13000,14000,15000,17000,
42 20000,25000);
43 fx`p17860(x)=if(x-2300,if(25000-x,fx2`p17860(x,56),56),1);
44 fx2`p17860(x,i)=if(x-X`p17860(i),
45 i+(x-X`p17860(i))/(X`p17860(i+1)-X`p17860(i)),
46 fx2`p17860(x,i-1));
47 u_r=select(i_cct,0.2836,0.2777,0.2722,0.2671,0.2625,
48 0.2582,0.2542,0.2506,0.2472,0.244,0.241,0.2383,0.2357,0.2333,
49 0.2311,0.2289,0.227,0.2251,0.2234,0.2217,0.2202,0.2187,0.2173,
50 0.216,0.2148,0.2136,0.2125,0.2092,0.2081,0.2071,0.2062,0.2053,
51 0.2044,0.2036,0.2029,0.2022,0.2021,0.2008,0.2001,0.1978,0.1955,
52 0.1935,0.1919,0.1906,0.1894,0.1884,0.1876,0.1868,0.1862,0.185,
53 0.1841,0.1834,0.1828,0.1819,0.1809,0.1798);
54 v_r=select(i_cct,0.3563,0.3552,0.3541,0.3528,0.3516,
55 0.3503,0.3489,0.3476,0.3462,0.3449,0.3435,0.3422,0.3408,0.3395,
56 0.3382,0.3369,0.3356,0.3344,0.3332,0.3319,0.3308,0.3296,0.3285,
57 0.3273,0.3262,0.3252,0.3241,0.3254,0.3244,0.3234,0.3224,0.3214,
58 0.3205,0.3196,0.3187,0.3178,0.3169,0.3161,0.3153,0.3122,0.3087,
59 0.3057,0.3029,0.3005,0.2983,0.2963,0.2945,0.2929,0.2914,0.2889,
60 0.2867,0.2849,0.2833,0.2808,0.278,0.2749);
61 c_r=select(i_cct,0.4292,0.4784,0.5286,0.5795,0.631,
62 0.6828,0.7349,0.787,0.839,0.8908,0.9423,0.9934,1.0441,1.0943,
63 1.1439,1.193,1.2413,1.289,1.336,1.3822,1.4278,1.4725,1.5166,
64 1.5598,1.6023,1.644,1.685,1.6497,1.6903,1.7295,1.7681,1.8059,
65 1.8431,1.8796,1.9155,1.9506,1.9851,2.019,2.0522,2.1785,2.3228,
66 2.4536,2.5717,2.6787,2.7758,2.8642,2.9449,3.0187,3.0863,3.2059,
67 3.308,3.3959,3.4722,3.5978,3.7381,3.8946);
68 d_r=select(i_cct,1.663,1.6877,1.7106,1.7317,1.7514,
69 1.7696,1.7867,1.8027,1.8176,1.8317,1.8449,1.8574,1.8691,1.8802,
70 1.8907,1.9007,1.9102,1.9192,1.9277,1.9359,1.9437,1.9511,1.9581,
71 1.9649,1.9714,1.9776,1.9836,1.9975,2.0033,2.0087,2.014,2.019,
72 2.0239,2.0285,2.033,2.0373,2.0415,2.0455,2.0494,2.0636,2.0789,
73 2.092,2.1034,2.1133,2.122,2.1297,2.1365,2.1427,2.1483,2.1579,
74 2.1658,2.1726,2.1783,2.1876,2.1978,2.2088);
75 U_r1=select(i_cct,39.69,39.75,39.76,39.71,39.62,39.5,
76 39.35,39.17,38.98,38.77,38.56,38.33,38.1,37.86,37.62,37.38,
77 37.14,36.9,36.66,36.43,36.19,35.96,35.53,35.53,35.29,35.07,
78 34.86,34.92,34.7,34.47,34.25,34.03,33.82,33.62,33.42,33.23,
79 33.04,32.86,32.68,32.03,31.31,30.69,30.15,29.68,29.26,28.89,
80 28.56,28.27,28,27.54,27.16,26.84,26.57,26.13,25.66,25.15);
81 V_r1=select(i_cct,0.37,0.74,1.11,1.47,1.83,2.18,2.52,
82 2.85,3.16,3.47,3.77,4.05,4.32,4.58,4.83,5.07,5.3,5.52,5.73,
83 5.93,6.12,6.3,6.64,6.64,6.8,6.95,7.1,6.83,7,7.13,7.26,7.39,
84 7.51,7.63,7.74,7.84,7.95,8.04,8.14,8.48,8.83,9.13,9.37,9.58,
85 9.75,9.9,10.02,10.13,10.23,10.38,10.51,10.6,10.68,10.8,10.91,
86 11.02);
87 W_r1=select(i_cct,63.95,63.74,63.55,63.37,63.2,63.05,
88 62.9,62.76,62.63,62.51,62.4,62.29,62.19,62.09,62,61.92,61.84,
89 61.76,61.68,61.61,61.55,61.48,61.37,61.37,61.31,61.26,61.21,
90 61.05,61,60.96,60.9,60.87,60.83,60.79,60.75,60.72,60.68,60.65,
91 60.62,60.5,60.37,60.27,60.17,60.09,60.02,59.96,59.91,59.86,
92 59.81,59.74,59.67,59.62,59.57,59.5,59.42,59.33);
93 U_r2=select(i_cct,15.82,16.13,16.39,16.61,16.8,16.95,
94 17.06,17.16,17.23,17.28,17.31,17.32,17.32,17.31,17.29,17.26,
95 17.21,17.16,17.11,17.05,16.98,16.91,16.84,16.77,16.69,16.61,
96 16.53,16.56,16.48,16.38,16.29,16.2,16.1,16.01,15.92,15.83,
97 15.74,15.66,15.57,15.24,14.87,14.52,14.21,13.92,13.67,13.43,
98 13.22,13.02,12.85,12.53,12.26,12.04,11.84,11.51,11.15,10.75);
99 V_r2=select(i_cct,4.7,5.36,6.04,6.71,7.39,8.07,8.74,
100 9.4,10.05,10.7,11.33,11.94,12.55,13.14,13.71,14.27,14.82,15.35,
101 15.86,16.37,16.85,17.33,17.78,18.23,18.66,19.08,19.49,18.9,
102 19.33,19.71,20.09,20.45,20.8,21.14,21.47,21.8,22.11,22.41,22.7,
103 23.8,24.99,26.02,26.92,27.7,28.39,28.99,29.53,59.21,30.44,
104 31.17,31.77,32.28,32.7,33.37,34.09,34.84);
105 W_r2=select(i_cct,61.6,61.51,61.42,61.33,61.25,61.18,
106 61.1,61.03,60.97,60.9,60.84,60.78,60.73,60.68,60.62,60.58,
107 60.53,60.48,60.44,60.4,60.36,60.32,60.28,60.25,60.21,60.18,
108 60.15,60.07,60.03,60,59.9,59.95,59.92,59.9,59.87,59.85,59.83,
109 59.8,59.78,59.7,59.61,59.53,59.46,59.4,59.34,59.29,59.25,60.77,
110 59.17,59.11,59.05,59.01,58.96,58.9,58.83,58.75);
111 U_r3=select(i_cct,-17.73,-17.15,-16.41,-15.8,-15.23,
112 -14.69,-14.18,-13.71,-13.28,-12.87,-12.5,-12.15,-11.83,-11.53,
113 -11.25,-11,-10.76,-10.55,-10.35,-10.17,-10,-9.84,-9.7,-9.57,
114 -9.45,-9.34,-9.24,-9.14,-9,-8.91,-8.83,-8.75,-8.67,-8.61,-8.55,
115 -8.4,-8.44,-8.39,-8.35,-8.21,-8.1,-8.04,-8.01,-8,-8.01,-8.02,
116 -8.05,-8.08,-8.11,-8.17,-8.24,-8.31,-8.37,-8.48,-8.62,-8.78);
117 V_r3=select(i_cct,9.35,10.2,11.07,11.96,12.84,13.74,
118 14.63,15.51,16.39,17.26,18.12,18.96,19.79,20.6,21.4,22.18,
119 22.95,23.7,24.43,25.14,25.83,26.51,27.17,27.81,28.43,29.04,
120 29.63,29.03,29.64,30.21,30.76,31.29,31.81,32.32,32.82,33.3,
121 33.76,34.22,34.66,36.31,38.14,39.74,41.14,42.38,43.47,44.44,
122 45.31,46.08,46.77,47.99,48.99,49.83,50.45,51.69,52.92,54.24);
123 W_r3=select(i_cct,60.84,60.9,60.96,61,61.04,61.07,
124 61.09,61.11,61.13,61.14,61.15,61.16,61.17,61.17,61.17,61.17,
125 61.17,61.17,61.17,61.16,61.16,61.16,61.15,61.15,61.14,61.13,
126 61.13,61.17,61.16,61.15,61.1,61.14,61.13,61.12,61.12,61.11,
127 61.1,61.09,61.08,61.05,61.01,60.97,60.93,60.89,60.86,60.83,
128 60.8,60.77,60.75,60.7,60.66,60.62,60.59,60.54,60.48,60.41);
129 U_r4=select(i_cct,-43.38,-43.01,-42.62,-42.22,-41.82,
130 -41.42,-41.03,-40.65,-40.27,-39.91,-39.56,-39.22,-38.9,-38.59,
131 -38.29,-38.01,-37.73,-37.47,-37.23,-36.99,-36.76,-36.55,-36.34,
132 -36.15,-36.96,-35.78,-35.61,-35.45,-35.25,-35.07,-34.89,-34.73,
133 -34.57,-34.42,-34.28,-34.14,-34.02,-33.89,-33.78,-33.39,-32.94,
134 -32.61,-32.33,-32.1,-31.92,-31.76,-31.62,-31.51,-31.41,-31.25,
135 -31.12,-31.02,-30.94,-30.82,-30.7,-30.59);
136 V_r4=select(i_cct,5.59,5.91,6.25,6.6,6.97,7.35,7.73,
137 8.13,8.52,8.93,9.33,9.73,10.13,10.53,10.92,11.31,11.7,12.08,
138 12.45,12.82,13.18,13.54,13.89,14.23,14.56,14.89,15.21,14.69,15,
139 15.3,15.6,15.89,16.17,16.45,16.71,16.98,17.23,17.48,17.73,
140 18.62,19.67,20.57,21.37,22.08,22.7,23.27,23.77,24.22,24.63,
141 25.34,25.94,26.44,26.86,27.55,28.3,29.1);
142 W_r4=select(i_cct,56.92,57.15,57.36,57.55,57.73,
143 57.89,58.04,58.18,58.31,58.43,58.54,58.65,58.75,58.84,58.92,59,
144 59.08,59.15,59.22,59.28,59.34,59.4,59.45,59.5,59.55,59.6,59.64,
145 59.8,59.83,59.87,59.9,59.94,59.97,60,60.03,60.06,60.09,60.11,
146 60.14,60.23,60.32,60.4,60.47,60.52,60.57,60.61,60.65,60.68,
147 60.71,60.76,60.8,60.84,60.87,60.91,60.96,61.01);
148 U_r5=select(i_cct,-37.38,-37.17,-36.92,-36.63,-36.33,
149 -36.01,-35.68,-35.34,-35.01,-34.67,-34.33,-34,-33.67,-33.34,
150 -33.03,-32.67,-32.41,-32.11,-31.83,-31.54,-31.27,-31.01,-30.75,
151 -30.5,-30.26,-30.02,-29.79,-29.76,-29.5,-29.26,-29.03,-28.81,
152 -28.6,-28.4,-28.2,-28.01,-27.82,-27.65,-27.47,-26.85,-26.17,
153 -25.64,-25.1,-24.68,-24.31,-23.98,-23.69,-23.44,-23.21,-22.82,
154 -22.49,-22.23,-22,-21.64,-21.25,-20.84);
155 V_r5=select(i_cct,-0.88,-1.22,-1.56,-1.88,-2.19,
156 -2.48,-2.76,-3.02,-3.26,-3.49,-3.71,-3.92,-4.11,-4.29,-4.46,
157 -4.5,-4.76,-4.9,-5.03,-5.15,-5.27,-5.37,-5.47,-5.57,-5.65,
158 -5.73,-5.81,-5.78,-5.85,-5.92,-5.99,-6.05,-6.11,-6.17,-6.22,
159 -6.27,-6.32,-6.36,-6.4,-6.54,-6.68,-6.76,-6.85,-6.91,-6.95,
160 -6.98,-7,-7.01,-7.02,-7.03,-7.03,-7.02,-7.01,-6.99,-6.95,-6.9);
161 W_r5=select(i_cct,58.06,58.27,58.47,58.65,58.81,
162 58.97,59.11,59.25,59.37,59.49,59.6,59.71,59.8,59.9,59.98,60.03,
163 60.15,60.22,60.29,60.36,60.42,60.48,60.54,60.6,60.65,60.7,
164 60.75,60.89,60.93,60.98,61,61.06,61.09,61.13,61.17,61.2,61.23,
165 61.26,61.29,61.41,61.52,61.61,61.71,61.79,61.86,61.92,61.97,
166 62.02,62.06,62.14,62.2,62.25,62.29,62.36,62.44,62.53);
167 U_r6=select(i_cct,-21.62,-22.11,-22.5,-22.8,-23.03,
168 -23.2,-23.31,-23.37,-23.4,-23.39,-23.35,-23.28,-23.19,-23.09,
169 -22.97,-22.84,-22.7,-22.55,-22.39,-22.23,-22.07,-21.9,-21.73,
170 -21.56,-21.39,-21.22,-21.06,-21.19,-20.94,-20.76,-20.58,-20.41,
171 -20.24,-20.07,-19.9,-19.74,-19.59,-19.43,-19.28,-18.72,-18.09,
172 -17.53,-17.04,-16.6,-16.21,-15.87,-15.55,-15.27,-15.02,-14.58,
173 -14.22,-13.91,-13.64,-13.22,-12.76,-12.26);
174 V_r6=select(i_cct,-8.16,-9.11,-10.05,-10.98,-11.88,
175 -12.77,-13.63,-14.46,-15.27,-16.05,-16.79,-17.51,-18.2,-18.85,
176 -19.49,-20.09,-20.67,-21.22,-21.75,-22.25,-22.73,-23.19,-23.63,
177 -24.05,-24.45,-24.83,-25.2,-24.69,-25.1,-25.44,-25.78,-26.1,
178 -26.4,-26.69,-26.97,-27.24,-27.5,-27.74,-27.98,-28.83,-29.72,
179 -30.45,-31.05,-31.55,-31.98,-32.34,-32.65,-32.91,-33.14,-33.52,
180 -33.82,-34.05,-34.24,-34.52,-34.8,-35.07);
181 W_r6=select(i_cct,57.43,57.58,57.72,57.86,57.98,
182 58.11,58.23,58.34,58.45,58.55,58.65,58.74,58.83,58.92,59,59.08,
183 59.16,59.23,59.3,59.37,59.43,59.5,59.56,59.61,59.67,59.72,
184 59.77,59.92,59.95,60,60.02,60.09,60.13,60.17,60.21,60.25,60.28,
185 60.32,60.35,60.48,60.63,60.75,60.86,60.96,61.05,61.13,61.2,
186 61.27,61.33,61.43,61.52,61.59,61.65,61.76,61.87,62);
187 U_r7=select(i_cct,21.04,20.23,19.46,18.74,18.07,
188 17.45,16.86,16.32,15.82,15.36,14.93,14.53,14.16,13.82,13.51,
189 13.23,12.95,12.7,12.47,12.26,12.07,11.89,11.72,11.56,11.42,
190 11.29,11.17,10.7,11.05,10.93,10.82,10.72,10.62,10.53,10.45,
191 10.37,10.3,10.23,10.17,9.96,9.78,9.65,9.56,9.5,9.45,9.42,9.41,
192 9.4,9.39,9.4,9.41,9.42,9.44,9.48,9.53,9.59);
193 V_r7=select(i_cct,-7.77,-8.45,-9.13,-9.82,-10.52,
194 -11.22,-11.91,-12.6,-13.28,-13.94,-14.59,-15.23,-15.85,-16.45,
195 -17.03,-17.59,-18.15,-18.68,-19.2,-19.7,-20.18,-20.64,-21.09,
196 -21.53,-21.94,-22.35,-22.73,-22.11,-22.44,-22.81,-23.16,-23.5,
197 -23.83,-24.15,-24.46,-24.76,-25.04,-25.32,-25.58,-26.56,-27.6,
198 -28.47,-29.22,-29.85,-30.4,-30.87,-31.28,-31.64,-31.96,-32.49,
199 -32.92,-33.24,-33.55,-34,-34.46,-34.93);
200 W_r7=select(i_cct,60.92,60.83,60.74,60.67,60.61,
201 60.55,60.5,60.46,60.42,60.39,60.36,60.33,60.31,60.29,60.27,
202 60.26,60.24,60.22,60.21,60.2,60.19,60.19,60.18,60.17,60.17,
203 60.16,60.16,60.1,60.15,60.15,60.14,60.14,60.14,60.14,60.14,
204 60.14,60.14,60.14,60.14,60.14,60.15,60.16,60.18,60.19,60.2,
205 60.2,60.23,60.25,60.26,60.28,60.3,60.32,60.34,60.37,60.4,60.44);
206 U_r8=select(i_cct,51.15,50.06,49,47.96,46.95,45.98,
207 45.04,44.14,43.28,42.46,41.67,40.92,40.21,39.53,38.88,38.26,
208 37.67,37.11,36.57,36.06,35.58,35.12,34.67,34.25,33.85,33.47,
209 33.1,33.17,32.81,32.44,32.08,31.75,31.43,31.12,30.82,30.54,
210 30.28,30.02,29.77,28.89,27.98,27.23,26.61,26.09,25.64,25.26,
211 24.94,24.65,24.4,23.98,23.65,23.38,23.16,22.81,22.45,22.09);
212 V_r8=select(i_cct,-6.3,-6.52,-6.77,-7.03,-7.31,-7.6,
213 -7.9,-8.21,-8.52,-8.84,-9.15,-9.47,-9.78,-10.1,-10.41,-10.71,
214 -11.01,-11.31,-11.6,-11.88,-12.16,-12.43,-12.7,-12.95,-13.21,
215 -13.45,-13.69,-13.35,-13.54,-13.77,-13.99,-14.21,-14.42,-14.63,
216 -14.82,-15.02,-15.2,-15.39,-15.56,-16.21,-16.92,-17.54,-18.06,
217 -18.52,-18.92,-19.27,-19.58,-19.85,-20.09,-20.5,-20.84,-21.11,
218 -21.34,-21.71,-22.09,-22.48);
219 W_r8=select(i_cct,65,64.75,64.53,64.32,64.14,63.97,
220 63.81,63.67,63.54,63.42,63.31,63.21,63.11,63.03,62.94,62.87,
221 62.8,62.73,62.67,62.61,62.55,62.5,62.45,62.41,62.37,62.33,
222 62.29,62.23,62.18,62.14,62.11,62.07,62.04,62.01,61.99,61.96,
223 61.94,61.91,61.89,61.81,61.73,61.67,61.62,61.58,61.54,61.51,
224 61.49,61.47,61.45,61.42,61.4,61.39,61.37,61.35,61.33,61.32);