Use np.linspace() instead of np.arange() in soapy_power, rtl_power and rx_power backends
This commit is contained in:
parent
5505f0dfd7
commit
4571075bd9
@ -77,7 +77,8 @@ class PowerThread(BasePowerThread):
|
|||||||
step = float(line[4])
|
step = float(line[4])
|
||||||
samples = float(line[5])
|
samples = float(line[5])
|
||||||
|
|
||||||
x_axis = list(np.arange(start_freq + self.lnb_lo, stop_freq + self.lnb_lo, step))
|
x_axis = list(np.linspace(start_freq + self.lnb_lo, stop_freq + self.lnb_lo,
|
||||||
|
round((stop_freq - start_freq) / step)))
|
||||||
y_axis = [float(y) for y in line[6:]]
|
y_axis = [float(y) for y in line[6:]]
|
||||||
if len(x_axis) != len(y_axis):
|
if len(x_axis) != len(y_axis):
|
||||||
print("ERROR: len(x_axis) != len(y_axis), use newer version of rtl_power!")
|
print("ERROR: len(x_axis) != len(y_axis), use newer version of rtl_power!")
|
||||||
|
@ -82,7 +82,8 @@ class PowerThread(BasePowerThread):
|
|||||||
step = float(line[4])
|
step = float(line[4])
|
||||||
samples = float(line[5])
|
samples = float(line[5])
|
||||||
|
|
||||||
x_axis = list(np.arange(start_freq + self.lnb_lo, stop_freq + self.lnb_lo, step))
|
x_axis = list(np.linspace(start_freq + self.lnb_lo, stop_freq + self.lnb_lo,
|
||||||
|
round((stop_freq - start_freq) / step)))
|
||||||
y_axis = [float(y) for y in line[6:]]
|
y_axis = [float(y) for y in line[6:]]
|
||||||
if len(x_axis) != len(y_axis):
|
if len(x_axis) != len(y_axis):
|
||||||
print("ERROR: len(x_axis) != len(y_axis)!")
|
print("ERROR: len(x_axis) != len(y_axis)!")
|
||||||
|
@ -169,9 +169,10 @@ class PowerThread(BasePowerThread):
|
|||||||
step = header.step
|
step = header.step
|
||||||
samples = header.samples
|
samples = header.samples
|
||||||
|
|
||||||
x_axis = np.arange(start_freq, stop_freq, step)
|
x_axis = np.linspace(start_freq, stop_freq, round((stop_freq - start_freq) / step))
|
||||||
if len(x_axis) != len(y_axis):
|
if len(x_axis) != len(y_axis):
|
||||||
print("ERROR: len(x_axis) != len(y_axis)")
|
print("ERROR: len(x_axis) != len(y_axis)")
|
||||||
|
return
|
||||||
|
|
||||||
if self.min_freq is None:
|
if self.min_freq is None:
|
||||||
self.min_freq = start_freq
|
self.min_freq = start_freq
|
||||||
|
Loading…
Reference in New Issue
Block a user