Skip to content

Commit

Permalink
Remove unused vars/numpy from grscan.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkiwi committed Nov 23, 2023
1 parent 9df0922 commit 4e82d74
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions gamutrf/grscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import logging
import sys
from pathlib import Path
import numpy as np

try:
from gnuradio import filter as grfilter # pytype: disable=import-error
Expand Down Expand Up @@ -160,7 +159,6 @@ def __init__(
pretune,
)
self.fft_blocks = fft_blocks + self.get_db_blocks(nfft, samp_rate, scaling)

retune_fft = self.iqtlabs.retune_fft(
"rx_freq",
nfft,
Expand Down Expand Up @@ -191,10 +189,6 @@ def __init__(
if inference_output_dir:
x = 640
y = 640
image_shape = (x, y, 3)
image_vlen = np.prod(image_shape)
prediction_shape = (1, 8, 8400)
prediction_vlen = np.prod(prediction_shape)
Path(inference_output_dir).mkdir(parents=True, exist_ok=True)
self.inference_blocks = [
self.iqtlabs.image_inference(
Expand All @@ -209,7 +203,7 @@ def __init__(
norm_type=32, # cv::NORM_MINMAX = 32
colormap=16, # cv::COLORMAP_VIRIDIS = 16, cv::COLORMAP_TURBO = 20,
interpolation=1, # cv::INTER_LINEAR = 1,
flip=0,
flip=0, # 0 means flipping around the x-axis
min_peak_points=inference_min_db,
model_server=inference_model_server,
model_name=inference_model_name,
Expand All @@ -234,6 +228,7 @@ def __init__(
self.msg_connect((retune_fft, "tune"), (self.sources[0], cmd_port))
self.connect_blocks(self.sources[0], self.sources[1:])
self.connect((retune_fft, 1), (self.inference_blocks[0], 0))

self.connect_blocks(self.inference_blocks[0], self.inference_blocks[1:])
for pipeline_blocks in (
self.fft_blocks,
Expand Down Expand Up @@ -287,7 +282,7 @@ def get_offload_fft_block(
blocks.vector_to_stream(gr.sizeof_gr_complex * nfft, fft_batch_size),
]
if fft_roll:
offload_blocks.append(self.iqtlabs.vector_roll(nfft)),
offload_blocks.append(self.iqtlabs.vector_roll(nfft))
return offload_blocks

def get_fft_blocks(
Expand Down

0 comments on commit 4e82d74

Please sign in to comment.