forked from tsupinie/research
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolor_tables.py
70 lines (64 loc) · 2.44 KB
/
color_tables.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import matplotlib
LUTSIZE = matplotlib.rcParams['image.lut']
import matplotlib.colors as colors
_NWSRef_data = {
'blue': [
(0.0, 0.92549019607843142, 0.92549019607843142),
(0.07142857, 0.96470588235294119, 0.96470588235294119),
(0.14285714, 0.96470588235294119, 0.96470588235294119),
(0.21428571, 0.0, 0.0),
(0.28571429, 0.0, 0.0),
(0.35714286, 0.0, 0.0),
(0.42857143, 0.0, 0.0),
(0.50000000, 0.0, 0.0),
(0.57142857, 0.0, 0.0),
(0.64285714, 0.0, 0.0),
(0.71428571, 0.0, 0.0),
(0.78571429, 0.0, 0.0),
(0.85714286, 1.0, 1.0),
(0.92857143, 0.78823529411764703, 0.78823529411764703),
(1.0, 0.0, 0.0)
],
'green': [
(0.0, 0.92549019607843142, 0.92549019607843142),
(0.07142857, 0.62745098039215685, 0.62745098039215685),
(0.14285714, 0.0, 0.0),
(0.21428571, 1.0, 1.0),
(0.28571429, 0.78431372549019607, 0.78431372549019607),
(0.35714286, 0.56470588235294117, 0.56470588235294117),
(0.42857143, 1.0, 1.0),
(0.50000000, 0.75294117647058822, 0.75294117647058822),
(0.57142857, 0.56470588235294117, 0.56470588235294117),
(0.64285714, 0.0, 0.0),
(0.71428571, 0.0, 0.0),
(0.78571429, 0.0, 0.0),
(0.85714286, 0.0, 0.0),
(0.92857143, 0.33333333333333331, 0.33333333333333331),
(1.0, 0.0, 0.0)],
'red': [
(0.0, 0.0, 0.0),
(0.07142857, 0.0039215686274509803, 0.0039215686274509803),
(0.14285714, 0.0, 0.0),
(0.21428571, 0.0, 0.0),
(0.28571429, 0.0, 0.0),
(0.35714286, 0.0, 0.0),
(0.42857143, 1.0, 1.0),
(0.50000000, 0.90588235294117647, 0.90588235294117647),
(0.57142857, 1.0, 1.0),
(0.64285714, 1.0, 1.0),
(0.71428571, 0.83921568627450982, 0.83921568627450982),
(0.78571429, 0.75294117647058822, 0.75294117647058822),
(0.85714286, 1.0, 1.0),
(0.92857143, 0.59999999999999998, 0.59999999999999998),
(1.0, 0.0, 0.0)
]
}
datad = {}
for name in locals().keys():
if name.endswith('_data'):
newname = name[1:-5]
#Put data for colortable into dictionary under new name
datad[newname] = locals()[name]
#Create colortable from data and place it in local namespace under new name
locals()[newname] = colors.LinearSegmentedColormap(newname, locals()[name],
LUTSIZE)