1
0
Fork 0
Browse Source

add save function for filtered flickers list.

This could do with being generalised with the other save functions (in
io_services). For now, it's job is to save the list of readings which
contain four or more readings-per-second and at least one of them is
over 39. The specificness of the 39 is because the test data used is
from 'factory1' (Light Meter) and that is the threshold for triggering
the lights connected to 'gallery1' in the gallery.
stable
Craig Oates 3 years ago
parent
commit
80cf014c21
  1. 5
      src/services/io_services.py

5
src/services/io_services.py

@ -21,3 +21,8 @@ def save_rps_above_threshold(readings, path):
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, delimiter=',', lineterminator='\n')
wtr.writerows(readings)