Permalink
Browse files

Check bincount in data coming from backend

The backend may return fewer data points than expected. This can e.g. be
observed for the hackrf_sweep backend on high system load. Currently
this leads to an error when trying to insert the data into the
HistoryBuffer and causes the application to crash:

ValueError: cannot copy sequence with size 24750 to array axis with dimension 25000

As a workaround, just ignore data in this case.
  • Loading branch information...
michaellass committed Mar 21, 2017
1 parent 5d41c6c commit 9dc1433bdfff8612d0bfd26c54ffe1c8e585ce45
Showing with 4 additions and 0 deletions.
  1. +4 −0 qspectrumanalyzer/data.py
@@ -105,6 +105,10 @@ def wait(self):
def update(self, data):
"""Update data storage"""
if self.y is not None and len(data["y"]) != len(self.y):
print("{:d} bins coming from backend, expected {:d}".format(len(data["y"]), len(self.y)))
return
self.average_counter += 1
if self.x is None:

0 comments on commit 9dc1433

Please sign in to comment.