Open ghost opened 8 years ago
It happens for me too but in a different function:
loading
x: 76801, y: 10, z: (-46.080000, -19.740000)
drawing
Traceback (most recent call last):
File "/usr/bin/heatmap.py", line 618, in <module>
img = push_pixels(args)
File "/usr/bin/heatmap.py", line 420, in push_pixels
pix[x,y+tape_height] = rgb(zs[x])
File "/usr/bin/heatmap.py", line 360, in rgb_inner
return palette[tone_scaled]
IndexError: list index out of range
The file will be here for a few more days: https://ufile.io/e18c4
After generating the file I actually did a head -n 1234 original.csv > smaller.csv
to shorten the file.
Did you ever solve the issue @bodganr ... I'm having the exact same issue. If I can solve it I'll do a PR.
For anyone else facing the same issue this might help: https://www.reddit.com/r/RTLSDR/comments/220ph0/heatmappy_problems/
As a workaround for @bogdanr case I've changed rgb_inner function to look like:
def rgb_fn(palette, min_z, max_z):
"palette is a list of tuples, returns a function of z"
def rgb_inner(z):
tone = (z - min_z) / (max_z - min_z)
tone_scaled = int(tone * (len(palette)-1))
if tone_scaled >= len(palette):
tone_scaled = len(palette)-1
return palette[tone_scaled]
return rgb_inner
This happens to all my csv files. I loaded one of them up in http://heat.wq.lc and they seem to work fine. This is being run on a Raspberry Pi 1...
rtl_power output files can be found here: https://files.fm/u/ynpq9pnj