Skip to content

Instantly share code, notes, and snippets.

@sustr4
Created April 8, 2020 11:31
Show Gist options
  • Save sustr4/42a7ab01320ffc03f0a07d5fbc3ad4a0 to your computer and use it in GitHub Desktop.
Save sustr4/42a7ab01320ffc03f0a07d5fbc3ad4a0 to your computer and use it in GitHub Desktop.
Copernicus coverage heatmap
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Š D poč
10 -9 169
10 -8 84
10 -7 179
10 -6 91
10 -5 85
10 -4 84
11 -12 11
11 -11 2
11 -10 89
11 -9 337
11 -8 87
11 -7 172
11 -6 119
11 -5 118
11 -4 288
11 -3 3
12 -13 91
12 -12 3
12 -11 362
12 -10 182
12 -9 290
12 -8 93
12 -7 9
12 -6 349
12 -5 92
12 -4 454
12 -3 97
12 -2 10
13 -13 91
13 -12 93
13 -11 277
13 -10 182
13 -9 176
13 -8 91
13 -7 90
13 -6 278
13 -5 93
13 -4 263
13 -3 104
13 -2 9
13 -1 89
14 -13 93
14 -12 92
14 -11 281
14 -10 183
14 -9 19
14 -8 257
14 -7 86
14 -6 268
14 -5 92
14 -4 93
14 -3 277
14 -2 98
14 -1 183
14 1 2
15 -13 97
15 -12 99
15 -11 374
15 -10 95
15 -9 7
15 -8 359
15 -7 89
15 -6 290
15 -5 65
15 -4 88
15 -3 366
15 -2 90
15 -1 179
15 0 112
15 1 95
15 2 357
15 3 92
15 4 181
15 5 2
16 -13 90
16 -12 91
16 -11 180
16 -10 179
16 -8 353
16 -7 84
16 -6 223
16 -5 133
16 -4 94
16 -3 462
16 -2 93
16 -1 92
16 0 182
16 1 93
16 2 443
16 3 88
16 4 59
16 5 121
17 -7 86
17 -6 4
17 -5 365
17 -4 177
17 -3 181
17 -2 93
17 -1 3
17 0 370
17 1 93
17 2 273
17 3 99
17 4 49
17 5 184
18 -7 87
18 -6 87
18 -5 533
18 -4 182
18 -3 153
18 -2 223
18 -1 90
18 0 501
18 1 90
18 2 177
18 3 288
18 4 83
18 5 214
19 -7 174
19 -6 175
19 -5 472
19 -4 270
19 -3 40
19 -2 458
19 -1 193
19 0 510
19 1 133
19 2 194
19 3 425
19 4 174
19 5 165
19 6 5
20 -7 186
20 -6 96
20 -5 165
20 -4 192
20 -3 89
20 -2 363
20 -1 90
20 0 93
20 1 278
20 2 179
20 3 363
20 4 87
21 -7 181
21 -6 82
21 -5 83
21 -4 259
21 -3 86
21 -2 179
21 -1 98
21 0 6
21 1 463
21 2 96
21 3 7
22 -7 87
22 -6 184
22 -5 87
22 -4 441
22 -3 93
22 -2 114
22 -1 178
22 0 91
22 1 540
22 2 1
23 -7 5
23 -6 438
23 -5 86
23 -4 270
23 -3 96
23 -2 14
23 -1 365
23 0 102
23 1 4
24 -8 90
24 -7 6
24 -6 526
24 -5 85
24 -4 86
24 -3 178
24 -2 27
24 -1 150
25 -8 92
25 -7 94
25 -6 444
25 -5 83
25 -4 4
25 -3 262
26 -8 86
26 -7 89
26 -6 182
26 -5 256
48 12 359
48 13 510
48 14 277
48 15 265
48 16 490
48 17 497
48 18 311
48 19 107
49 5 178
49 6 92
49 7 3
49 12 293
49 13 762
49 14 523
49 15 701
49 16 541
49 17 388
49 18 652
49 19 755
50 2 87
50 3 181
50 4 183
50 5 170
50 6 194
50 7 276
50 11 301
50 12 508
50 13 768
50 14 508
50 15 20
50 16 757
50 17 508
50 18 756
50 19 775
50 20 281
50 21 228
51 2 182
51 3 8
51 4 272
51 5 96
51 6 266
51 7 95
51 11 287
51 12 731
51 13 530
51 14 751
51 15 21
51 16 515
51 17 524
51 18 208
51 19 248
51 165 1
52 2 177
52 3 2
52 4 179
52 5 178
#!/usr/bin/gnuplot
#
# Plotting a heat map on Gnuplots world.dat
#
# AUTHOR: Hagen Wierstorf
reset
# wxt
set terminal wxt size 350,262 enhanced font "Helvetica,10" persist
# png
#set terminal pngcairo size 350,262 enhanced font 'Verdana,10'
#set output 'heatmap2d.png'
# svg
#set terminal svg size 350,262 fname 'Verdana, Helvetica, Arial,sans-serif' \
#fsize 10
#set output 'heatmap2d.svg'
# color definitions
set border lw 1.5
set style line 1 lc rgb 'black' lt 1 lw 2
set rmargin screen 0.85
unset key
set tics scale 0.5
unset xtics
unset ytics
set cbrange [1:775]
set xrange[-179:179]
set yrange[-89:89]
set format '%g°'
set palette defined (0 "white", 80 "red", 100 "yellow", 101 "grey")
plot 'full-matrix.dat' u 2:1:3 w image, \
'world.dat' with lines linestyle 1
for i in {-89..89}; do for j in {-179..179}; do printf "%d %d 9999.00\n" $i $j; done; printf "\n"; done > full-matrix.dat
cat data.csv | awk '{ print "s/^" $1 " " $2 " .*/" $1 " " $2 " " $3 "/" }' > sed.patterns
sed -f sed.patterns -i full-matrix.dat
all:
gnuplot -c heatmap2d.gnu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment