jar_project/second_try.py
2020-06-24 16:51:11 +02:00

36 lines
770 B
Python

import matplotlib.pyplot as plt
import os
import glob
import IPython
from IPython import embed
def parse_dataset(dataset_name):
assert(os.path.exists(dataset_name))
f = open(dataset_name, 'r')
lines = f.readlines()
f.close()
time = []
frequency = []
amplitude = []
for i in range(len(lines)):
print(lines[i])
l = lines[i].strip()
if len(l) > 0 and l[0] is not '#':
temp = list(map(float, l.split()))
time.append(temp[0])
frequency.append(temp[1])
amplitude.append(temp[2])
return time, frequency, amplitude
dataset = os.path.join('D:\\', 'jar_project', 'JAR', '2020-06-22-ac', 'beats-eod.dat')
t, f, a = parse_dataset(dataset)
plt.plot(t, f)
plt.show()