summaryrefslogtreecommitdiff
path: root/color/chromaticity.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-07-30 16:10:27 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-07-30 16:10:27 -0400
commit1a6dc30108d3e78f72f773ec025fc98e246f68f5 (patch)
treede7603aaca9912521bd1ea2cc7291e7681e09bb1 /color/chromaticity.py
parent368524c5007a1f6ce2ef7be8d5dc1156c41a9dc2 (diff)
downloadchroma-1a6dc30108d3e78f72f773ec025fc98e246f68f5.tar.gz
chroma-1a6dc30108d3e78f72f773ec025fc98e246f68f5.tar.bz2
chroma-1a6dc30108d3e78f72f773ec025fc98e246f68f5.zip
when throwing photons from the light source out onto the scene, photons are now thrown randomly across each triangle instead of only at the center of each triangle. all of the rendering kernels have been rewritten so that they operate additively; for example, you may now throw photons from the light source onto the scene, render from the camera to the scene, then throw more photons and render again.
Diffstat (limited to 'color/chromaticity.py')
-rw-r--r--color/chromaticity.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/color/chromaticity.py b/color/chromaticity.py
index fbd812a..859cc14 100644
--- a/color/chromaticity.py
+++ b/color/chromaticity.py
@@ -1,24 +1,14 @@
import numpy as np
import os
+import sys
dir = os.path.split(os.path.realpath(__file__))[0]
-f = open(dir + '/sbrgb10w.csv')
+sys.path.append(dir + '/..')
-color_map = []
-for line in f:
- color_map.append([float(s) for s in line.split(',')])
+from tools import read_csv
-f.close()
-
-color_map = np.array(color_map)
-
-# zero negative coefficients
-color_map[color_map < 0] = 0
-
-# normalize coefficients
-for i in range(len(color_map)):
- color_map[i,1:] /= np.sum(color_map[i,1:])
+color_map = read_csv(dir + '/ciexyz64_1.csv')
def map_wavelength(wavelength):
r = np.interp(wavelength, color_map[:,0], color_map[:,1])