rtl-sdr-misc icon indicating copy to clipboard operation
rtl-sdr-misc copied to clipboard

heatmap.py: NameError: name 'low' is not defined

Open emilburzo opened this issue 8 years ago • 4 comments

When using heatmap.py with the --low argument, e.g.:

./heatmap.py --low 24M --high 29M data.csv all.png

I get the following:

loading
Traceback (most recent call last):
  File "./heatmap.py", line 615, in <module>
    summarize_pass(args)
  File "./heatmap.py", line 261, in summarize_pass
    start_col, stop_col = slice_columns(columns, args.low_freq, args.high_freq)
  File "./heatmap.py", line 223, in slice_columns
    if low_freq  is not None and low <= low_freq  <= high:
NameError: name 'low' is not defined

emilburzo avatar Jun 29 '16 03:06 emilburzo

https://github.com/HHsty/rtl-sdr-misc/commit/c03e3070bbdf0a96d5e771564979297a81298967

HHsty avatar Sep 15 '16 10:09 HHsty

@keenerd I am not a python programmer but I am a programmer. If you give me some pointers as to what you think the problem is and how to fix it, I can take a stab at it.

stillnet avatar Oct 02 '16 16:10 stillnet

im stumbling onto this now as well

wayne-desk@wayne-desk:~$ ./heatmap.py --ytick 5m --low 144M --high 148M 2m1214162325.csv 2m1214162325.png loading Traceback (most recent call last): File "./heatmap.py", line 615, in summarize_pass(args) File "./heatmap.py", line 261, in summarize_pass start_col, stop_col = slice_columns(columns, args.low_freq, args.high_freq) File "./heatmap.py", line 223, in slice_columns if low_freq is not None and low <= low_freq <= high: NameError: global name 'low' is not defined

looking under the hood "low" seems to be defined the same (but opposite) of "high" but it could be a simple syntax error for all i know i am not a programmer nor do i play one on TV

k9wkj avatar Dec 15 '16 17:12 k9wkj

It looks to me like the slice_columns function was factored from some inline code at some point, and care wasn't taken to make sure all the necessary variables were in scope. So, I passed in low and high from the calling context, and it appears to work OK.

Sorry to be a bit lazy and not make a pull request. Modified file attached below.

heatmap.py.txt

jeffkowalski avatar Jul 22 '20 02:07 jeffkowalski