forked from smarsland/AviaNZ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
colourMaps.py
738 lines (725 loc) · 65.3 KB
/
colourMaps.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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
# colourMaps.py
# Set of colour maps for the AviaNZ interface.
# Version 3.0 14/09/20
# Authors: Stephen Marsland, Nirosha Priyadarshani, Julius Juodakis, Virginia Listanti
# These were made using cmaps.py in test
# AviaNZ bioacoustic analysis program
# Copyright (C) 2017--2020
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pyqtgraph
import numpy as np
def colourMaps(cmap):
if cmap == 'Grey':
pos = np.array([0., 1.])
colour = np.array([[0, 0, 0, 255], [255, 255, 255, 255]])
mode = 'rgb'
# viridis
elif cmap == 'Viridis':
pos = np.array([0., 0.00392157, 0.00784314, 0.01176471, 0.01568627, 0.01960784
, 0.02352941, 0.02745098, 0.03137255, 0.03529412, 0.03921569, 0.04313725
, 0.04705882, 0.05098039, 0.05490196, 0.05882353, 0.0627451, 0.06666667
, 0.07058824, 0.0745098, 0.07843137, 0.08235294, 0.08627451, 0.09019608
, 0.09411765, 0.09803922, 0.10196078, 0.10588235, 0.10980392, 0.11372549
, 0.11764706, 0.12156863, 0.1254902, 0.12941176, 0.13333333, 0.1372549
, 0.14117647, 0.14509804, 0.14901961, 0.15294118, 0.15686275, 0.16078431
, 0.16470588, 0.16862745, 0.17254902, 0.17647059, 0.18039216, 0.18431373
, 0.18823529, 0.19215686, 0.19607843, 0.2, 0.20392157, 0.20784314
, 0.21176471, 0.21568627, 0.21960784, 0.22352941, 0.22745098, 0.23137255
, 0.23529412, 0.23921569, 0.24313725, 0.24705882, 0.25098039, 0.25490196
, 0.25882353, 0.2627451, 0.26666667, 0.27058824, 0.2745098, 0.27843137
, 0.28235294, 0.28627451, 0.29019608, 0.29411765, 0.29803922, 0.30196078
, 0.30588235, 0.30980392, 0.31372549, 0.31764706, 0.32156863, 0.3254902
, 0.32941176, 0.33333333, 0.3372549, 0.34117647, 0.34509804, 0.34901961
, 0.35294118, 0.35686275, 0.36078431, 0.36470588, 0.36862745, 0.37254902
, 0.37647059, 0.38039216, 0.38431373, 0.38823529, 0.39215686, 0.39607843
, 0.4, 0.40392157, 0.40784314, 0.41176471, 0.41568627, 0.41960784
, 0.42352941, 0.42745098, 0.43137255, 0.43529412, 0.43921569, 0.44313725
, 0.44705882, 0.45098039, 0.45490196, 0.45882353, 0.4627451, 0.46666667
, 0.47058824, 0.4745098, 0.47843137, 0.48235294, 0.48627451, 0.49019608
, 0.49411765, 0.49803922, 0.50196078, 0.50588235, 0.50980392, 0.51372549
, 0.51764706, 0.52156863, 0.5254902, 0.52941176, 0.53333333, 0.5372549
, 0.54117647, 0.54509804, 0.54901961, 0.55294118, 0.55686275, 0.56078431
, 0.56470588, 0.56862745, 0.57254902, 0.57647059, 0.58039216, 0.58431373
, 0.58823529, 0.59215686, 0.59607843, 0.6, 0.60392157, 0.60784314
, 0.61176471, 0.61568627, 0.61960784, 0.62352941, 0.62745098, 0.63137255
, 0.63529412, 0.63921569, 0.64313725, 0.64705882, 0.65098039, 0.65490196
, 0.65882353, 0.6627451, 0.66666667, 0.67058824, 0.6745098, 0.67843137
, 0.68235294, 0.68627451, 0.69019608, 0.69411765, 0.69803922, 0.70196078
, 0.70588235, 0.70980392, 0.71372549, 0.71764706, 0.72156863, 0.7254902
, 0.72941176, 0.73333333, 0.7372549, 0.74117647, 0.74509804, 0.74901961
, 0.75294118, 0.75686275, 0.76078431, 0.76470588, 0.76862745, 0.77254902
, 0.77647059, 0.78039216, 0.78431373, 0.78823529, 0.79215686, 0.79607843
, 0.8, 0.80392157, 0.80784314, 0.81176471, 0.81568627, 0.81960784
, 0.82352941, 0.82745098, 0.83137255, 0.83529412, 0.83921569, 0.84313725
, 0.84705882, 0.85098039, 0.85490196, 0.85882353, 0.8627451, 0.86666667
, 0.87058824, 0.8745098, 0.87843137, 0.88235294, 0.88627451, 0.89019608
, 0.89411765, 0.89803922, 0.90196078, 0.90588235, 0.90980392, 0.91372549
, 0.91764706, 0.92156863, 0.9254902, 0.92941176, 0.93333333, 0.9372549
, 0.94117647, 0.94509804, 0.94901961, 0.95294118, 0.95686275, 0.96078431
, 0.96470588, 0.96862745, 0.97254902, 0.97647059, 0.98039216, 0.98431373
, 0.98823529, 0.99215686, 0.99607843, 1.])
colour = np.array([[68.08602, 1.24287, 84.000825, 255], [68.47005, 2.449275, 85.533885, 255],
[68.83572000000001, 3.729375, 87.051645, 255], [69.182775, 5.08521, 88.553595, 255],
[69.51147, 6.518565, 90.038715, 255], [69.821295, 8.031735, 91.507515, 255],
[70.11276, 9.62676, 92.958465, 255], [70.38561, 11.262585, 94.39182, 255],
[70.63959, 12.83772, 95.807325, 255], [70.874955, 14.36262, 97.203705, 255],
[71.091705, 15.846975, 98.58096, 255], [71.28932999999999, 17.29818, 99.938835, 255],
[71.468085, 18.721335, 101.27656499999999, 255], [71.62796999999999, 20.121285, 102.593895, 255],
[71.76872999999999, 21.5016, 103.89057, 255], [71.89062, 22.864829999999998, 105.165825, 255],
[71.993385, 24.213525, 106.419405, 255], [72.07728, 25.549979999999998, 107.65079999999999, 255],
[72.14205, 26.875215, 108.86001, 255], [72.188205, 28.191015, 110.04626999999999, 255],
[72.21523499999999, 29.4984, 111.20932499999999, 255],
[72.223395, 30.798135, 112.34891999999999, 255],
[72.21268500000001, 32.09124, 113.46480000000001, 255], [72.18336, 33.378225, 114.556455, 255],
[72.13542000000001, 34.659600000000005, 115.623885, 255], [72.068865, 35.93613, 116.666835, 255],
[71.98395, 37.207559999999994, 117.68504999999999, 255], [71.881185, 38.474655, 118.678275, 255],
[71.76006, 39.73767, 119.646255, 255], [71.62134, 40.996605, 120.589245, 255],
[71.465025, 42.251715000000004, 121.50698999999999, 255], [71.29137, 43.502745, 122.399235, 255],
[71.10063000000001, 44.74995, 123.26623500000001, 255],
[70.89305999999999, 45.993585, 124.10773499999999, 255], [70.66917, 47.23314, 124.92399, 255],
[70.42947, 48.468869999999995, 125.715255, 255], [70.173705, 49.700775, 126.481275, 255],
[69.90263999999999, 50.928855000000006, 127.22230499999999, 255],
[69.61653000000001, 52.1526, 127.93885499999999, 255], [69.31614, 53.372265, 128.63067, 255],
[69.001725, 54.587595, 129.29826, 255], [68.67354, 55.798590000000004, 129.94213499999998, 255],
[68.33184, 57.004995, 130.56204, 255], [67.97789999999999, 58.20681, 131.15899499999998, 255],
[67.611975, 59.40378, 131.732745, 255], [67.234065, 60.595905, 132.28430999999998, 255],
[66.84519, 61.78293, 132.813435, 255], [66.445605, 62.96511, 133.32113999999999, 255],
[66.036075, 64.141935, 133.80768, 255], [65.61711, 65.31315000000001, 134.273565, 255],
[65.189475, 66.479265, 134.71956, 255], [64.75342500000001, 67.63977, 135.145665, 255],
[64.30946999999999, 68.794665, 135.552645, 255], [63.858375, 69.94395, 135.941265, 255],
[63.400394999999996, 71.087625, 136.31178, 255], [62.936805, 72.225435, 136.664955, 255],
[62.46786, 73.35712500000001, 137.0013, 255], [61.993815, 74.48346000000001, 137.32158, 255],
[61.515435000000004, 75.603675, 137.625795, 255], [61.03323, 76.718025, 137.91522, 255],
[60.54745500000001, 77.82651, 138.189855, 255], [60.05913, 78.929385, 138.45072, 255],
[59.568765, 80.02614, 138.69807, 255], [59.07687, 81.11703, 138.93267, 255],
[58.583445, 82.202055, 139.15503, 255], [58.089510000000004, 83.28147, 139.36566, 255],
[57.595065000000005, 84.355275, 139.56507, 255], [57.100875, 85.42347000000001, 139.753515, 255],
[56.607195, 86.486055, 139.93176, 255], [56.114535000000004, 87.543285, 140.10031500000002, 255],
[55.623149999999995, 88.59516, 140.25969, 255], [55.13355000000001, 89.641425, 140.409885, 255],
[54.64599, 90.682845, 140.55192, 255], [54.160725, 91.71916499999999, 140.68605, 255],
[53.678264999999996, 92.75038500000001, 140.81252999999998, 255],
[53.198865, 93.77676000000001, 140.932125, 255], [52.72278, 94.79829, 141.044835, 255],
[52.250265, 95.81523, 141.15091500000003, 255], [51.781065, 96.82758, 141.250875, 255],
[51.315945, 97.83585000000001, 141.34497, 255], [50.85465, 98.83978499999999, 141.43371, 255],
[50.39718, 99.83964, 141.517095, 255], [49.9443, 100.835415, 141.59538, 255],
[49.4955, 101.827365, 141.669075, 255], [49.051035, 102.81574499999999, 141.73818, 255],
[48.610904999999995, 103.800555, 141.80269500000003, 255],
[48.175365, 104.78205, 141.86312999999998, 255],
[47.743905000000005, 105.76023, 141.919485, 255], [47.31678, 106.73535, 141.97201500000003, 255],
[46.89399, 107.707665, 142.02072, 255], [46.47528, 108.67692, 142.0656, 255],
[46.060395, 109.643625, 142.10691000000003, 255],
[45.649845000000006, 110.60777999999999, 142.14464999999998, 255],
[45.242865, 111.569385, 142.17907499999998, 255],
[44.839455, 112.52895000000001, 142.209675, 255],
[44.439870000000006, 113.48622, 142.23695999999998, 255],
[44.043345, 114.441705, 142.260675, 255],
[43.649879999999996, 115.39515, 142.28107500000002, 255], [43.25973, 116.34681, 142.29765, 255],
[42.87213, 117.29694, 142.31090999999998, 255], [42.487334999999995, 118.24554, 142.320345, 255],
[42.104835, 119.192865, 142.325955, 255],
[41.724374999999995, 120.13891500000001, 142.32774, 255],
[41.34621, 121.08368999999999, 142.32569999999998, 255],
[40.969575, 122.02770000000001, 142.31932500000002, 255],
[40.59447, 122.97043500000001, 142.308615, 255],
[40.220895, 123.91265999999999, 142.293315, 255], [39.84885, 124.85412, 142.27367999999998, 255],
[39.477825, 125.794815, 142.2492, 255], [39.10782, 126.735, 142.21962, 255],
[38.73909, 127.67467500000001, 142.184685, 255], [38.37138, 128.614095, 142.14464999999998, 255],
[38.004945, 129.553005, 142.09875, 255], [37.639784999999996, 130.491915, 142.047495, 255],
[37.2759, 131.430315, 141.98986499999998, 255], [36.913545, 132.368715, 141.92586, 255],
[36.552465, 133.307115, 141.855225, 255],
[36.193425000000005, 134.24551499999998, 141.777705, 255],
[35.83668, 135.18366, 141.693045, 255], [35.482485, 136.12205999999998, 141.60099, 255],
[35.13135, 137.06046, 141.50103000000001, 255],
[34.78404, 137.99911500000002, 141.39316499999998, 255],
[34.441829999999996, 138.93751500000002, 141.27739499999998, 255],
[34.104465, 139.876425, 141.152955, 255], [33.77322, 140.81508000000002, 141.01959, 255],
[33.44886, 141.754245, 140.877045, 255], [33.132915, 142.69341, 140.72532, 255],
[32.825895, 143.632575, 140.56339499999999, 255], [32.52984, 144.57199500000002, 140.39178, 255],
[32.245515000000005, 145.511415, 140.20945500000002, 255], [31.97547, 146.45109, 140.01693, 255],
[31.720725, 147.39051, 139.813185, 255], [31.483065, 148.330185, 139.59847499999998, 255],
[31.26453, 149.26960499999998, 139.37203499999998, 255],
[31.066905, 150.209025, 139.133865, 255], [30.89274, 151.148445, 138.883455, 255],
[30.744075000000002, 152.08761, 138.620805, 255], [30.62346, 153.02652, 138.34515, 255],
[30.533189999999998, 153.96517500000002, 138.057, 255],
[30.475559999999998, 154.90332, 137.75558999999998, 255],
[30.452865, 155.840955, 137.44040999999999, 255],
[30.468165000000003, 156.778335, 137.11146, 255], [30.523245, 157.71495, 136.768485, 255],
[30.620655, 158.65105499999999, 136.41123000000002, 255],
[30.76269, 159.58614, 136.03943999999998, 255], [30.951900000000002, 160.52046, 135.653115, 255],
[31.18956, 161.454015, 135.25149000000002, 255], [31.47822, 162.386295, 134.834565, 255],
[31.8189, 163.317555, 134.40233999999998, 255], [32.21313, 164.247285, 133.954305, 255],
[32.662185, 165.175995, 133.490205, 255], [33.167085, 166.10291999999998, 133.01004, 255],
[33.728339999999996, 167.02857, 132.513555, 255], [34.34646, 167.95218, 132.000495, 255],
[35.021445, 168.87426, 131.470605, 255], [35.75355, 169.79404499999998, 130.92388499999998, 255],
[36.542265, 170.71204500000002, 130.359825, 255], [37.38708, 171.62775000000002, 129.77868, 255],
[38.28774, 172.540905, 129.180195, 255], [39.24297, 173.451765, 128.56385999999998, 255],
[40.252005, 174.360075, 127.92992999999998, 255], [41.31408, 175.26558, 127.277895, 255],
[42.427665, 176.16828, 126.60801, 255], [43.591739999999994, 177.06792, 125.919765, 255],
[44.805285, 177.9645, 125.213415, 255], [46.066515, 178.85751, 124.48819499999999, 255],
[47.374665, 179.747205, 123.744615, 255], [48.72795, 180.63333, 122.98241999999999, 255],
[50.125605, 181.515885, 122.201355, 255], [51.565845, 182.39436, 121.40142, 255],
[53.04765, 183.268755, 120.58261499999999, 255], [54.57, 184.13907, 119.74494, 255],
[56.13162, 185.004795, 118.88762999999999, 255],
[57.731235, 185.86643999999998, 118.011195, 255],
[59.367824999999996, 186.722985, 117.115635, 255], [61.04037, 187.57494, 116.20044, 255],
[62.74785, 188.42204999999998, 115.26612, 255], [64.489245, 189.263805, 114.31242, 255],
[66.263535, 190.10046, 113.339085, 255], [68.069955, 190.93150500000002, 112.346115, 255],
[69.907995, 191.75694, 111.33325500000001, 255], [71.776635, 192.576765, 110.30076, 255],
[73.674855, 193.39047, 109.24862999999999, 255], [75.602145, 194.198055, 108.176865, 255],
[77.55774, 194.99952000000002, 107.085465, 255], [79.540875, 195.79461, 105.97443, 255],
[81.551295, 196.58307, 104.84376, 255], [83.58797999999999, 197.3649, 103.6932, 255],
[85.65067499999999, 198.13959, 102.52249499999999, 255],
[87.73886999999999, 198.90739499999998, 101.332155, 255],
[89.8518, 199.66780500000002, 100.12218, 255],
[91.98895499999999, 200.42082, 98.89256999999999, 255],
[94.14957, 201.16644000000002, 97.64307, 255],
[96.33364499999999, 201.904155, 96.37444500000001, 255],
[98.54041500000001, 202.63422, 95.08593, 255],
[100.76937000000001, 203.35612500000002, 93.778035, 255],
[103.020255, 204.070125, 92.45076, 255], [105.29281499999999, 204.775455, 91.103595, 255],
[107.58654, 205.47236999999998, 89.73705, 255], [109.900665, 206.160615, 88.35138, 255],
[112.23493500000001, 206.84019, 86.946585, 255], [114.58883999999999, 207.51084, 85.52292, 255],
[116.96187, 208.172565, 84.08038499999999, 255], [119.353515, 208.824855, 82.61949, 255],
[121.76352, 209.46821999999997, 81.139725, 255], [124.19163, 210.101895, 79.641855, 255],
[126.63682499999999, 210.72588, 78.126135, 255], [129.099105, 211.34043, 76.59231, 255],
[131.57796, 211.94529, 75.041145, 255], [134.07288, 212.540205, 73.472385, 255],
[136.583355, 213.125175, 71.88654, 255], [139.10862, 213.69994499999999, 70.28462999999999, 255],
[141.64842, 214.26477, 68.66665499999999, 255], [144.20199, 214.81965, 67.033635, 255],
[146.76856500000002, 215.36433000000002, 65.385825, 255],
[149.34789, 215.898555, 63.723735000000005, 255],
[151.938945, 216.42283500000002, 62.048894999999995, 255],
[154.541475, 216.936915, 60.361560000000004, 255],
[157.15471499999998, 217.440795, 58.66326, 255],
[159.777645, 217.934475, 56.955014999999996, 255], [162.41001, 218.41821000000002, 55.2381, 255],
[165.050535, 218.89200000000002, 53.514555, 255],
[167.69870999999998, 219.355845, 51.78591, 255], [170.35377, 219.809745, 50.054715, 255],
[173.014695, 220.25421, 48.323265, 255], [175.68072, 220.68924, 46.594875, 255],
[178.35082500000001, 221.114835, 44.872605, 255],
[181.02399, 221.531505, 43.160534999999996, 255], [183.699705, 221.93925, 41.463765, 255],
[186.376695, 222.33858, 39.787395000000004, 255],
[189.05394, 222.72949500000001, 38.138055, 255], [191.73042, 223.112505, 36.52314, 255],
[194.405115, 223.48812, 34.951319999999996, 255], [197.07726, 223.85634, 33.432795, 255],
[199.745325, 224.21767499999999, 31.978274999999996, 255], [202.4088, 224.57289, 30.601275, 255],
[205.06641, 224.92173, 29.316074999999998, 255], [207.71688, 225.26521499999998, 28.138485, 255],
[210.3597, 225.6036, 27.085335, 255], [212.99384999999998, 225.93739499999998, 26.17473, 255],
[215.618055, 226.26711, 25.42401, 255], [218.23155, 226.593255, 24.85026, 255],
[220.833315, 226.91634, 24.468014999999998, 255],
[223.42283999999998, 227.236875, 24.28875, 255], [225.99910500000001, 227.55537, 24.32037, 255],
[228.5616, 227.87207999999998, 24.565425, 255], [231.109305, 228.18802499999998, 25.021875, 255],
[233.64171, 228.50320499999998, 25.682835, 255],
[236.15703, 228.81914999999998, 26.538104999999998, 255], [238.65552, 229.13535, 27.573405, 255],
[241.13718, 229.45282500000002, 28.77369, 255], [243.60150000000002, 229.771575, 30.12264, 255],
[246.04797000000002, 230.092365, 31.604955, 255], [248.476335, 230.41545, 33.204825, 255],
[250.88634, 230.741085, 34.908735, 255], [253.27824, 231.070035, 36.703680000000006, 255]],
dtype=np.ubyte)
mode = 'rgb'
# inferno
elif cmap == 'Inferno':
pos = np.array([0., 0.00392157, 0.00784314, 0.01176471, 0.01568627, 0.01960784
, 0.02352941, 0.02745098, 0.03137255, 0.03529412, 0.03921569, 0.04313725
, 0.04705882, 0.05098039, 0.05490196, 0.05882353, 0.0627451, 0.06666667
, 0.07058824, 0.0745098, 0.07843137, 0.08235294, 0.08627451, 0.09019608
, 0.09411765, 0.09803922, 0.10196078, 0.10588235, 0.10980392, 0.11372549
, 0.11764706, 0.12156863, 0.1254902, 0.12941176, 0.13333333, 0.1372549
, 0.14117647, 0.14509804, 0.14901961, 0.15294118, 0.15686275, 0.16078431
, 0.16470588, 0.16862745, 0.17254902, 0.17647059, 0.18039216, 0.18431373
, 0.18823529, 0.19215686, 0.19607843, 0.2, 0.20392157, 0.20784314
, 0.21176471, 0.21568627, 0.21960784, 0.22352941, 0.22745098, 0.23137255
, 0.23529412, 0.23921569, 0.24313725, 0.24705882, 0.25098039, 0.25490196
, 0.25882353, 0.2627451, 0.26666667, 0.27058824, 0.2745098, 0.27843137
, 0.28235294, 0.28627451, 0.29019608, 0.29411765, 0.29803922, 0.30196078
, 0.30588235, 0.30980392, 0.31372549, 0.31764706, 0.32156863, 0.3254902
, 0.32941176, 0.33333333, 0.3372549, 0.34117647, 0.34509804, 0.34901961
, 0.35294118, 0.35686275, 0.36078431, 0.36470588, 0.36862745, 0.37254902
, 0.37647059, 0.38039216, 0.38431373, 0.38823529, 0.39215686, 0.39607843
, 0.4, 0.40392157, 0.40784314, 0.41176471, 0.41568627, 0.41960784
, 0.42352941, 0.42745098, 0.43137255, 0.43529412, 0.43921569, 0.44313725
, 0.44705882, 0.45098039, 0.45490196, 0.45882353, 0.4627451, 0.46666667
, 0.47058824, 0.4745098, 0.47843137, 0.48235294, 0.48627451, 0.49019608
, 0.49411765, 0.49803922, 0.50196078, 0.50588235, 0.50980392, 0.51372549
, 0.51764706, 0.52156863, 0.5254902, 0.52941176, 0.53333333, 0.5372549
, 0.54117647, 0.54509804, 0.54901961, 0.55294118, 0.55686275, 0.56078431
, 0.56470588, 0.56862745, 0.57254902, 0.57647059, 0.58039216, 0.58431373
, 0.58823529, 0.59215686, 0.59607843, 0.6, 0.60392157, 0.60784314
, 0.61176471, 0.61568627, 0.61960784, 0.62352941, 0.62745098, 0.63137255
, 0.63529412, 0.63921569, 0.64313725, 0.64705882, 0.65098039, 0.65490196
, 0.65882353, 0.6627451, 0.66666667, 0.67058824, 0.6745098, 0.67843137
, 0.68235294, 0.68627451, 0.69019608, 0.69411765, 0.69803922, 0.70196078
, 0.70588235, 0.70980392, 0.71372549, 0.71764706, 0.72156863, 0.7254902
, 0.72941176, 0.73333333, 0.7372549, 0.74117647, 0.74509804, 0.74901961
, 0.75294118, 0.75686275, 0.76078431, 0.76470588, 0.76862745, 0.77254902
, 0.77647059, 0.78039216, 0.78431373, 0.78823529, 0.79215686, 0.79607843
, 0.8, 0.80392157, 0.80784314, 0.81176471, 0.81568627, 0.81960784
, 0.82352941, 0.82745098, 0.83137255, 0.83529412, 0.83921569, 0.84313725
, 0.84705882, 0.85098039, 0.85490196, 0.85882353, 0.8627451, 0.86666667
, 0.87058824, 0.8745098, 0.87843137, 0.88235294, 0.88627451, 0.89019608
, 0.89411765, 0.89803922, 0.90196078, 0.90588235, 0.90980392, 0.91372549
, 0.91764706, 0.92156863, 0.9254902, 0.92941176, 0.93333333, 0.9372549
, 0.94117647, 0.94509804, 0.94901961, 0.95294118, 0.95686275, 0.96078431
, 0.96470588, 0.96862745, 0.97254902, 0.97647059, 0.98039216, 0.98431373
, 0.98823529, 0.99215686, 0.99607843, 1.])
colour = np.array([[0.37281, 0.11883, 3.53583, 255], [0.578085, 0.32385, 4.7353499999999995, 255],
[0.8412449999999999, 0.5734950000000001, 6.180945, 255],
[1.1594849999999999, 0.8649600000000001, 7.881794999999999, 255],
[1.53153, 1.19646, 9.83229, 255], [1.95738, 1.56468, 11.94318, 255],
[2.438055, 1.966815, 14.061465, 255], [2.974065, 2.401335, 16.1823, 255],
[3.568725, 2.862375, 18.32481, 255], [4.223055, 3.34968, 20.47191, 255],
[4.9401150000000005, 3.858915, 22.635585, 255], [5.723985000000001, 4.385745, 24.818385, 255],
[6.577215, 4.929405, 27.01215, 255], [7.50516, 5.483265, 29.228355, 255],
[8.513175, 6.04401, 31.466235, 255], [9.60534, 6.609855, 33.719159999999995, 255],
[10.774515, 7.175445, 35.990955, 255], [11.963325, 7.73262, 38.29182, 255],
[13.169220000000001, 8.28087, 40.609770000000005, 255],
[14.394495, 8.815095000000001, 42.945570000000004, 255],
[15.6417, 9.330449999999999, 45.29871, 255], [16.914405, 9.81852, 47.675309999999996, 255],
[18.214395000000003, 10.274970000000001, 50.07027, 255],
[19.542434999999998, 10.685775, 52.478745, 255],
[20.900309999999998, 11.048639999999999, 54.898695000000004, 255],
[22.289805, 11.36178, 57.327315000000006, 255], [23.71245, 11.623664999999999, 59.76129, 255],
[25.16901, 11.83251, 62.19552, 255], [26.660505, 11.98704, 64.62465, 255],
[28.18668, 12.086744999999999, 67.04256, 255], [29.74728, 12.13137, 69.44185499999999, 255],
[31.341540000000002, 12.121680000000001, 71.81412, 255],
[32.967675, 12.059715, 74.15093999999999, 255], [34.62339, 11.94828, 76.44288, 255],
[36.30639, 11.79171, 78.681015, 255], [38.013615, 11.59434, 80.856675, 255],
[39.741749999999996, 11.362545, 82.96119, 255], [41.485695, 11.10627, 84.985635, 255],
[43.241625, 10.834695, 86.92287, 255], [45.005715, 10.55751, 88.768305, 255],
[46.774395000000005, 10.283895, 90.51760499999999, 255], [48.543585, 10.023795, 92.168985, 255],
[50.310735, 9.792, 93.721425, 255], [52.073295, 9.59616, 95.17569, 255],
[53.829225, 9.44265, 96.533565, 255], [55.576995000000004, 9.336825000000001, 97.79811, 255],
[57.314564999999995, 9.283275, 98.972895, 255], [59.04219, 9.283275, 100.06200000000001, 255],
[60.759615000000004, 9.338355, 101.070015, 255],
[62.466584999999995, 9.449024999999999, 102.001785, 255], [64.1631, 9.614775, 102.86139, 255],
[65.84967, 9.835605000000001, 103.65367499999999, 255], [67.52655, 10.109985, 104.382975, 255],
[69.193485, 10.43511, 105.05388, 255], [70.85175, 10.800015, 105.66995999999999, 255],
[72.50185499999999, 11.202915, 106.23504, 255], [74.144565, 11.63922, 106.75243499999999, 255],
[75.78039, 12.104849999999999, 107.225205, 255], [77.40984, 12.59598, 107.65641, 255],
[79.03342500000001, 13.108785000000001, 108.048855, 255], [80.65191, 13.63995, 108.40458, 255],
[82.26555, 14.186670000000001, 108.726135, 255],
[83.87485500000001, 14.745885000000001, 109.015305, 255],
[85.480335, 15.3153, 109.27362000000001, 255], [87.08250000000001, 15.892875, 109.503375, 255],
[88.681605, 16.47708, 109.705335, 255], [90.27816, 17.065875, 109.88103000000001, 255],
[91.87242, 17.657985, 110.03173500000001, 255], [93.464895, 18.252645, 110.15847, 255],
[95.05584, 18.848325, 110.262, 255], [96.64525499999999, 19.444515, 110.343345, 255],
[98.23314, 20.040705, 110.40352499999999, 255], [99.820515, 20.636385, 110.442795, 255],
[101.40687000000001, 21.230535, 110.461665, 255], [102.99297, 21.8229, 110.460645, 255],
[104.578815, 22.41348, 110.43999, 255],
[106.164405, 23.001765000000002, 110.40046500000001, 255],
[107.749995, 23.587755, 110.34206999999999, 255], [109.33583999999999, 24.17145, 110.26506, 255],
[110.921685, 24.752595, 110.169945, 255], [112.507785, 25.33119, 110.05646999999999, 255],
[114.09414, 25.907235, 109.92540000000001, 255], [115.68100500000001, 26.48124, 109.77699, 255],
[117.268125, 27.052695, 109.61073, 255], [118.8555, 27.62211, 109.426875, 255],
[120.44364, 28.189485, 109.22516999999999, 255],
[122.03228999999999, 28.754820000000002, 109.006125, 255],
[123.621195, 29.31837, 108.76974, 255], [125.21061, 29.880645, 108.51576, 255],
[126.800535, 30.441645, 108.24444, 255], [128.390715, 31.001625, 107.95578, 255],
[129.98115, 31.561095, 107.64977999999999, 255], [131.571585, 32.1198, 107.32618500000001, 255],
[133.16252999999998, 32.67825, 106.984995, 255], [134.75322, 33.236955, 106.62621, 255],
[136.344165, 33.796170000000004, 106.250085, 255],
[137.9346, 34.355895, 105.85636500000001, 255], [139.525035, 34.916895, 105.445305, 255],
[141.11496, 35.47917, 105.016395, 255], [142.70412, 36.04323, 104.56989, 255],
[144.29277, 36.609585, 104.10579, 255], [145.880655, 37.178235, 103.624095, 255],
[147.46752, 37.749945000000004, 103.12480500000001, 255],
[149.052855, 38.32497, 102.608175, 255], [150.63717, 38.903565, 102.07395, 255],
[152.21970000000002, 39.48624, 101.52187500000001, 255],
[153.800445, 40.073505000000004, 100.95220499999999, 255],
[155.37915, 40.66587, 100.365195, 255], [156.955815, 41.263335, 99.76084499999999, 255],
[158.529675, 41.86692, 99.139155, 255], [160.100985, 42.476625, 98.50038, 255],
[161.66949, 43.09296, 97.84452, 255], [163.23442500000002, 43.71669, 97.17157499999999, 255],
[164.79629999999997, 44.34807, 96.481545, 255], [166.354095, 44.987355, 95.77443, 255],
[167.908065, 45.635310000000004, 95.05074, 255], [169.45770000000002, 46.292445, 94.31073, 255],
[171.00274499999998, 46.959015, 93.554145, 255], [172.54269, 47.635785, 92.78149499999999, 255],
[174.07728, 48.322755, 91.99303499999999, 255], [175.606515, 49.020945, 91.188765, 255],
[177.129885, 49.730355, 90.36894, 255], [178.64687999999998, 50.452005, 89.533815, 255],
[180.1575, 51.18564, 88.68313500000001, 255], [181.66098, 51.93228, 87.817665, 255],
[183.15732, 52.69217999999999, 86.937405, 255], [184.646265, 53.465849999999996, 86.04312, 255],
[186.12679500000002, 54.253545, 85.134555, 255], [187.599165, 55.05603, 84.212475, 255],
[189.06286500000002, 55.87356, 83.27687999999999, 255],
[190.517385, 56.70639, 82.32827999999999, 255], [191.96247, 57.555029999999995, 81.366675, 255],
[193.39761000000001, 58.419734999999996, 80.39283, 255],
[194.82254999999998, 59.30127, 79.406745, 255], [196.23678, 60.199635, 78.408675, 255],
[197.64004500000001, 61.115085, 77.39913, 255], [199.031835, 62.048384999999996, 76.378365, 255],
[200.411895, 62.99928, 75.34663499999999, 255],
[201.779715, 63.96828000000001, 74.30444999999999, 255],
[203.134785, 64.95564, 73.25232000000001, 255], [204.477105, 65.96187, 72.190245, 255],
[205.80590999999998, 66.98646, 71.11899, 255], [207.120945, 68.03043000000001, 70.038555, 255],
[208.421955, 69.09326999999999, 68.94945, 255], [209.70843, 70.175235, 67.851675, 255],
[210.97986, 71.276835, 66.74624999999999, 255],
[212.236245, 72.39781500000001, 65.63266499999999, 255], [213.477075, 73.538175, 64.51194, 255],
[214.70209499999999, 74.697915, 63.38382, 255], [215.910795, 75.877545, 62.248815, 255],
[217.10292, 77.07629999999999, 61.10718, 255],
[218.27796, 78.29468999999999, 59.958915000000005, 255], [219.435915, 79.53246, 58.80453, 255],
[220.57653000000002, 80.78961, 57.644025, 255], [221.699295, 82.065885, 56.47791, 255],
[222.803955, 83.36103, 55.30593, 255], [223.890255, 84.67530000000001, 54.12834, 255],
[224.95793999999998, 86.008185, 52.94514, 255], [226.00701, 87.35943, 51.756840000000004, 255],
[227.036955, 88.72903500000001, 50.562929999999994, 255],
[228.047775, 90.11674500000001, 49.36392, 255], [229.03896, 91.52230499999999, 48.1593, 255],
[230.010765, 92.94546, 46.94958, 255], [230.962425, 94.3857, 45.73425, 255],
[231.89445, 95.84328000000001, 44.513565, 255], [232.80633, 97.31718, 43.287524999999995, 255],
[233.69781, 98.80765500000001, 42.05562, 255], [234.569145, 100.314195, 40.81785, 255],
[235.419825, 101.836545, 39.574215, 255], [236.24985, 103.374195, 38.32446, 255],
[237.05922, 104.927145, 37.068585, 255], [237.847935, 106.49488500000001, 35.806335, 255],
[238.615485, 108.076905, 34.5372, 255], [239.36212500000002, 109.673205, 33.26169, 255],
[240.08785500000002, 111.283275, 31.979294999999997, 255],
[240.792675, 112.90686, 30.69027, 255], [241.47607499999998, 114.543705, 29.39436, 255],
[242.13831000000002, 116.19330000000001, 28.09182, 255], [242.779125, 117.85539, 26.782905, 255],
[243.39902999999998, 119.52972, 25.46787, 255], [243.99726, 121.21578, 24.147225, 255],
[244.57407, 122.91356999999999, 22.822245, 255],
[245.12971499999998, 124.62258, 21.493695000000002, 255],
[245.663685, 126.34281, 20.163615, 255], [246.176235, 128.07349499999998, 18.834045, 255],
[246.66711, 129.81489000000002, 17.508045, 255], [247.136565, 131.56623, 16.18944, 255],
[247.58434499999998, 133.327515, 14.883585, 255],
[248.01045, 135.09849, 13.597620000000001, 255], [248.41488, 136.87890000000002, 12.33996, 255],
[248.797635, 138.66849, 11.122589999999999, 255], [249.15846, 140.46675, 9.95775, 255],
[249.49761, 142.273935, 8.907404999999999, 255], [249.81483, 144.089535, 8.009295, 255],
[250.11012, 145.913295, 7.269539999999999, 255], [250.38322499999998, 147.74496, 6.69375, 255],
[250.634655, 149.58453, 6.288555, 255], [250.863645, 151.43149499999998, 6.06135, 255],
[251.070705, 153.28611, 6.01953, 255], [251.255325, 155.14761000000001, 6.1715100000000005, 255],
[251.41776000000002, 157.01625, 6.52596, 255], [251.55801, 158.891775, 7.092569999999999, 255],
[251.67582, 160.773675, 7.88154, 255], [251.770935, 162.66195, 8.90358, 255],
[251.84361, 164.5566, 10.17093, 255], [251.893845, 166.45711500000002, 11.623155, 255],
[251.92113, 168.36375, 13.19625, 255], [251.925975, 170.27574, 14.873895, 255],
[251.90787, 172.193085, 16.640535, 255],
[251.86706999999998, 174.11578500000002, 18.484695, 255],
[251.80332, 176.04333, 20.397450000000003, 255], [251.71662, 177.97572, 22.371405, 255],
[251.60697, 179.91269999999997, 24.40197, 255], [251.474625, 181.854015, 26.485065, 255],
[251.31933, 183.79941, 28.618395, 255], [251.14057499999998, 185.748885, 30.800175, 255],
[250.93912500000002, 187.70218500000001, 33.029385, 255], [250.71498, 189.65829, 35.305515, 255],
[250.46814, 191.61771000000002, 37.629075, 255],
[250.19911499999998, 193.57942500000001, 40.000065, 255],
[249.90816, 195.543435, 42.420015, 255], [249.59553, 197.50897500000002, 44.889435, 255],
[249.261735, 199.47579, 47.410365, 255], [248.90753999999998, 201.44337, 49.98459, 255],
[248.53269, 203.41145999999998, 52.61465999999999, 255], [248.13744, 205.379295, 55.303635, 255],
[247.72434, 207.34611, 58.05279, 255], [247.29466499999998, 209.310375, 60.86493, 255],
[246.850455, 211.271325, 63.74286, 255], [246.391965, 213.228705, 66.69117, 255],
[245.92047, 215.18124, 69.714705, 255], [245.441835, 217.12638, 72.81423000000001, 255],
[244.95963, 219.062595, 75.99255, 255], [244.4736, 220.98911999999999, 79.25909999999999, 255],
[243.99267, 222.902895, 82.61336999999999, 255],
[243.524235, 224.800095, 86.05612500000001, 255],
[243.069825, 226.68021000000002, 89.59909499999999, 255],
[242.64423, 228.53762999999998, 93.23488499999999, 255],
[242.25459, 230.369295, 96.96910500000001, 255],
[241.91416500000003, 232.170615, 100.798695, 255], [241.63647, 233.936745, 104.719575, 255],
[241.436295, 235.66284, 108.725115, 255], [241.32996, 237.344055, 112.803585, 255],
[241.332765, 238.97554499999998, 116.94096, 255],
[241.46026500000002, 240.55374, 121.11735, 255],
[241.723935, 242.07609, 125.31362999999999, 255], [242.133975, 243.541065, 129.5043, 255],
[242.6937, 244.949685, 133.671765, 255], [243.40489499999998, 246.30348, 137.792055, 255],
[244.26348, 247.605765, 141.850125, 255], [245.26206, 248.86062, 145.840875, 255],
[246.393495, 250.07289, 149.73753, 255],
[247.64631, 251.24690999999999, 153.54926999999998, 255],
[249.01030500000002, 252.387015, 157.2738, 255], [250.475535, 253.497795, 160.909335, 255],
[252.03231, 254.58282, 164.45562, 255]], dtype=np.ubyte)
mode = 'rgb'
# plasma
elif cmap == 'Plasma':
pos = np.array([0., 0.00392157, 0.00784314, 0.01176471, 0.01568627, 0.01960784
, 0.02352941, 0.02745098, 0.03137255, 0.03529412, 0.03921569, 0.04313725
, 0.04705882, 0.05098039, 0.05490196, 0.05882353, 0.0627451, 0.06666667
, 0.07058824, 0.0745098, 0.07843137, 0.08235294, 0.08627451, 0.09019608
, 0.09411765, 0.09803922, 0.10196078, 0.10588235, 0.10980392, 0.11372549
, 0.11764706, 0.12156863, 0.1254902, 0.12941176, 0.13333333, 0.1372549
, 0.14117647, 0.14509804, 0.14901961, 0.15294118, 0.15686275, 0.16078431
, 0.16470588, 0.16862745, 0.17254902, 0.17647059, 0.18039216, 0.18431373
, 0.18823529, 0.19215686, 0.19607843, 0.2, 0.20392157, 0.20784314
, 0.21176471, 0.21568627, 0.21960784, 0.22352941, 0.22745098, 0.23137255
, 0.23529412, 0.23921569, 0.24313725, 0.24705882, 0.25098039, 0.25490196
, 0.25882353, 0.2627451, 0.26666667, 0.27058824, 0.2745098, 0.27843137
, 0.28235294, 0.28627451, 0.29019608, 0.29411765, 0.29803922, 0.30196078
, 0.30588235, 0.30980392, 0.31372549, 0.31764706, 0.32156863, 0.3254902
, 0.32941176, 0.33333333, 0.3372549, 0.34117647, 0.34509804, 0.34901961
, 0.35294118, 0.35686275, 0.36078431, 0.36470588, 0.36862745, 0.37254902
, 0.37647059, 0.38039216, 0.38431373, 0.38823529, 0.39215686, 0.39607843
, 0.4, 0.40392157, 0.40784314, 0.41176471, 0.41568627, 0.41960784
, 0.42352941, 0.42745098, 0.43137255, 0.43529412, 0.43921569, 0.44313725
, 0.44705882, 0.45098039, 0.45490196, 0.45882353, 0.4627451, 0.46666667
, 0.47058824, 0.4745098, 0.47843137, 0.48235294, 0.48627451, 0.49019608
, 0.49411765, 0.49803922, 0.50196078, 0.50588235, 0.50980392, 0.51372549
, 0.51764706, 0.52156863, 0.5254902, 0.52941176, 0.53333333, 0.5372549
, 0.54117647, 0.54509804, 0.54901961, 0.55294118, 0.55686275, 0.56078431
, 0.56470588, 0.56862745, 0.57254902, 0.57647059, 0.58039216, 0.58431373
, 0.58823529, 0.59215686, 0.59607843, 0.6, 0.60392157, 0.60784314
, 0.61176471, 0.61568627, 0.61960784, 0.62352941, 0.62745098, 0.63137255
, 0.63529412, 0.63921569, 0.64313725, 0.64705882, 0.65098039, 0.65490196
, 0.65882353, 0.6627451, 0.66666667, 0.67058824, 0.6745098, 0.67843137
, 0.68235294, 0.68627451, 0.69019608, 0.69411765, 0.69803922, 0.70196078
, 0.70588235, 0.70980392, 0.71372549, 0.71764706, 0.72156863, 0.7254902
, 0.72941176, 0.73333333, 0.7372549, 0.74117647, 0.74509804, 0.74901961
, 0.75294118, 0.75686275, 0.76078431, 0.76470588, 0.76862745, 0.77254902
, 0.77647059, 0.78039216, 0.78431373, 0.78823529, 0.79215686, 0.79607843
, 0.8, 0.80392157, 0.80784314, 0.81176471, 0.81568627, 0.81960784
, 0.82352941, 0.82745098, 0.83137255, 0.83529412, 0.83921569, 0.84313725
, 0.84705882, 0.85098039, 0.85490196, 0.85882353, 0.8627451, 0.86666667
, 0.87058824, 0.8745098, 0.87843137, 0.88235294, 0.88627451, 0.89019608
, 0.89411765, 0.89803922, 0.90196078, 0.90588235, 0.90980392, 0.91372549
, 0.91764706, 0.92156863, 0.9254902, 0.92941176, 0.93333333, 0.9372549
, 0.94117647, 0.94509804, 0.94901961, 0.95294118, 0.95686275, 0.96078431
, 0.96470588, 0.96862745, 0.97254902, 0.97647059, 0.98039216, 0.98431373
, 0.98823529, 0.99215686, 0.99607843, 1.])
colour = np.array([[12.847665, 7.599765, 134.633625, 255], [16.20168, 7.24863, 135.94662000000002, 255],
[19.215015, 6.937530000000001, 137.191785, 255], [21.98661, 6.661874999999999, 138.37779, 255],
[24.576645000000003, 6.417075, 139.511265, 255],
[27.024900000000002, 6.1987950000000005, 140.59884, 255], [29.35662, 6.00678, 141.64434, 255],
[31.595265, 5.833889999999999, 142.652865, 255], [33.757155, 5.67579, 143.62875, 255],
[35.853765, 5.530185, 144.574545, 255], [37.894785, 5.39427, 145.49331, 255],
[39.887355, 5.266005, 146.38657500000002, 255], [41.837849999999996, 5.143605, 147.25689, 255],
[43.75137, 5.02503, 148.10553000000002, 255], [45.63225, 4.90926, 148.93376999999998, 255],
[47.484314999999995, 4.794765, 149.74313999999998, 255],
[49.31037, 4.680269999999999, 150.53415, 255], [51.113475, 4.56501, 151.30782, 255],
[52.895925000000005, 4.44771, 152.064915, 255],
[54.65925, 4.3281149999999995, 152.80594499999998, 255],
[56.405235000000005, 4.206735, 153.53116500000002, 255],
[58.135664999999996, 4.081785, 154.241085, 255], [59.852325, 3.95301, 154.93596, 255],
[61.55598, 3.819645, 155.61604499999999, 255], [63.24816, 3.6819450000000002, 156.28134, 255],
[64.929885, 3.53991, 156.931845, 255], [66.601665, 3.3935400000000002, 157.567305, 255],
[68.26426500000001, 3.24258, 158.18822999999998, 255], [69.918705, 3.087795, 158.79411, 255],
[71.56524, 2.92944, 159.38469, 255], [73.20438, 2.768025, 159.960225, 255],
[74.83689000000001, 2.604315, 160.51995, 255], [76.463025, 2.438055, 161.06412, 255],
[78.08355, 2.27001, 161.59197, 255], [79.698465, 2.100945, 162.1035, 255],
[81.30828, 1.93188, 162.5982, 255], [82.91325, 1.763325, 163.07556, 255],
[84.51363, 1.596555, 163.53558, 255], [86.109165, 1.43259, 163.977495, 255],
[87.700875, 1.272705, 164.40105, 255], [89.28825, 1.1174099999999998, 164.80599, 255],
[90.871545, 0.9684900000000001, 165.19155, 255], [92.451015, 0.826965, 165.55747499999998, 255],
[94.02691499999999, 0.69462, 165.903255, 255],
[95.59873499999999, 0.572475, 166.22838000000002, 255],
[97.16698500000001, 0.46257000000000004, 166.53234, 255], [98.731665, 0.36567, 166.815135, 255],
[100.29252, 0.28407, 167.07574499999998, 255], [101.849805, 0.219045, 167.31391499999998, 255],
[103.403265, 0.17289, 167.529135, 255], [104.9529, 0.14713500000000002, 167.72115000000002, 255],
[106.49871, 0.14382, 167.88945, 255], [108.040695, 0.16473, 168.03378, 255],
[109.578345, 0.211905, 168.153375, 255], [111.11217, 0.287385, 168.248235, 255],
[112.64166, 0.3927, 168.317595, 255], [114.16707, 0.5304, 168.36120000000003, 255],
[115.687635, 0.7025250000000001, 168.37904999999998, 255],
[117.20386500000001, 0.91137, 168.370635, 255],
[118.71525000000001, 1.158975, 168.33544500000002, 255], [120.221535, 1.44789, 168.273735, 255],
[121.72272, 1.7799, 168.18499500000001, 255], [123.21855, 2.1573, 168.069225, 255],
[124.70902500000001, 2.582385, 167.92616999999998, 255],
[126.193635, 3.0574500000000002, 167.75557500000002, 255], [127.67289, 3.584025, 167.55744, 255],
[129.14577, 4.164915, 167.33150999999998, 255], [130.61253000000002, 4.802415, 167.078295, 255],
[132.072915, 5.498564999999999, 166.797795, 255],
[133.52641500000001, 6.255660000000001, 166.489755, 255],
[134.97303000000002, 7.0754850000000005, 166.15443, 255],
[136.41276, 7.960335000000001, 165.792075, 255], [137.84535, 8.91225, 165.4032, 255],
[139.270035, 9.93327, 164.98755, 255], [140.687325, 10.99968, 164.545635, 255],
[142.096965, 12.069405, 164.077965, 255], [143.49819, 13.143975, 163.58479499999999, 255],
[144.891255, 14.22339, 163.066635, 255], [146.27616, 15.307139999999999, 162.523995, 255],
[147.652395, 16.395480000000003, 161.95712999999998, 255],
[149.019705, 17.487645, 161.36706, 255], [150.378345, 18.58389, 160.75404, 255],
[151.727805, 19.683449999999997, 160.118835, 255], [153.06783, 20.78658, 159.46221, 255],
[154.39867500000003, 21.89277, 158.78493, 255],
[155.72008499999998, 23.00202, 158.08750500000002, 255], [157.03206, 24.11382, 157.3707, 255],
[158.334345, 25.22817, 156.635535, 255], [159.62668499999998, 26.34456, 155.882775, 255],
[160.909335, 27.463245, 155.11318500000002, 255], [162.18204, 28.58346, 154.327275, 255],
[163.44454499999998, 29.70546, 153.52657499999998, 255], [164.69736, 30.82899, 152.711085, 255],
[165.94023, 31.953795, 151.88233499999998, 255],
[167.17290000000003, 33.079875, 151.040835, 255],
[168.39537, 34.206720000000004, 150.18760500000002, 255],
[169.60789499999998, 35.33433, 149.32341000000002, 255],
[170.810475, 36.46296, 148.44926999999998, 255], [172.00311, 37.591845, 147.56544, 255],
[173.1858, 38.72124, 146.673195, 255], [174.35828999999998, 39.85089, 145.77329999999998, 255],
[175.52109, 40.980795, 144.866265, 255], [176.6742, 42.110955000000004, 143.95310999999998, 255],
[177.81762, 43.241115, 143.03434499999997, 255], [178.95109499999998, 44.371275, 142.11048, 255],
[180.07539, 45.501435, 141.182535, 255], [181.189995, 46.63134, 140.25102, 255],
[182.29516500000003, 47.761244999999995, 139.31619, 255],
[183.391155, 48.890895, 138.379065, 255], [184.47822, 50.02029, 137.440155, 255],
[185.55585000000002, 51.149429999999995, 136.499715, 255],
[186.62481, 52.278315, 135.558255, 255],
[187.684845, 53.40694499999999, 134.61654000000001, 255], [188.736465, 54.53532, 133.67508, 255],
[189.77916, 55.66344, 132.73362, 255], [190.813695, 56.791305, 131.79267000000002, 255],
[191.83956, 57.918915, 130.852995, 255], [192.85752, 59.046525, 129.91434, 255],
[193.86732, 60.17388, 128.97746999999998, 255], [194.869215, 61.30098, 128.04213, 255],
[195.86295, 62.428335000000004, 127.108575, 255],
[196.84929, 63.555434999999996, 126.17731500000001, 255],
[197.82798, 64.68279, 125.24860500000001, 255], [198.79901999999998, 65.80989, 124.322445, 255],
[199.76266500000003, 66.9375, 123.39909, 255], [200.71891499999998, 68.06511, 122.478285, 255],
[201.668025, 69.192975, 121.56003000000001, 255],
[202.609995, 70.32135000000001, 120.644835, 255], [203.54508, 71.45023499999999, 119.73219, 255],
[204.473025, 72.57963, 118.82260500000001, 255],
[205.39408500000002, 73.709535, 117.91582500000001, 255], [206.30826, 74.840205, 117.01185, 255],
[207.21606, 75.97164000000001, 116.11119000000001, 255], [208.11672, 77.10384, 115.21308, 255],
[209.011005, 78.23706, 114.31803, 255], [209.89866, 79.371555, 113.42553, 255],
[210.77994, 80.50707, 112.53558, 255], [211.65459, 81.64386, 111.64818, 255],
[212.52261, 82.781925, 110.76333, 255], [213.384255, 83.921775, 109.880775, 255],
[214.239525, 85.0629, 109.001025, 255], [215.08842, 86.20581, 108.12331499999999, 255],
[215.93094, 87.350505, 107.24764499999999, 255], [216.76683, 88.49724, 106.374015, 255],
[217.596345, 89.646015, 105.50216999999999, 255],
[218.41948499999998, 90.79683, 104.63211000000001, 255], [219.23625, 91.94994, 103.763835, 255],
[220.046385, 93.105345, 102.897345, 255], [220.84989000000002, 94.2633, 102.03213, 255],
[221.646765, 95.42406, 101.16819, 255], [222.43726500000002, 96.58736999999999, 100.305525, 255],
[223.22088000000002, 97.753485, 99.44388, 255], [223.997865, 98.92266, 98.583, 255],
[224.767965, 100.09489500000001, 97.723395, 255], [225.53118, 101.27044500000001, 96.8643, 255],
[226.28751, 102.44931, 96.00597, 255], [227.0367, 103.63149, 95.14815, 255],
[227.77875, 104.81724000000001, 94.29084, 255], [228.513405, 106.00656000000001, 93.433785, 255],
[229.24092, 107.19995999999999, 92.57698500000001, 255],
[229.96078500000002, 108.397185, 91.72044, 255],
[230.67325499999998, 109.598235, 90.863895, 255],
[231.378075, 110.80362000000001, 90.00735, 255], [232.07498999999999, 112.01334, 89.15055, 255],
[232.76399999999998, 113.227395, 88.294005, 255], [233.445105, 114.445785, 87.43695, 255],
[234.117795, 115.668765, 86.57989500000001, 255], [234.78207, 116.89633500000001, 85.72233, 255],
[235.438185, 118.129005, 84.864255, 255], [236.085375, 119.366265, 84.00592499999999, 255],
[236.723895, 120.60862499999999, 83.147085, 255], [237.35349, 121.856085, 82.287735, 255],
[237.97415999999998, 123.10889999999999, 81.427875, 255],
[238.58565, 124.36655999999999, 80.56776, 255],
[239.18744999999998, 125.63008500000001, 79.706625, 255],
[239.77981499999999, 126.89871, 78.845235, 255], [240.36249, 128.172945, 77.98308, 255],
[240.93522000000002, 129.45279000000002, 77.12041500000001, 255],
[241.498005, 130.738245, 76.257495, 255], [242.050335, 132.029565, 75.39381, 255],
[242.59271999999999, 133.32675, 74.530125, 255], [243.12414, 134.6298, 73.665165, 255],
[243.64485000000002, 135.938715, 72.79995000000001, 255],
[244.154595, 137.25375, 71.93448000000001, 255], [244.65312, 138.574905, 71.068755, 255],
[245.14068, 139.90218000000002, 70.202775, 255],
[245.61676500000002, 141.235575, 69.33679500000001, 255], [246.08112, 142.57509, 68.470815, 255],
[246.53349, 143.92098000000001, 67.60509, 255], [246.97413, 145.27349999999998, 66.738855, 255],
[247.402275, 146.63214, 65.87287500000001, 255], [247.817925, 147.99741, 65.007405, 255],
[248.22108, 149.369055, 64.14269999999999, 255],
[248.61148500000002, 150.74707500000002, 63.278505, 255],
[248.98914, 152.131725, 62.415585, 255],
[249.35327999999998, 153.523005, 61.553684999999994, 255],
[249.704415, 154.92066, 60.693315, 255], [250.04178, 156.324945, 59.83473, 255],
[250.36562999999998, 157.73586, 58.978184999999996, 255],
[250.675455, 159.153405, 58.123935, 255],
[250.97074500000002, 160.57809, 57.271724999999996, 255],
[251.251755, 162.00914999999998, 56.422574999999995, 255],
[251.517975, 163.447095, 55.57674, 255], [251.76966, 164.891415, 54.735240000000005, 255],
[252.0063, 166.34287500000002, 53.897819999999996, 255],
[252.22764, 167.80096500000002, 53.0655, 255], [252.433425, 169.265685, 52.239045000000004, 255],
[252.623655, 170.73729, 51.41871, 255], [252.798075, 172.215525, 50.605515, 255],
[252.956175, 173.700645, 49.800225, 255],
[253.097955, 175.19265000000001, 49.003350000000005, 255],
[253.22316, 176.69128500000002, 48.21642, 255], [253.33128, 178.19655, 47.440455, 255],
[253.42257, 179.70895499999997, 46.675965000000005, 255],
[253.496265, 181.22799, 45.924735, 255], [253.55262, 182.753655, 45.18804, 255],
[253.59087, 184.286205, 44.467155000000005, 255],
[253.611015, 185.82564000000002, 43.76361, 255],
[253.613055, 187.371705, 43.079190000000004, 255],
[253.596225, 188.9244, 42.415425000000006, 255],
[253.56052499999998, 190.483725, 41.774355, 255],
[253.505955, 192.04993499999998, 41.15802, 255], [253.432005, 193.62252, 40.56846, 255],
[253.33791, 195.202245, 40.007205, 255], [253.22341500000002, 196.7886, 39.47604, 255],
[253.088775, 198.381585, 38.978024999999995, 255],
[252.933735, 199.980945, 38.515710000000006, 255], [252.758295, 201.586935, 38.091135, 255],
[252.56194499999998, 203.19904499999998, 37.70685, 255],
[252.344685, 204.817275, 37.364895, 255], [252.10523999999998, 206.442645, 37.066035, 255],
[251.843355, 208.07439, 36.812565, 255],
[251.55979499999998, 209.712255, 36.607034999999996, 255],
[251.25507000000002, 211.35573, 36.450975, 255], [250.927905, 213.005325, 36.34464, 255],
[250.576515, 214.66206, 36.287265000000005, 255],
[250.20345, 216.323895, 36.281144999999995, 255],
[249.80921999999998, 217.99083000000002, 36.325514999999996, 255],
[249.388725, 219.66516, 36.416039999999995, 255], [248.947575, 221.34408, 36.554505, 255],
[248.48296499999998, 223.02861000000001, 36.735555, 255], [247.99515, 224.71875, 36.955365, 255],
[247.485915, 226.41348, 37.209345, 255], [246.952965, 228.11382, 37.48857, 255],
[246.399105, 229.81849499999998, 37.7859, 255], [245.825355, 231.52725, 38.08935, 255],
[245.228655, 233.24136000000001, 38.3826, 255], [244.61538000000002, 234.958785, 38.64933, 255],
[243.98604, 236.67875999999998, 38.864295, 255],
[243.343185, 238.40153999999998, 38.994855, 255],
[242.69012999999998, 240.126105, 38.995875, 255],
[242.033505, 241.85092500000002, 38.80539, 255], [241.38351, 243.57345, 38.333639999999995, 255],
[240.75876, 245.28858, 37.449555, 255], [240.18347999999997, 246.99044999999998, 35.94378, 255],
[239.70382500000002, 248.66529, 33.48813, 255]], dtype=np.ubyte)
mode = 'rbg'
# autumn
elif cmap == 'Autumn':
pos = np.array([0.0, 1.0])
colour = np.array([[255, 0, 0, 255], [255, 255, 0, 255]], dtype=np.ubyte)
mode = 'rbg'
# cool
elif cmap == 'Cool':
pos = np.array([0.0, 1.0])
colour = np.array([[0.0, 255.0, 255.0, 255], [255.0, 0.0, 255.0, 255]], dtype=np.ubyte)
mode = 'rbg'
# bone
elif cmap == 'Bone':
pos = np.array([0.0, 0.365079, 0.746032, 1.0])
colour = np.array([[0.0, 0.0, 0.0, 255], [166.45838999999998, 198.33338999999998, 198.33337725002008, 255],
[81.45825187499999, 81.45822, 113.33322, 255], [255.0, 255.0, 255.0, 255]], dtype=np.ubyte)
mode = 'rbg'
# copper
elif cmap == 'Copper':
pos = np.array([0.0, 0.809524, 1.0])
colour = np.array(
[[0.0, 0.0, 0.0, 255], [255.0, 161.262037944, 102.69823845, 255], [255.0, 199.206, 126.8625, 255]],
dtype=np.ubyte)
mode = 'rbg'
# hot
elif cmap == 'Hot':
pos = np.array([0.0, 0.365079, 0.746032, 1.0])
colour = np.array([[10.607999999999999, 0.0, 0.0, 255], [255.0, 255.0, 255.0, 255], [255.0, 0.0, 0.0, 255],
[255.0, 255.0, 0.0, 255]], dtype=np.ubyte)
mode = 'rbg'
# jet
elif cmap == 'Jet':
pos = np.array([0.0, 0.11, 0.125, 0.34, 0.35, 0.375, 0.64, 0.65, 0.66, 0.89, 0.91, 1])
colour = np.array([[0, 0, 127.5, 255], [0.0, 0, 255.0, 255], [20.56451612903227, 255, 226.20967741935488, 255],
[127.5, 0, 0, 255], [0.0, 0.0, 255, 255], [255, 236.1111111111111, 0.0, 255],
[0.0, 219.3, 255, 255], [231.81818181818178, 0, 0.0, 255],
[246.7741935483871, 245.55555555555554, 0, 255],
[238.54838709677418, 255, 8.225806451612923, 255],
[0, 229.49999999999997, 246.77419354838713, 255], [255, 18.888888888888918, 0.0, 255]],
dtype=np.ubyte)
mode = 'rbg'
elif cmap == 'Thermal':
pos = np.array([0., 1., 0.3333, 0.6666])
colour = np.array([[0, 0, 0, 255], [255, 255, 255, 255], [185, 0, 0, 255], [255, 220, 0, 255]], dtype=np.ubyte)
mode = 'rbg'
elif cmap == 'Flame':
pos = np.array([0., 1., 0.2, 0.5, 0.8])
colour = np.array([[0, 0, 0, 255], [255, 255, 255, 255], [7, 0, 220, 255], [236, 0, 134, 255], [246, 246, 0, 255]],
dtype=np.ubyte)
mode = 'rbg'
elif cmap == 'Yellowy':
# Yellowy
pos = np.array([0., 1., 0.2328863796753704, 0.8362738179251941, 0.5257586450247])
colour = np.array(
[[0, 0, 0, 255], [255, 255, 255, 255], [32, 0, 129, 255], [255, 255, 0, 255], [115, 15, 255, 255]],
dtype=np.ubyte)
mode = 'rbg'
elif cmap == 'Bipolar':
pos = np.array([0., 1., 0.5, 0.25, 0.75])
colour = np.array([[0, 255, 255, 255], [255, 255, 0, 255], [0, 0, 0, 255], [0, 0, 255, 255], [255, 0, 0, 255]],
dtype=np.ubyte)
mode = 'rbg'
elif cmap == 'Spectrum':
# Spectrum
pos = np.array([0., 1.])
colour = np.array([[255, 0, 0, 255], [255, 0, 255, 255]],
dtype=np.ubyte)
mode = 'hsv'
else:
print("No such colour map")
pos = None
colour = None
mode = None
return pos,colour,mode
def getColourRange(minsg, maxsg, bright, contr, invert):
""" Utility for determining a colour range:
a list [colStart, colEnd] which can be passed to pyqtgraph's
setLevels etc. to clip the data before colorizing and so create
contrast/brightness adjustments.
minsg,maxsg: range of values in the plotted image (spectrogram)
bright,contr: brightness and contrast, in 0-100 range.
invert: bool, flips the scale.
"""
bright /= 100.0
contr /= 100.0
colStart = bright * contr * (maxsg-minsg) + minsg
colEnd = (maxsg-minsg) * (1.0 - contr) + colStart
if invert:
return [colEnd,colStart]
else:
return [colStart,colEnd]
def getLookupTable(cmapname):
""" Wrapper around pyqtgraph.ColorMap.getLookupTable.
cmapname: string, name of the colour map from this file.
Returns a lookup table which can be directly passed
to pg.ImageItem.setLookupTable
"""
pos,colour,mode = colourMaps(cmapname)
cmap = pyqtgraph.ColorMap(pos,colour,mode)
lut = cmap.getLookupTable(0.0, 1.0, 256)
return(lut)