You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
845 B
30 lines
845 B
3 years ago
|
import csv
|
||
|
import datetime
|
||
|
|
||
|
def load_raw_data(path):
|
||
|
data = list()
|
||
|
with open(path) as csv_file:
|
||
|
csv_reader = csv.reader(csv_file, delimiter=",")
|
||
|
for r in csv_reader:
|
||
|
if (r[1] != "Time Stamp"):
|
||
|
data.append( (r[1], r[2]) )
|
||
|
return data
|
||
|
|
||
|
def save_rps_totals(totals, path):
|
||
|
with open(path, mode="w") as result:
|
||
|
wtr = csv.writer(result)
|
||
|
for k, v in totals.items():
|
||
|
wtr.writerow([k,v])
|
||
|
|
||
|
def save_rps_above_threshold(readings, path):
|
||
|
with open(path, mode="w", newline='') as result:
|
||
|
wtr = csv.writer(result)
|
||
|
for item in readings:
|
||
|
wtr.writerow([item])
|
||
|
|
||
|
def save_filtered_flickers(readings, path):
|
||
|
with open(path, mode="w") as results:
|
||
|
wtr = csv.writer(results)
|
||
|
for item in readings:
|
||
|
wtr.writerow(item)
|