Skip to content

Instantly share code, notes, and snippets.

@pnorman
Created September 15, 2023 08:54
Show Gist options
  • Save pnorman/496b79bbb2db75882a2bb4f968d2bbfa to your computer and use it in GitHub Desktop.
Save pnorman/496b79bbb2db75882a2bb4f968d2bbfa to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import argparse
import csv
from math import log
from PIL import Image
ZOOM = 10
SCALE_MAX = 1_500_000
parser = argparse.ArgumentParser()
parser.add_argument("input", help = "Name of file to read from")
parser.add_argument("output", help = "Name of PNG to write to")
args = parser.parse_args()
# build a lookup table for colors
colortable = []
with open('extended-kindlmann-table-byte-1024.csv') as csvfile:
reader = csv.reader(csvfile)
next(reader) # skip header
for row in reader:
colortable.append((int(row[1]), int(row[2]), int(row[3])))
COLORTABLE_MAX = len(colortable) - 1
img = Image.new('RGB', (2**ZOOM, 2**ZOOM), "black")
pixels = img.load()
for line in open(args.input):
splitline=line.split(' ', 1)
tile=splitline[0].split('/', 1)
x = int(tile[0])
y = int(tile[1])
hits = int(splitline[1])
# the math gets tricky, because we need 0 hits to map to black (colortable[0]), but log(0) isn't defined. So we add 1 to all hit counts
loghits = log(hits + 1)
# We know 0 < loghits/log(SCALE_MAX) <= 1.
lookup = min(int(round(loghits/log(SCALE_MAX)*COLORTABLE_MAX)), COLORTABLE_MAX)
pixels[x,y] = colortable[lookup]
img.save(args.output)
scalar RGB_r RGB_g RGB_b
0.0 0 0 0
0.0009775171065493646 1 0 1
0.0019550342130987292 2 0 2
0.002932551319648094 3 0 3
0.0039100684261974585 5 0 4
0.004887585532746823 6 0 5
0.005865102639296188 7 0 6
0.006842619745845552 8 0 7
0.007820136852394917 9 0 9
0.00879765395894428 10 0 10
0.009775171065493646 11 1 11
0.010752688172043012 12 1 12
0.011730205278592375 13 1 13
0.012707722385141739 14 1 14
0.013685239491691105 15 1 15
0.01466275659824047 16 1 16
0.015640273704789834 16 1 17
0.016617790811339198 17 1 18
0.01759530791788856 18 1 19
0.01857282502443793 19 1 20
0.019550342130987292 19 1 20
0.020527859237536656 20 1 21
0.021505376344086023 21 1 22
0.022482893450635387 21 1 23
0.02346041055718475 22 1 24
0.024437927663734114 22 1 24
0.025415444770283478 23 1 25
0.026392961876832845 23 1 26
0.02737047898338221 24 1 27
0.028347996089931573 24 1 28
0.02932551319648094 25 1 28
0.030303030303030304 25 1 29
0.03128054740957967 26 1 30
0.03225806451612903 26 1 31
0.033235581622678395 27 2 32
0.03421309872922776 27 2 33
0.03519061583577712 27 2 34
0.03616813294232649 27 2 35
0.03714565004887586 28 2 36
0.03812316715542522 28 2 37
0.039100684261974585 28 2 38
0.04007820136852395 28 2 39
0.04105571847507331 29 2 40
0.042033235581622676 29 2 41
0.043010752688172046 29 2 42
0.04398826979472141 29 2 43
0.044965786901270774 29 2 44
0.04594330400782014 29 2 45
0.0469208211143695 29 2 46
0.047898338220918865 30 2 47
0.04887585532746823 30 2 47
0.04985337243401759 30 2 48
0.050830889540566956 30 2 49
0.05180840664711633 30 2 50
0.05278592375366569 30 2 51
0.053763440860215055 30 2 52
0.05474095796676442 30 3 53
0.05571847507331378 30 3 54
0.056695992179863146 30 3 55
0.05767350928641251 30 3 56
0.05865102639296188 30 3 57
0.059628543499511244 30 3 58
0.06060606060606061 30 3 59
0.06158357771260997 30 3 60
0.06256109481915934 30 3 61
0.0635386119257087 30 3 62
0.06451612903225806 29 3 63
0.06549364613880743 29 3 64
0.06647116324535679 29 3 65
0.06744868035190615 29 3 66
0.06842619745845552 29 3 66
0.06940371456500488 29 3 67
0.07038123167155425 29 3 68
0.07135874877810362 29 3 69
0.07233626588465299 28 3 70
0.07331378299120235 28 3 71
0.07429130009775171 28 3 72
0.07526881720430108 28 3 73
0.07624633431085044 28 4 74
0.0772238514173998 28 4 74
0.07820136852394917 27 4 75
0.07917888563049853 27 4 76
0.0801564027370479 27 4 77
0.08113391984359726 27 4 78
0.08211143695014662 27 4 78
0.08308895405669599 26 4 79
0.08406647116324535 26 4 80
0.08504398826979472 26 4 81
0.08602150537634409 26 4 82
0.08699902248289346 26 4 83
0.08797653958944282 25 4 83
0.08895405669599218 25 4 84
0.08993157380254155 25 4 85
0.09090909090909091 25 4 86
0.09188660801564028 24 4 87
0.09286412512218964 24 4 87
0.093841642228739 24 4 88
0.09481915933528837 24 4 89
0.09579667644183773 23 4 90
0.0967741935483871 23 4 91
0.09775171065493646 23 4 91
0.09872922776148582 23 4 92
0.09970674486803519 22 4 93
0.10068426197458455 22 4 94
0.10166177908113391 22 5 94
0.10263929618768329 22 5 95
0.10361681329423265 21 5 96
0.10459433040078202 21 5 97
0.10557184750733138 21 5 97
0.10654936461388075 21 5 98
0.10752688172043011 20 5 99
0.10850439882697947 20 5 100
0.10948191593352884 20 5 100
0.1104594330400782 20 5 101
0.11143695014662756 19 5 102
0.11241446725317693 19 5 103
0.11339198435972629 19 5 103
0.11436950146627566 19 5 104
0.11534701857282502 19 5 105
0.11632453567937438 19 5 105
0.11730205278592376 18 5 106
0.11827956989247312 18 5 107
0.11925708699902249 18 5 107
0.12023460410557185 18 5 108
0.12121212121212122 18 5 109
0.12218963831867058 18 5 109
0.12316715542521994 18 5 110
0.1241446725317693 18 5 111
0.12512218963831867 18 5 111
0.12609970674486803 17 5 112
0.1270772238514174 16 5 113
0.12805474095796676 15 5 114
0.12903225806451613 14 5 115
0.1300097751710655 13 6 116
0.13098729227761485 12 6 116
0.13196480938416422 11 6 117
0.13294232649071358 9 6 118
0.13391984359726294 7 6 120
0.1348973607038123 6 6 120
0.13587487781036167 6 7 120
0.13685239491691104 6 7 120
0.1378299120234604 6 8 120
0.13880742913000976 6 9 120
0.13978494623655913 6 10 120
0.1407624633431085 6 11 120
0.14173998044965788 6 12 120
0.14271749755620725 6 13 120
0.1436950146627566 6 13 120
0.14467253176930597 6 14 119
0.14565004887585534 6 15 119
0.1466275659824047 6 16 119
0.14760508308895406 6 17 118
0.14858260019550343 6 18 118
0.1495601173020528 6 19 118
0.15053763440860216 6 20 117
0.15151515151515152 6 20 117
0.15249266862170088 6 21 116
0.15347018572825025 6 22 116
0.1544477028347996 6 23 115
0.15542521994134897 6 24 115
0.15640273704789834 5 24 114
0.1573802541544477 5 25 114
0.15835777126099707 5 26 113
0.15933528836754643 5 27 113
0.1603128054740958 5 27 112
0.16129032258064516 5 28 112
0.16226783968719452 5 29 111
0.16324535679374388 5 30 110
0.16422287390029325 5 30 110
0.1652003910068426 5 31 109
0.16617790811339198 5 32 108
0.16715542521994134 5 32 108
0.1681329423264907 5 33 107
0.16911045943304007 5 34 106
0.17008797653958943 5 34 106
0.1710654936461388 5 35 105
0.17204301075268819 5 35 104
0.17302052785923755 5 36 104
0.1739980449657869 5 37 103
0.17497556207233628 5 37 102
0.17595307917888564 5 38 102
0.176930596285435 5 38 101
0.17790811339198437 5 39 101
0.17888563049853373 5 39 100
0.1798631476050831 5 40 99
0.18084066471163246 5 40 99
0.18181818181818182 5 41 98
0.1827956989247312 5 41 97
0.18377321603128055 5 42 97
0.18475073313782991 5 42 96
0.18572825024437928 5 43 95
0.18670576735092864 5 43 95
0.187683284457478 5 44 94
0.18866080156402737 4 44 94
0.18963831867057673 4 45 93
0.1906158357771261 4 45 92
0.19159335288367546 4 46 92
0.19257086999022482 4 46 91
0.1935483870967742 4 47 91
0.19452590420332355 4 47 90
0.19550342130987292 4 47 89
0.19648093841642228 4 48 89
0.19745845552297164 4 48 88
0.198435972629521 4 49 88
0.19941348973607037 4 49 87
0.20039100684261973 4 49 87
0.2013685239491691 4 50 86
0.20234604105571846 4 50 86
0.20332355816226783 4 51 85
0.20430107526881722 4 51 85
0.20527859237536658 4 51 84
0.20625610948191594 4 52 84
0.2072336265884653 4 52 83
0.20821114369501467 4 53 83
0.20918866080156404 4 53 82
0.2101661779081134 4 53 82
0.21114369501466276 4 54 81
0.21212121212121213 4 54 81
0.2130987292277615 4 54 80
0.21407624633431085 4 55 80
0.21505376344086022 4 55 79
0.21603128054740958 4 55 79
0.21700879765395895 4 56 79
0.2179863147605083 4 56 78
0.21896383186705767 4 57 78
0.21994134897360704 4 57 77
0.2209188660801564 4 57 77
0.22189638318670576 4 58 76
0.22287390029325513 4 58 76
0.2238514173998045 4 58 76
0.22482893450635386 4 59 75
0.22580645161290322 4 59 75
0.22678396871945258 4 59 74
0.22776148582600195 4 60 74
0.2287390029325513 4 60 74
0.22971652003910067 4 60 73
0.23069403714565004 3 61 73
0.2316715542521994 4 61 73
0.23264907135874877 3 61 72
0.23362658846529813 3 61 72
0.23460410557184752 3 62 72
0.23558162267839688 3 62 71
0.23655913978494625 3 62 71
0.2375366568914956 3 63 71
0.23851417399804498 3 63 70
0.23949169110459434 3 63 70
0.2404692082111437 3 64 70
0.24144672531769307 3 64 69
0.24242424242424243 3 64 69
0.2434017595307918 3 65 69
0.24437927663734116 3 65 68
0.24535679374389052 3 65 68
0.24633431085043989 3 66 68
0.24731182795698925 3 66 67
0.2482893450635386 3 66 67
0.24926686217008798 3 66 67
0.25024437927663734 3 67 67
0.2512218963831867 3 67 66
0.25219941348973607 3 67 66
0.25317693059628543 3 68 66
0.2541544477028348 3 68 65
0.25513196480938416 3 68 65
0.2561094819159335 3 69 65
0.2570869990224829 3 69 64
0.25806451612903225 3 69 64
0.2590420332355816 3 69 64
0.260019550342131 3 70 63
0.26099706744868034 3 70 63
0.2619745845552297 3 70 63
0.26295210166177907 3 71 62
0.26392961876832843 3 71 62
0.2649071358748778 3 71 62
0.26588465298142716 3 71 61
0.2668621700879765 3 72 61
0.2678396871945259 4 72 61
0.26881720430107525 3 72 60
0.2697947214076246 4 73 60
0.270772238514174 4 73 60
0.27174975562072334 4 73 59
0.2727272727272727 4 74 59
0.27370478983382207 4 74 58
0.27468230694037143 4 74 58
0.2756598240469208 4 74 58
0.27663734115347016 4 75 57
0.2776148582600195 4 75 57
0.2785923753665689 4 75 56
0.27956989247311825 4 76 56
0.2805474095796676 4 76 56
0.281524926686217 4 76 55
0.2825024437927664 4 77 55
0.28347996089931576 4 77 54
0.2844574780058651 4 77 54
0.2854349951124145 4 77 53
0.28641251221896386 4 78 53
0.2873900293255132 4 78 52
0.2883675464320626 4 78 52
0.28934506353861195 4 79 52
0.2903225806451613 4 79 51
0.2913000977517107 4 79 51
0.29227761485826004 4 80 50
0.2932551319648094 4 80 50
0.29423264907135877 4 80 49
0.29521016617790813 4 80 49
0.2961876832844575 4 81 48
0.29716520039100686 4 81 48
0.2981427174975562 4 81 47
0.2991202346041056 4 82 47
0.30009775171065495 4 82 46
0.3010752688172043 4 82 46
0.3020527859237537 4 82 45
0.30303030303030304 4 83 45
0.3040078201368524 4 83 44
0.30498533724340177 4 83 44
0.30596285434995113 4 84 43
0.3069403714565005 4 84 42
0.30791788856304986 4 84 42
0.3088954056695992 4 85 41
0.3098729227761486 4 85 41
0.31085043988269795 4 85 40
0.3118279569892473 4 85 40
0.3128054740957967 4 86 39
0.31378299120234604 4 86 39
0.3147605083088954 4 86 38
0.31573802541544477 4 87 37
0.31671554252199413 4 87 37
0.3176930596285435 4 87 36
0.31867057673509286 4 87 36
0.3196480938416422 4 88 35
0.3206256109481916 4 88 34
0.32160312805474095 4 88 34
0.3225806451612903 4 89 33
0.3235581622678397 4 89 33
0.32453567937438904 4 89 32
0.3255131964809384 4 89 31
0.32649071358748777 4 90 31
0.32746823069403713 4 90 30
0.3284457478005865 4 90 29
0.32942326490713586 4 91 29
0.3304007820136852 4 91 28
0.3313782991202346 4 91 28
0.33235581622678395 4 91 27
0.3333333333333333 4 92 26
0.3343108504398827 4 92 26
0.33528836754643204 4 92 25
0.3362658846529814 4 93 24
0.33724340175953077 5 93 24
0.33822091886608013 4 93 23
0.3391984359726295 4 93 22
0.34017595307917886 5 94 22
0.3411534701857282 5 94 21
0.3421309872922776 5 94 20
0.34310850439882695 5 95 20
0.34408602150537637 5 95 19
0.34506353861192574 5 95 18
0.3460410557184751 5 95 18
0.34701857282502446 5 96 17
0.3479960899315738 5 96 16
0.3489736070381232 5 96 16
0.34995112414467255 5 96 15
0.3509286412512219 5 97 14
0.3519061583577713 5 97 13
0.35288367546432065 5 97 13
0.35386119257087 5 98 12
0.3548387096774194 5 98 11
0.35581622678396874 5 98 11
0.3567937438905181 5 98 10
0.35777126099706746 5 99 9
0.3587487781036168 5 99 9
0.3597262952101662 5 99 8
0.36070381231671556 5 100 8
0.3616813294232649 5 100 7
0.3626588465298143 5 100 7
0.36363636363636365 5 100 6
0.364613880742913 5 101 6
0.3655913978494624 5 101 5
0.36656891495601174 5 101 5
0.3675464320625611 5 101 5
0.36852394916911047 6 102 5
0.36950146627565983 7 102 5
0.3704789833822092 7 102 5
0.37145650048875856 8 102 5
0.3724340175953079 8 103 5
0.3734115347018573 9 103 5
0.37438905180840665 9 103 5
0.375366568914956 10 103 5
0.3763440860215054 10 104 5
0.37732160312805474 10 104 5
0.3782991202346041 11 104 5
0.37927663734115347 11 104 5
0.38025415444770283 11 105 5
0.3812316715542522 12 105 5
0.38220918866080156 12 105 5
0.3831867057673509 12 105 5
0.3841642228739003 13 106 5
0.38514173998044965 13 106 5
0.386119257086999 14 106 5
0.3870967741935484 14 107 5
0.38807429130009774 15 107 5
0.3890518084066471 15 107 5
0.39002932551319647 16 107 5
0.39100684261974583 16 108 5
0.3919843597262952 17 108 5
0.39296187683284456 17 108 5
0.3939393939393939 18 108 5
0.3949169110459433 19 108 5
0.39589442815249265 19 109 5
0.396871945259042 20 109 5
0.3978494623655914 21 109 5
0.39882697947214074 22 109 5
0.3998044965786901 22 110 5
0.40078201368523947 23 110 5
0.40175953079178883 24 110 5
0.4027370478983382 25 110 5
0.40371456500488756 25 111 5
0.4046920821114369 26 111 5
0.4056695992179863 27 111 5
0.40664711632453565 28 111 5
0.40762463343108507 29 112 5
0.40860215053763443 29 112 5
0.4095796676441838 30 112 5
0.41055718475073316 31 112 5
0.4115347018572825 32 112 5
0.4125122189638319 33 113 5
0.41348973607038125 34 113 5
0.4144672531769306 35 113 5
0.41544477028348 36 113 5
0.41642228739002934 37 113 5
0.4173998044965787 37 114 5
0.41837732160312807 38 114 5
0.41935483870967744 39 114 5
0.4203323558162268 40 114 5
0.42130987292277616 41 114 5
0.4222873900293255 42 115 5
0.4232649071358749 43 115 5
0.42424242424242425 44 115 6
0.4252199413489736 45 115 6
0.426197458455523 46 115 6
0.42717497556207235 47 116 6
0.4281524926686217 48 116 6
0.4291300097751711 49 116 6
0.43010752688172044 50 116 6
0.4310850439882698 51 116 6
0.43206256109481916 52 116 6
0.43304007820136853 53 117 6
0.4340175953079179 54 117 6
0.43499511241446726 55 117 6
0.4359726295210166 56 117 6
0.436950146627566 57 117 6
0.43792766373411535 58 117 6
0.4389051808406647 59 118 6
0.4398826979472141 60 118 6
0.44086021505376344 61 118 6
0.4418377321603128 62 118 6
0.44281524926686217 63 118 6
0.44379276637341153 64 118 6
0.4447702834799609 65 119 6
0.44574780058651026 66 119 6
0.4467253176930596 67 119 6
0.447702834799609 68 119 6
0.44868035190615835 69 119 6
0.4496578690127077 70 119 6
0.4506353861192571 71 119 6
0.45161290322580644 72 120 6
0.4525904203323558 73 120 6
0.45356793743890517 74 120 6
0.45454545454545453 75 120 6
0.4555229716520039 76 120 6
0.45650048875855326 77 120 6
0.4574780058651026 78 120 6
0.458455522971652 79 120 6
0.45943304007820135 80 121 6
0.4604105571847507 82 121 6
0.4613880742913001 83 121 6
0.46236559139784944 84 121 6
0.4633431085043988 85 121 6
0.46432062561094817 86 121 6
0.46529814271749753 87 121 6
0.4662756598240469 88 121 6
0.46725317693059626 89 121 6
0.4682306940371456 90 121 6
0.46920821114369504 91 122 6
0.4701857282502444 92 122 6
0.47116324535679377 93 122 6
0.47214076246334313 94 122 6
0.4731182795698925 95 122 6
0.47409579667644186 96 122 6
0.4750733137829912 97 122 6
0.4760508308895406 98 122 6
0.47702834799608995 99 122 6
0.4780058651026393 100 122 6
0.4789833822091887 101 122 6
0.47996089931573804 102 122 6
0.4809384164222874 103 122 6
0.48191593352883677 105 123 6
0.48289345063538613 106 123 6
0.4838709677419355 107 123 6
0.48484848484848486 108 123 6
0.4858260019550342 109 123 6
0.4868035190615836 110 123 6
0.48778103616813295 111 123 6
0.4887585532746823 112 123 6
0.4897360703812317 113 123 6
0.49071358748778104 114 123 6
0.4916911045943304 115 123 6
0.49266862170087977 116 123 6
0.49364613880742914 117 123 6
0.4946236559139785 118 123 6
0.49560117302052786 119 123 6
0.4965786901270772 120 123 6
0.4975562072336266 121 123 6
0.49853372434017595 122 123 6
0.4995112414467253 123 123 6
0.5004887585532747 124 123 6
0.501466275659824 125 123 6
0.5024437927663734 126 123 6
0.5034213098729228 127 123 6
0.5043988269794721 128 123 6
0.5053763440860215 130 123 6
0.5063538611925709 131 123 6
0.5073313782991202 132 123 6
0.5083088954056696 133 123 6
0.509286412512219 134 123 6
0.5102639296187683 135 123 7
0.5112414467253177 136 123 7
0.512218963831867 137 123 7
0.5131964809384164 139 123 7
0.5141739980449658 140 123 7
0.5151515151515151 141 123 7
0.5161290322580645 142 123 7
0.5171065493646139 143 123 7
0.5180840664711632 145 123 7
0.5190615835777126 146 123 7
0.520039100684262 147 123 7
0.5210166177908113 148 123 7
0.5219941348973607 150 122 7
0.52297165200391 151 122 7
0.5239491691104594 152 122 7
0.5249266862170088 153 122 7
0.5259042033235581 155 122 7
0.5268817204301075 156 122 8
0.5278592375366569 157 122 8
0.5288367546432062 159 121 8
0.5298142717497556 160 121 8
0.530791788856305 161 121 8
0.5317693059628543 163 121 8
0.5327468230694037 164 120 8
0.533724340175953 166 120 8
0.5347018572825024 167 120 8
0.5356793743890518 169 120 8
0.5366568914956011 170 119 8
0.5376344086021505 171 119 8
0.5386119257086999 173 119 8
0.5395894428152492 174 119 8
0.5405669599217986 176 118 8
0.541544477028348 177 118 8
0.5425219941348973 179 118 9
0.5434995112414467 180 117 9
0.544477028347996 182 117 9
0.5454545454545454 183 116 9
0.5464320625610948 185 116 9
0.5474095796676441 187 116 9
0.5483870967741935 188 115 9
0.5493646138807429 190 115 9
0.5503421309872922 191 114 9
0.5513196480938416 193 114 9
0.552297165200391 195 113 9
0.5532746823069403 196 113 9
0.5542521994134897 198 112 9
0.555229716520039 199 112 10
0.5562072336265884 201 111 10
0.5571847507331378 203 110 10
0.5581622678396871 204 110 10
0.5591397849462365 206 109 10
0.5601173020527859 208 108 10
0.5610948191593352 209 108 10
0.5620723362658846 211 107 10
0.563049853372434 213 106 10
0.5640273704789834 214 106 10
0.5650048875855328 216 105 10
0.5659824046920822 218 104 10
0.5669599217986315 220 103 11
0.5679374389051809 221 102 11
0.5689149560117303 223 102 11
0.5698924731182796 225 101 11
0.570869990224829 226 100 11
0.5718475073313783 228 99 11
0.5728250244379277 230 98 11
0.5738025415444771 232 97 11
0.5747800586510264 233 96 11
0.5757575757575758 235 95 11
0.5767350928641252 237 94 11
0.5777126099706745 238 93 11
0.5786901270772239 240 92 11
0.5796676441837733 242 91 12
0.5806451612903226 243 90 12
0.581622678396872 244 90 16
0.5826001955034213 244 90 21
0.5835777126099707 244 91 24
0.5845552297165201 244 91 28
0.5855327468230694 244 91 30
0.5865102639296188 244 92 33
0.5874877810361682 245 92 36
0.5884652981427175 245 93 38
0.5894428152492669 245 93 40
0.5904203323558163 245 93 42
0.5913978494623656 245 94 44
0.592375366568915 245 94 46
0.5933528836754643 245 95 48
0.5943304007820137 245 95 50
0.5953079178885631 245 96 51
0.5962854349951124 245 96 53
0.5972629521016618 245 96 54
0.5982404692082112 245 97 56
0.5992179863147605 246 97 57
0.6001955034213099 246 98 58
0.6011730205278593 246 98 60
0.6021505376344086 246 99 61
0.603128054740958 246 99 62
0.6041055718475073 246 100 63
0.6050830889540567 246 100 64
0.6060606060606061 246 100 65
0.6070381231671554 246 101 66
0.6080156402737048 246 101 67
0.6089931573802542 246 102 68
0.6099706744868035 246 102 69
0.6109481915933529 246 103 70
0.6119257086999023 246 103 71
0.6129032258064516 246 104 72
0.613880742913001 246 104 72
0.6148582600195504 246 105 73
0.6158357771260997 246 105 74
0.6168132942326491 246 106 75
0.6177908113391984 246 106 75
0.6187683284457478 246 107 76
0.6197458455522972 246 107 77
0.6207233626588465 247 107 77
0.6217008797653959 247 108 78
0.6226783968719453 247 108 79
0.6236559139784946 247 109 79
0.624633431085044 247 109 80
0.6256109481915934 247 110 81
0.6265884652981427 247 110 82
0.6275659824046921 247 111 83
0.6285434995112414 247 111 84
0.6295210166177908 247 112 85
0.6304985337243402 247 112 86
0.6314760508308895 247 112 87
0.6324535679374389 247 113 88
0.6334310850439883 247 113 89
0.6344086021505376 247 114 90
0.635386119257087 247 114 91
0.6363636363636364 247 114 92
0.6373411534701857 247 115 93
0.6383186705767351 247 115 95
0.6392961876832844 247 115 96
0.6402737047898338 247 116 97
0.6412512218963832 248 116 98
0.6422287390029325 248 117 100
0.6432062561094819 248 117 101
0.6441837732160313 248 117 102
0.6451612903225806 248 118 104
0.64613880742913 248 118 105
0.6471163245356794 248 118 106
0.6480938416422287 248 119 108
0.6490713587487781 248 119 109
0.6500488758553274 248 119 111
0.6510263929618768 248 120 112
0.6520039100684262 248 120 113
0.6529814271749755 248 120 115
0.6539589442815249 248 121 116
0.6549364613880743 248 121 118
0.6559139784946236 249 121 119
0.656891495601173 249 122 121
0.6578690127077224 249 122 122
0.6588465298142717 249 122 123
0.6598240469208211 249 123 125
0.6608015640273704 249 123 126
0.6617790811339198 249 123 128
0.6627565982404692 249 123 129
0.6637341153470185 249 124 131
0.6647116324535679 249 124 132
0.6656891495601173 249 124 134
0.6666666666666666 249 125 135
0.667644183773216 249 125 137
0.6686217008797654 249 125 138
0.6695992179863147 249 126 140
0.6705767350928641 249 126 141
0.6715542521994134 249 126 142
0.6725317693059628 249 127 144
0.6735092864125122 249 127 145
0.6744868035190615 249 127 147
0.6754643206256109 249 128 148
0.6764418377321603 249 128 150
0.6774193548387096 249 128 151
0.678396871945259 249 129 153
0.6793743890518084 249 129 154
0.6803519061583577 249 129 155
0.6813294232649071 249 129 157
0.6823069403714564 249 130 158
0.6832844574780058 249 130 160
0.6842619745845552 249 130 161
0.6852394916911045 249 131 162
0.6862170087976539 249 131 164
0.6871945259042033 249 131 165
0.6881720430107527 249 131 167
0.6891495601173021 249 132 168
0.6901270772238515 249 132 169
0.6911045943304008 249 132 171
0.6920821114369502 249 133 172
0.6930596285434996 249 133 173
0.6940371456500489 249 133 175
0.6950146627565983 249 133 176
0.6959921798631477 249 134 177
0.696969696969697 249 134 179
0.6979472140762464 249 134 180
0.6989247311827957 249 135 181
0.6999022482893451 249 135 183
0.7008797653958945 249 135 184
0.7018572825024438 249 135 185
0.7028347996089932 249 136 187
0.7038123167155426 249 136 188
0.7047898338220919 249 136 189
0.7057673509286413 249 136 191
0.7067448680351907 249 137 192
0.70772238514174 249 137 193
0.7086999022482894 249 137 195
0.7096774193548387 249 138 196
0.7106549364613881 249 138 197
0.7116324535679375 249 138 198
0.7126099706744868 249 138 200
0.7135874877810362 249 139 201
0.7145650048875856 249 139 202
0.7155425219941349 249 139 203
0.7165200391006843 249 139 205
0.7174975562072337 249 140 206
0.718475073313783 249 140 207
0.7194525904203324 250 140 208
0.7204301075268817 250 140 210
0.7214076246334311 250 141 211
0.7223851417399805 250 141 212
0.7233626588465298 250 141 213
0.7243401759530792 250 142 215
0.7253176930596286 250 142 216
0.7262952101661779 250 142 217
0.7272727272727273 250 142 218
0.7282502443792767 250 143 219
0.729227761485826 250 143 221
0.7302052785923754 250 143 222
0.7311827956989247 250 143 223
0.7321603128054741 250 144 224
0.7331378299120235 250 144 225
0.7341153470185728 250 144 226
0.7350928641251222 250 144 228
0.7360703812316716 250 145 229
0.7370478983382209 250 145 230
0.7380254154447703 250 145 231
0.7390029325513197 250 145 232
0.739980449657869 250 146 233
0.7409579667644184 250 146 234
0.7419354838709677 250 146 235
0.7429130009775171 250 147 237
0.7438905180840665 250 147 238
0.7448680351906158 250 147 239
0.7458455522971652 250 147 240
0.7468230694037146 250 148 241
0.7478005865102639 250 148 242
0.7487781036168133 250 148 243
0.7497556207233627 250 148 244
0.750733137829912 250 149 245
0.7517106549364614 250 149 246
0.7526881720430108 250 149 247
0.7536656891495601 250 149 248
0.7546432062561095 250 150 249
0.7556207233626588 249 150 250
0.7565982404692082 249 151 250
0.7575757575757576 248 152 250
0.7585532746823069 247 153 250
0.7595307917888563 246 154 250
0.7605083088954057 245 155 250
0.761485826001955 244 156 250
0.7624633431085044 243 157 250
0.7634408602150538 243 158 250
0.7644183773216031 242 159 250
0.7653958944281525 241 159 250
0.7663734115347018 240 160 250
0.7673509286412512 240 161 251
0.7683284457478006 239 162 251
0.7693059628543499 238 163 251
0.7702834799608993 238 163 251
0.7712609970674487 237 164 251
0.772238514173998 236 165 251
0.7732160312805474 236 166 251
0.7741935483870968 235 166 251
0.7751710654936461 235 167 251
0.7761485826001955 234 168 251
0.7771260997067448 234 168 251
0.7781036168132942 233 169 251
0.7790811339198436 233 170 251
0.7800586510263929 232 170 251
0.7810361681329423 232 171 251
0.7820136852394917 231 172 251
0.782991202346041 231 172 251
0.7839687194525904 230 173 251
0.7849462365591398 230 174 251
0.7859237536656891 229 174 251
0.7869012707722385 229 175 251
0.7878787878787878 229 175 251
0.7888563049853372 228 176 251
0.7898338220918866 228 177 251
0.7908113391984359 228 177 251
0.7917888563049853 227 178 251
0.7927663734115347 227 178 251
0.793743890518084 227 179 251
0.7947214076246334 226 179 251
0.7956989247311828 226 180 251
0.7966764418377321 226 180 251
0.7976539589442815 226 181 251
0.7986314760508308 225 181 251
0.7996089931573802 225 182 252
0.8005865102639296 225 182 252
0.8015640273704789 225 183 252
0.8025415444770283 224 183 252
0.8035190615835777 224 184 252
0.804496578690127 224 184 252
0.8054740957966764 224 185 252
0.8064516129032258 224 185 252
0.8074291300097751 224 186 252
0.8084066471163245 223 186 252
0.8093841642228738 223 187 252
0.8103616813294232 223 187 252
0.8113391984359726 223 188 252
0.8123167155425219 223 188 252
0.8132942326490713 223 189 252
0.8142717497556208 223 189 252
0.8152492668621701 223 189 252
0.8162267839687195 223 190 252
0.8172043010752689 223 190 252
0.8181818181818182 223 191 252
0.8191593352883676 222 191 252
0.820136852394917 222 192 252
0.8211143695014663 222 192 252
0.8220918866080157 222 192 252
0.823069403714565 222 193 252
0.8240469208211144 222 193 252
0.8250244379276638 222 194 252
0.8260019550342131 222 194 252
0.8269794721407625 222 194 252
0.8279569892473119 222 195 252
0.8289345063538612 222 195 252
0.8299120234604106 222 196 252
0.83088954056696 222 196 252
0.8318670576735093 223 196 252
0.8328445747800587 223 197 252
0.833822091886608 223 197 252
0.8347996089931574 223 198 252
0.8357771260997068 223 198 252
0.8367546432062561 223 198 252
0.8377321603128055 223 199 252
0.8387096774193549 223 199 252
0.8396871945259042 223 200 252
0.8406647116324536 223 200 252
0.841642228739003 223 200 252
0.8426197458455523 223 201 252
0.8435972629521017 223 201 252
0.844574780058651 224 201 252
0.8455522971652004 224 202 252
0.8465298142717498 224 202 252
0.8475073313782991 224 202 252
0.8484848484848485 224 203 252
0.8494623655913979 224 203 252
0.8504398826979472 224 204 253
0.8514173998044966 225 204 253
0.852394916911046 225 204 253
0.8533724340175953 225 205 253
0.8543499511241447 225 205 253
0.855327468230694 225 205 253
0.8563049853372434 225 206 253
0.8572825024437928 225 206 253
0.8582600195503421 226 206 253
0.8592375366568915 226 207 253
0.8602150537634409 226 207 253
0.8611925708699902 226 207 253
0.8621700879765396 226 208 253
0.863147605083089 227 208 253
0.8641251221896383 227 208 253
0.8651026392961877 227 209 253
0.8660801564027371 227 209 253
0.8670576735092864 227 209 253
0.8680351906158358 227 210 253
0.8690127077223851 228 210 253
0.8699902248289345 228 210 253
0.8709677419354839 228 211 253
0.8719452590420332 228 211 253
0.8729227761485826 228 211 253
0.873900293255132 229 212 253
0.8748778103616813 229 212 253
0.8758553274682307 229 212 253
0.8768328445747801 229 213 253
0.8778103616813294 229 213 253
0.8787878787878788 229 214 253
0.8797653958944281 230 214 253
0.8807429130009775 230 214 253
0.8817204301075269 230 215 253
0.8826979472140762 230 215 253
0.8836754643206256 230 215 253
0.884652981427175 230 216 253
0.8856304985337243 230 216 253
0.8866080156402737 231 216 253
0.8875855327468231 231 217 253
0.8885630498533724 231 217 253
0.8895405669599218 231 217 253
0.8905180840664711 231 218 253
0.8914956011730205 231 218 253
0.8924731182795699 231 219 253
0.8934506353861192 231 219 253
0.8944281524926686 231 219 253
0.895405669599218 231 220 253
0.8963831867057673 232 220 253
0.8973607038123167 232 220 253
0.8983382209188661 232 221 253
0.8993157380254154 232 221 253
0.9002932551319648 232 222 253
0.9012707722385142 232 222 253
0.9022482893450635 232 222 253
0.9032258064516129 232 223 253
0.9042033235581622 232 223 253
0.9051808406647116 232 223 253
0.906158357771261 232 224 253
0.9071358748778103 232 224 254
0.9081133919843597 232 225 254
0.9090909090909091 232 225 254
0.9100684261974584 232 225 254
0.9110459433040078 232 226 254
0.9120234604105572 232 226 254
0.9130009775171065 233 226 254
0.9139784946236559 233 227 254
0.9149560117302052 233 227 254
0.9159335288367546 233 228 254
0.916911045943304 233 228 254
0.9178885630498533 233 228 254
0.9188660801564027 233 229 254
0.9198435972629521 233 229 254
0.9208211143695014 233 230 254
0.9217986314760508 233 230 254
0.9227761485826002 233 230 254
0.9237536656891495 233 231 254
0.9247311827956989 233 231 254
0.9257086999022482 233 231 254
0.9266862170087976 233 232 254
0.927663734115347 233 232 254
0.9286412512218963 233 233 254
0.9296187683284457 233 233 254
0.9305962854349951 233 233 254
0.9315738025415444 233 234 254
0.9325513196480938 233 234 254
0.9335288367546432 233 234 254
0.9345063538611925 234 235 254
0.9354838709677419 234 235 254
0.9364613880742912 234 236 254
0.9374389051808406 234 236 254
0.9384164222873901 234 236 254
0.9393939393939394 234 237 254
0.9403714565004888 234 237 254
0.9413489736070382 234 237 254
0.9423264907135875 234 238 254
0.9433040078201369 234 238 254
0.9442815249266863 234 239 254
0.9452590420332356 234 239 254
0.946236559139785 235 239 254
0.9472140762463344 235 240 254
0.9481915933528837 235 240 254
0.9491691104594331 235 240 254
0.9501466275659824 235 241 254
0.9511241446725318 235 241 254
0.9521016617790812 235 241 254
0.9530791788856305 235 242 254
0.9540566959921799 235 242 254
0.9550342130987293 236 243 254
0.9560117302052786 236 243 254
0.956989247311828 236 243 254
0.9579667644183774 236 244 254
0.9589442815249267 236 244 254
0.9599217986314761 236 244 254
0.9608993157380255 237 245 254
0.9618768328445748 237 245 254
0.9628543499511242 237 245 254
0.9638318670576735 237 246 254
0.9648093841642229 237 246 254
0.9657869012707723 237 246 254
0.9667644183773216 238 247 254
0.967741935483871 238 247 254
0.9687194525904204 238 247 254
0.9696969696969697 238 248 254
0.9706744868035191 239 248 254
0.9716520039100685 239 248 254
0.9726295210166178 239 249 254
0.9736070381231672 239 249 254
0.9745845552297165 240 249 254
0.9755620723362659 240 249 254
0.9765395894428153 240 250 254
0.9775171065493646 241 250 254
0.978494623655914 241 250 254
0.9794721407624634 241 251 254
0.9804496578690127 242 251 254
0.9814271749755621 242 251 254
0.9824046920821115 242 252 254
0.9833822091886608 243 252 254
0.9843597262952102 243 252 254
0.9853372434017595 244 252 254
0.9863147605083089 244 253 254
0.9872922776148583 245 253 255
0.9882697947214076 245 253 255
0.989247311827957 246 253 255
0.9902248289345064 246 254 255
0.9912023460410557 247 254 255
0.9921798631476051 248 254 255
0.9931573802541545 248 254 255
0.9941348973607038 249 254 255
0.9951124144672532 250 255 255
0.9960899315738025 251 255 255
0.9970674486803519 252 255 255
0.9980449657869013 253 255 255
0.9990224828934506 254 255 255
1.0 255 255 255
#!/bin/bash
#=======================================================================
# Specify the "start" and "end" time.
#=======================================================================
# Use format "HH:MM YYYY-MM-DD"
start="00:00 2023-01-01"
end="00:00 2023-05-31"
increment="+1 days"
#=======================================================================
# Convert start and end time to full Bash datetime format
# For example, it converts "00:00 2021-04-01" to "Thu Apr 1 00:00:00 GMT 2021"
start=$(date -ud "${start}")
end=$(date -ud "${end}")
# The below while statement will loop over each date between the start and
# end time. Each loop will increment the date by "+1 hours" (defined above).
# NOTE: The +%s in the first line converts the date to "seconds since
# EPOC" which makes the comparison between start and end time possible.
# See bottom of page here: https://phoenixnap.com/kb/linux-date-command
while (( $(date -ud "${start}" +%s) <= $(date -ud "${end}" +%s) )); do
current=$(date -ud "${start}" '+%F')
tilelog --date "$current" --tile hourly/
# Increment the value. This changes the value of `$start` every loop
# with the next date.
start=$(date -ud "${start} ${increment}")
done
#!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('files', type=argparse.FileType('r'), nargs='+')
args = parser.parse_args()
maxviews = 0
for f in args.files:
for line in f:
splitline=line.split(' ', 1)
maxviews = max(maxviews, int(splitline[1]))
print(maxviews)
generate hourly files with modified tilelog
find maximum views with maxreqs.py and set constants in convert.py accordingly
create PNGs with for f in hourly/*.txt; do ./convert.py "$f" "hourly/$(basename $f).png"; done
turn PNGs to video with ffmpeg
cd hourly && ffmpeg -framerate 15 -pattern_type glob -i '*.png' -c:v libsvtav1 -crf 10 -b:v 5000k out.mp4
adjust ffmpeg as needed, still need to find good settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment