-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathblue.py
282 lines (275 loc) · 13.5 KB
/
blue.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
from matplotlib.colors import ListedColormap
from numpy import nan, inf
# Used to reconstruct the colormap in viscm
parameters = {'xp': [11.890960615721497, 20.879625156989675, 13.488999865029001, -1.120259144284006, -10.740990687002295, -13.23525442029964, -12.90535536019064, 2.5923421247544525],
'yp': [-10.622564647538042, -23.02072263549411, -30.150049168000294, -31.21901933941345, -25.517845091876666, -13.759173206332065, -2.2538080056677074, -4.113531703861099],
'min_Jp': 10.208333333333336,
'max_Jp': 94.89583333333334}
cm_data = [[ 0.13217294, 0.02216185, 0.15925166],
[ 0.13669847, 0.02367601, 0.16493914],
[ 0.14120085, 0.02522488, 0.17063713],
[ 0.1456879 , 0.02679372, 0.17636536],
[ 0.15015881, 0.02838308, 0.18212224],
[ 0.15460852, 0.03000286, 0.18789489],
[ 0.15904897, 0.03162694, 0.19371576],
[ 0.16346916, 0.03327796, 0.19955633],
[ 0.16787203, 0.03494898, 0.20542535],
[ 0.1722628 , 0.0366263 , 0.21133883],
[ 0.17663372, 0.03832764, 0.21727622],
[ 0.18098806, 0.04004406, 0.22324832],
[ 0.18532874, 0.04173194, 0.22926588],
[ 0.18964939, 0.04339464, 0.2353118 ],
[ 0.19395092, 0.04503581, 0.24139075],
[ 0.19823879, 0.04664038, 0.24752274],
[ 0.20250558, 0.04822872, 0.25368699],
[ 0.20675095, 0.04980177, 0.25988492],
[ 0.21097738, 0.05135188, 0.26612831],
[ 0.21518395, 0.05288082, 0.27241805],
[ 0.21936673, 0.05439937, 0.2787442 ],
[ 0.2235249 , 0.0559091 , 0.28510781],
[ 0.22765793, 0.05741044, 0.29151145],
[ 0.23176762, 0.05889569, 0.29796805],
[ 0.23584881, 0.06037959, 0.30446287],
[ 0.23990011, 0.0618647 , 0.31099621],
[ 0.24392 , 0.06335391, 0.31756813],
[ 0.24790678, 0.06485041, 0.32417842],
[ 0.2518586 , 0.06635773, 0.33082656],
[ 0.2557744 , 0.06787594, 0.33751691],
[ 0.25965113, 0.06941247, 0.34424417],
[ 0.263486 , 0.07097387, 0.35100416],
[ 0.26727656, 0.0725651 , 0.35779486],
[ 0.27102024, 0.07419145, 0.36461386],
[ 0.27471434, 0.07585853, 0.37145825],
[ 0.27835606, 0.07757226, 0.37832469],
[ 0.28194249, 0.07933875, 0.38520933],
[ 0.28547067, 0.08116432, 0.39210787],
[ 0.28893761, 0.08305536, 0.39901552],
[ 0.2923403 , 0.08501829, 0.40592705],
[ 0.29567576, 0.08705943, 0.41283683],
[ 0.29894109, 0.08918489, 0.41973884],
[ 0.30213347, 0.09140049, 0.42662674],
[ 0.30525021, 0.09371113, 0.433495 ],
[ 0.30828872, 0.09612127, 0.44033795],
[ 0.31124668, 0.09863647, 0.44714607],
[ 0.31412208, 0.10126033, 0.45391229],
[ 0.31691312, 0.10399563, 0.46062961],
[ 0.31961836, 0.10684434, 0.46729116],
[ 0.32223661, 0.10980755, 0.47389029],
[ 0.32476698, 0.1128854 , 0.48042104],
[ 0.32720876, 0.11607711, 0.48687817],
[ 0.32956205, 0.11938176, 0.49325427],
[ 0.33182701, 0.12279709, 0.49954424],
[ 0.33400409, 0.12632016, 0.50574349],
[ 0.33609404, 0.12994744, 0.51184794],
[ 0.33809785, 0.13367489, 0.51785407],
[ 0.34001688, 0.13749807, 0.52375852],
[ 0.34185263, 0.14141215, 0.5295588 ],
[ 0.34360674, 0.1454121 , 0.535253 ],
[ 0.34528103, 0.14949272, 0.54083967],
[ 0.34687754, 0.15364873, 0.54631766],
[ 0.34839867, 0.15787473, 0.5516859 ],
[ 0.34984626, 0.16216558, 0.55694478],
[ 0.35122252, 0.1665162 , 0.56209448],
[ 0.35252969, 0.17092163, 0.56713551],
[ 0.35377006, 0.17537711, 0.57206861],
[ 0.35494612, 0.17987796, 0.57689459],
[ 0.35606065, 0.18441957, 0.5816143 ],
[ 0.35711536, 0.18899812, 0.5862297 ],
[ 0.35811253, 0.19360973, 0.59074229],
[ 0.35905442, 0.19825076, 0.59515371],
[ 0.35994327, 0.20291779, 0.59946566],
[ 0.36078129, 0.20760765, 0.60367993],
[ 0.36157068, 0.21231734, 0.60779834],
[ 0.36231439, 0.21704365, 0.61182247],
[ 0.36301372, 0.22178452, 0.61575461],
[ 0.36367073, 0.2265376 , 0.61959664],
[ 0.36428747, 0.2313007 , 0.62335047],
[ 0.36486595, 0.23607183, 0.62701797],
[ 0.36540817, 0.24084915, 0.63060103],
[ 0.36591607, 0.24563096, 0.63410149],
[ 0.36639158, 0.2504157 , 0.63752117],
[ 0.3668366 , 0.25520194, 0.64086184],
[ 0.36725311, 0.25998832, 0.64412527],
[ 0.36764328, 0.26477344, 0.64731318],
[ 0.3680085 , 0.26955647, 0.65042726],
[ 0.36835059, 0.27433641, 0.65346914],
[ 0.36867134, 0.27911233, 0.6564404 ],
[ 0.36897256, 0.28388339, 0.65934258],
[ 0.36925602, 0.28864881, 0.66217719],
[ 0.36952351, 0.29340788, 0.6649457 ],
[ 0.3697768 , 0.29815996, 0.66764952],
[ 0.37001764, 0.30290445, 0.67029004],
[ 0.3702478 , 0.3076408 , 0.67286859],
[ 0.37046904, 0.31236853, 0.67538648],
[ 0.37068312, 0.31708718, 0.67784499],
[ 0.3708918 , 0.32179632, 0.68024534],
[ 0.37109685, 0.32649557, 0.68258873],
[ 0.37130003, 0.33118458, 0.68487633],
[ 0.37150314, 0.33586303, 0.68710929],
[ 0.37170804, 0.34053056, 0.68928875],
[ 0.3719164 , 0.34518697, 0.69141574],
[ 0.37212999, 0.349832 , 0.69349132],
[ 0.37235064, 0.35446544, 0.6955165 ],
[ 0.37258013, 0.35908705, 0.69749231],
[ 0.37282029, 0.36369664, 0.69941971],
[ 0.37307294, 0.36829402, 0.70129969],
[ 0.37333991, 0.37287903, 0.70313318],
[ 0.37362303, 0.3774515 , 0.70492111],
[ 0.37392415, 0.38201129, 0.7066644 ],
[ 0.3742451 , 0.38655825, 0.70836394],
[ 0.37458773, 0.39109226, 0.71002064],
[ 0.3749539 , 0.39561319, 0.71163536],
[ 0.37534545, 0.40012094, 0.71320896],
[ 0.37576424, 0.4046154 , 0.71474232],
[ 0.37621211, 0.40909646, 0.71623627],
[ 0.37669089, 0.41356403, 0.71769166],
[ 0.37720243, 0.41801803, 0.71910933],
[ 0.37774855, 0.42245837, 0.72049011],
[ 0.37833106, 0.42688498, 0.72183484],
[ 0.37895177, 0.43129778, 0.72314434],
[ 0.37961245, 0.43569671, 0.72441943],
[ 0.38031486, 0.44008169, 0.72566094],
[ 0.38106076, 0.44445268, 0.72686969],
[ 0.38185182, 0.44880962, 0.7280465 ],
[ 0.38268975, 0.45315247, 0.72919218],
[ 0.3835762 , 0.45748116, 0.73030757],
[ 0.38451281, 0.46179566, 0.73139351],
[ 0.38550116, 0.46609593, 0.73245082],
[ 0.38654279, 0.47038193, 0.73348035],
[ 0.3876392 , 0.47465363, 0.73448291],
[ 0.38879184, 0.478911 , 0.73545936],
[ 0.39000213, 0.48315403, 0.73641054],
[ 0.39127141, 0.48738268, 0.73733729],
[ 0.39260099, 0.49159695, 0.73824046],
[ 0.39399211, 0.49579683, 0.7391209 ],
[ 0.39544595, 0.4999823 , 0.73997947],
[ 0.39696364, 0.50415338, 0.74081703],
[ 0.39854625, 0.50831006, 0.74163443],
[ 0.40019476, 0.51245234, 0.74243254],
[ 0.40191012, 0.51658025, 0.74321222],
[ 0.4036932 , 0.52069379, 0.74397434],
[ 0.40554478, 0.52479298, 0.74471976],
[ 0.40746562, 0.52887785, 0.74544937],
[ 0.40945636, 0.53294843, 0.74616402],
[ 0.41151761, 0.53700476, 0.74686455],
[ 0.41364987, 0.54104688, 0.7475518 ],
[ 0.41585365, 0.54507481, 0.7482267 ],
[ 0.41812934, 0.54908859, 0.74889012],
[ 0.42047728, 0.55308828, 0.74954294],
[ 0.42289775, 0.55707392, 0.75018601],
[ 0.42539095, 0.56104556, 0.75082021],
[ 0.42795705, 0.56500326, 0.75144639],
[ 0.43059613, 0.56894708, 0.75206541],
[ 0.43330824, 0.57287707, 0.75267815],
[ 0.43609336, 0.5767933 , 0.75328544],
[ 0.43895145, 0.58069584, 0.75388814],
[ 0.44188237, 0.58458473, 0.7544871 ],
[ 0.44488599, 0.58846006, 0.75508316],
[ 0.44796212, 0.59232188, 0.75567717],
[ 0.45111051, 0.59617026, 0.75626997],
[ 0.45433091, 0.60000529, 0.75686228],
[ 0.45762301, 0.60382702, 0.7574549 ],
[ 0.4609865 , 0.6076355 , 0.7580488 ],
[ 0.46442103, 0.6114308 , 0.75864479],
[ 0.46792623, 0.61521297, 0.75924371],
[ 0.4715017 , 0.61898207, 0.75984637],
[ 0.47514703, 0.62273814, 0.76045361],
[ 0.4788618 , 0.62648125, 0.76106626],
[ 0.48264558, 0.63021144, 0.76168515],
[ 0.48649792, 0.63392874, 0.76231111],
[ 0.49041839, 0.63763319, 0.76294498],
[ 0.49440652, 0.64132483, 0.7635876 ],
[ 0.49846187, 0.64500368, 0.76423976],
[ 0.50258409, 0.64866978, 0.76490201],
[ 0.50677264, 0.65232312, 0.76557558],
[ 0.51102708, 0.6559637 , 0.76626135],
[ 0.51534697, 0.65959152, 0.76696023],
[ 0.51973187, 0.66320657, 0.76767313],
[ 0.52418136, 0.66680884, 0.76840101],
[ 0.52869499, 0.67039831, 0.76914482],
[ 0.53327235, 0.67397494, 0.76990557],
[ 0.53791302, 0.6775387 , 0.77068427],
[ 0.54261669, 0.68108954, 0.7714817 ],
[ 0.54738299, 0.68462741, 0.77229891],
[ 0.55221135, 0.68815225, 0.77313735],
[ 0.55710135, 0.69166401, 0.7739982 ],
[ 0.56205254, 0.69516262, 0.77488269],
[ 0.56706445, 0.69864803, 0.7757921 ],
[ 0.5721366 , 0.70212016, 0.77672775],
[ 0.57726849, 0.70557897, 0.77769104],
[ 0.5824597 , 0.70902436, 0.77868317],
[ 0.58770967, 0.7124563 , 0.77970565],
[ 0.59301756, 0.71587476, 0.78076036],
[ 0.59838267, 0.71927971, 0.78184895],
[ 0.60380419, 0.72267116, 0.78297314],
[ 0.60928127, 0.72604912, 0.7841347 ],
[ 0.61481293, 0.72941363, 0.78533547],
[ 0.62039814, 0.73276477, 0.78657732],
[ 0.62603562, 0.73610266, 0.78786229],
[ 0.63172396, 0.73942747, 0.7891925 ],
[ 0.63746171, 0.74273942, 0.79056997],
[ 0.64324724, 0.74603878, 0.79199677],
[ 0.64907877, 0.74932586, 0.79347499],
[ 0.65495439, 0.75260107, 0.7950067 ],
[ 0.66087179, 0.7558649 , 0.79659413],
[ 0.66682814, 0.75911802, 0.79823983],
[ 0.67282151, 0.76236096, 0.79994524],
[ 0.67884928, 0.76559441, 0.80171222],
[ 0.68490872, 0.76881916, 0.80354253],
[ 0.69099696, 0.77203607, 0.8054378 ],
[ 0.69711099, 0.77524608, 0.8073995 ],
[ 0.70324772, 0.77845022, 0.80942895],
[ 0.70940398, 0.78164957, 0.81152729],
[ 0.71557653, 0.78484528, 0.81369544],
[ 0.7217612 , 0.78803884, 0.81593475],
[ 0.72795524, 0.79123135, 0.81824533],
[ 0.73415594, 0.79442399, 0.82062712],
[ 0.74036019, 0.79761806, 0.82308018],
[ 0.74656497, 0.80081486, 0.82560433],
[ 0.75276734, 0.80401573, 0.82819926],
[ 0.75896452, 0.80722199, 0.83086447],
[ 0.76515383, 0.81043494, 0.83359933],
[ 0.77133274, 0.81365586, 0.83640309],
[ 0.7774989 , 0.81688599, 0.83927495],
[ 0.78364717, 0.82012747, 0.84221541],
[ 0.78977733, 0.82338091, 0.8452227 ],
[ 0.79588772, 0.82664733, 0.84829592],
[ 0.80197661, 0.82992779, 0.85143441],
[ 0.80804251, 0.83322322, 0.85463767],
[ 0.81408416, 0.83653448, 0.85790541],
[ 0.82010052, 0.83986227, 0.86123767],
[ 0.82609045, 0.84320733, 0.86463493],
[ 0.83204469, 0.84657319, 0.86810058],
[ 0.83797164, 0.84995717, 0.87163289],
[ 0.84387192, 0.85335917, 0.87523342],
[ 0.84974682, 0.85677881, 0.87890418],
[ 0.85559299, 0.86021735, 0.88264858],
[ 0.86141058, 0.86367475, 0.88646923],
[ 0.86721094, 0.86714674, 0.89036725],
[ 0.87299914, 0.87063131, 0.89434535],
[ 0.87877004, 0.87413042, 0.89840629],
[ 0.88453669, 0.87763908, 0.90255063],
[ 0.89031153, 0.88115247, 0.90677917],
[ 0.8960938 , 0.8846711 , 0.91109116],
[ 0.90189106, 0.88819234, 0.91548457],
[ 0.90772105, 0.89170929, 0.91995838],
[ 0.91357865, 0.89522463, 0.92450721],
[ 0.91947392, 0.89873478, 0.92912752],
[ 0.92542215, 0.90223373, 0.93381777],
[ 0.93140447, 0.90573033, 0.93856712],
[ 0.9374452 , 0.90921449, 0.94337733],
[ 0.94353853, 0.91268927, 0.94824212],
[ 0.94967876, 0.91615763, 0.95315546],
[ 0.95588623, 0.91961077, 0.95812116]]
test_cm = ListedColormap(cm_data, name=__file__)
if __name__ == "__main__":
import matplotlib.pyplot as plt
import numpy as np
try:
from viscm import viscm
viscm(test_cm)
except ImportError:
print("viscm not found, falling back on simple display")
plt.imshow(np.linspace(0, 100, 256)[None, :], aspect='auto',
cmap=test_cm)
plt.show()