utils: fix numpy deprecation warnings
This commit is contained in:
parent
7d1a927425
commit
79fc1c4f59
|
@ -14,7 +14,7 @@ def load_data():
|
||||||
print(f"Error: not a complex signal file. Format {header} not implemented yet.")
|
print(f"Error: not a complex signal file. Format {header} not implemented yet.")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
T = np.fromfile(infile, dtype=np.float32, count=1)
|
T = np.fromfile(infile, dtype=np.float32, count=1)[0]
|
||||||
data = np.fromfile(infile, dtype=np.complex64)
|
data = np.fromfile(infile, dtype=np.complex64)
|
||||||
|
|
||||||
f = np.arange(-1/(2*T), 1/(2*T), 1/T/data.size)[:data.size]
|
f = np.arange(-1/(2*T), 1/(2*T), 1/T/data.size)[:data.size]
|
||||||
|
|
|
@ -8,10 +8,10 @@ import matplotlib.pyplot as pp
|
||||||
with open(sys.argv[1], 'rb') as infile:
|
with open(sys.argv[1], 'rb') as infile:
|
||||||
header = infile.read(4)
|
header = infile.read(4)
|
||||||
if header == b'CPX_':
|
if header == b'CPX_':
|
||||||
T = np.fromfile(infile, dtype=np.float32, count=1)
|
T = np.fromfile(infile, dtype=np.float32, count=1)[0]
|
||||||
data = np.fromfile(infile, dtype=np.complex64)
|
data = np.fromfile(infile, dtype=np.complex64)
|
||||||
elif header == b'FLT_':
|
elif header == b'FLT_':
|
||||||
T = np.fromfile(infile, dtype=np.float32, count=1)
|
T = np.fromfile(infile, dtype=np.float32, count=1)[0]
|
||||||
data = np.fromfile(infile, dtype=np.float32)
|
data = np.fromfile(infile, dtype=np.float32)
|
||||||
else:
|
else:
|
||||||
print(f"Error: Format {header} not implemented yet.")
|
print(f"Error: Format {header} not implemented yet.")
|
||||||
|
|
Loading…
Reference in a new issue