Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list index out of range in summarize_pass #12

Open
ghost opened this issue Aug 27, 2016 · 3 comments
Open

list index out of range in summarize_pass #12

ghost opened this issue Aug 27, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 27, 2016

pi@pi:~/heatmaps $ python heatmap.py --ytick 15m 20160823_000001-24M-1700M-500k-30-1430m.csv 20160823_000001-24M-1700M-500k-30-1430m.png 
loading
Traceback (most recent call last):
  File "heatmap.py", line 615, in <module>
    summarize_pass(args)
  File "heatmap.py", line 244, in summarize_pass
    low  = int(line[2]) + args.offset_freq
IndexError: list index out of range

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

@bogdanr
Copy link

bogdanr commented Apr 8, 2017

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.

@JamesTheHacker
Copy link

JamesTheHacker commented Jul 15, 2017

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/

@arkadiam
Copy link

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

eric-foy added a commit to eric-foy/rtl-sdr-misc that referenced this issue Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants