Skip to content

Commit

Permalink
Merge pull request #1058 from anarkiwi/batch
Browse files Browse the repository at this point in the history
Create more than one image per interval.
  • Loading branch information
anarkiwi authored Dec 21, 2023
2 parents b96f0a9 + 873c86c commit f6fb4a0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libvulkan-dev \
python3-numpy
WORKDIR /root
RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.58
RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.59
COPY --from=iqtlabs/gamutrf-vkfft:latest /root /root/gr-iqtlabs
WORKDIR /root/gr-iqtlabs/build
COPY --from=sigmf-builder /usr/local /usr/local
Expand Down
4 changes: 4 additions & 0 deletions gamutrf/grscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ def __init__(
gr.top_block.__init__(self, "scan", catch_exceptions=True)

tune_step_hz = int(samp_rate * tuneoverlap)
stare = False

if freq_end == 0:
stare = True
freq_end = freq_start + (tune_step_hz - 1)
logging.info(
f"using stare mode, scan from {freq_start/1e6}MHz to {freq_end/1e6}MHz"
Expand Down Expand Up @@ -154,6 +156,8 @@ def __init__(
logging.info(
f"requested retuning across {freq_range/1e6}MHz every {tune_step_fft} FFTs, dwell time {tune_dwell_ms}ms"
)
if stare and tune_dwell_ms > 1e3:
logging.warn(">1s dwell time in stare mode, updates will be slow!")

self.fft_blocks = (
self.get_dc_blocks(dc_block_len, dc_block_long)
Expand Down
10 changes: 5 additions & 5 deletions gamutrf/grsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def airt_workaround_start_hook(self):
self.sources[0].set_bandwidth(0, rate)


class file_source_tagger(gr.sync_block):
class file_source_tagger(gr.basic_block):
def __init__(
self,
input_file,
cmd_port,
):
gr.sync_block.__init__(
gr.basic_block.__init__(
self,
name="file_source_tagger",
in_sig=None,
Expand Down Expand Up @@ -71,17 +71,17 @@ def add_tags(self):
pmt.from_double(self.center_freq),
)

def work(self, input_items, output_items):
def general_work(self, input_items, output_items):
if self.complete():
return 0
return -1
if self.need_tags:
self.add_tags()
self.need_tags = False
n = len(output_items[0])
samples = self.samples[self.i : self.i + n]
if len(samples) < n:
self.i = self.n_samples
return 0
return -1
self.i += len(samples)
output_items[0][:] = samples
return len(samples)
Expand Down
6 changes: 2 additions & 4 deletions gamutrf/offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ def main():
"iqtlabs": iqtlabs,
"freq_end": 0,
"freq_start": freq_start,
"pretune": True,
"samp_rate": int(meta["sample_rate"]),
"sdr": "file:" + filename,
"pretune": True,
}
)
tb = grscan(**scan_args)
tb.start()
while not tb.sources[0].complete():
time.sleep(1)
tb.stop()
tb.wait()
tb.stop()

0 comments on commit f6fb4a0

Please sign in to comment.