Why is all the HackRF_Sweep CSV data in negative values?

Talk about other SDR products like the FunCube, HackRF, BladeRF etc.
Post Reply
repsDR
Posts: 2
Joined: Sat Jan 02, 2021 8:20 am

Why is all the HackRF_Sweep CSV data in negative values?

Post by repsDR » Thu Jan 14, 2021 3:50 am

Does anyone know why HackRF_Sweep data is all in negatives? I have GBs of CSV and all data is negative, 100%
2009-01-01, 03:33:08, 6516000000, 6521000000, 1000000.00, 20, -70.05, -71.06, -64.32, -60.30, -66.01
2009-01-01, 03:33:08, 6521000000, 6526000000, 1000000.00, 20, -132.70, -71.94, -61.23, -63.19, -68.72 <----
2009-01-01, 03:33:08, 6531000000, 6536000000, 1000000.00, 20, -65.25, -62.03, -65.52, -65.65, -69.17
2009-01-01, 03:33:08, 6526000000, 6531000000, 1000000.00, 20, -75.39, -63.52, -63.28, -67.35, -70.53
2009-01-01, 03:33:08, 6536000000, 6541000000, 1000000.00, 20, -66.85, -69.10, -62.96, -63.72, -74.61
2009-01-01, 03:33:08, 6541000000, 6546000000, 1000000.00, 20, -66.87, -70.91, -64.29, -61.44, -61.95
2009-01-01, 03:33:08, 6551000000, 6556000000, 1000000.00, 20, -65.71, -71.73, -63.89, -61.65, -62.29
I'm concerned because heatmap.py is throwing an IndexError when the negative number greater than -100
Line 357-363 heatmap.py (MOssmann version on github)

I believe this line is actually just falling into some division by zero error

Code: Select all

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))<-------
        return palette[tone_scaled]
    return rgb_inner
This is the Error output from terminal:
loading
x: 7260, y: 2130, z: (-139.340000, -19.710000)
drawing
Traceback (most recent call last):
File "./heatmap.py", line 621, in <module>
img = push_pixels(args)
File "./heatmap.py", line 422, in push_pixels
pix[x,y+tape_height] = rgb(zs[x])
File "./heatmap.py", line 362, in rgb_inner <--------
return palette[tone_scaled]
IndexError: list index out of range

Post Reply