From ab54917bceb4943f6750f589ffe6a032b2770fb1 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Sat, 18 Jun 2011 00:12:09 -0400 Subject: moved class definitions for Solid, Mesh, Material, and Surface into geometry.py and moved instances of these classes into separate folders. the Solid object no longer contains a rotation, displacement, or id variable; instead, they are passed to a geometry object when calling add_solid(). --- chromaticity.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 chromaticity.py (limited to 'chromaticity.py') diff --git a/chromaticity.py b/chromaticity.py deleted file mode 100644 index 4080496..0000000 --- a/chromaticity.py +++ /dev/null @@ -1,35 +0,0 @@ -import numpy as np - -#f = open('ciexyz64_1.csv') -f = open('sbrgb10w.csv') - -color_map = [] -for line in f: - color_map.append([float(s) for s in line.split(',')]) - -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:]) - -def map_wavelength(wavelength): - r = np.interp(wavelength, color_map[:,0], color_map[:,1]) - g = np.interp(wavelength, color_map[:,0], color_map[:,2]) - b = np.interp(wavelength, color_map[:,0], color_map[:,3]) - - if np.iterable(wavelength): - rgb = np.empty((len(wavelength),3)) - - rgb[:,0] = r - rgb[:,1] = g - rgb[:,2] = b - - return rgb - else: - return np.array([r,g,b]) -- cgit