From 312685835e0eb1472801c93b5dbd5152808617a5 Mon Sep 17 00:00:00 2001 From: xaver Date: Wed, 24 Jun 2020 15:42:11 +0200 Subject: [PATCH] 2.backup --- second_try.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/second_try.py b/second_try.py index edc24df..eb620fa 100644 --- a/second_try.py +++ b/second_try.py @@ -3,11 +3,6 @@ import os import glob import IPython from IPython import embed -""" -'lines = os.open('2020-06-22-aa', 'beats-eod.dat') -print(lines) -embed() -""" @@ -19,8 +14,8 @@ def parse_dataset(dataset_name): print(type(lines)) time = [] - frequencies = [] - amplitudes = [] + frequency = [] + amplitude = [] for i in range(len(lines)): print(lines[i]) @@ -29,11 +24,16 @@ def parse_dataset(dataset_name): if len(l) > 0 and l[0] is not '#': temp = list(map(float, l.split(l))) - time.append([0]) - frequencies.append([1]) - amplitudes.append([2]) + time.append(temp[0]) + frequency.append(temp[1]) + amplitude.append(temp[2]) - return time, frequencies, amplitudes + return time, frequency, amplitude -plt.plot(time, frequencies) \ No newline at end of file +dataset = 'D:\ jar project\ JAR\ 2020-06-22-aa\ beats-eod.dat' + +t, f, a = parse_dataset(dataset) + +plt.plot(t, f) +plt.show() \ No newline at end of file