From 084dfd08b714faefaea77cb7dc04d2e93dc04b1d Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Fri, 16 Sep 2011 14:27:46 -0400 Subject: File reorganization to move toward standard python package layout --- color/colormap.py | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 color/colormap.py (limited to 'color/colormap.py') diff --git a/color/colormap.py b/color/colormap.py deleted file mode 100644 index 6f3e056..0000000 --- a/color/colormap.py +++ /dev/null @@ -1,20 +0,0 @@ -import numpy as np -import matplotlib.cm as cm - -def map_to_color(a, range=None, map=cm.hsv, weights=None): - a = np.asarray(a) - if range is None: - range = (a.min(), a.max()) - - ax = (a - range[0])/(range[1]-range[0]) - - frgba = map(ax) - - if weights is not None: - frgba[:,0] *= weights - frgba[:,1] *= weights - frgba[:,2] *= weights - - rgba = (frgba*255).astype(np.uint32) - - return rgba[:,0] << 16 | rgba[:,1] << 8 | rgba[:,2] -- cgit