Compare commits

...

2 Commits

Author SHA1 Message Date
62c8af41ea Cleanup comments 2013-06-06 15:34:23 -04:00
4f6bc48619 sinefit: include timestamps on marking output too 2013-05-11 11:00:31 -04:00

View File

@@ -1,7 +1,6 @@
#!/usr/bin/python
# Sine wave fitting. This runs about 5x faster than realtime on raw data.
# Sine wave fitting.
from nilmdb.utils.printf import *
import nilmtools.filter
import nilmdb.client
@@ -74,7 +73,7 @@ class SuppressibleWarning(object):
def _write(self, sec, msg):
if sec:
now = "[" + timestamp_to_human(seconds_to_timestamp(sec)) + "] "
now = timestamp_to_human(seconds_to_timestamp(sec)) + ": "
else:
now = ""
sys.stderr.write(now + msg)
@@ -180,7 +179,12 @@ def process(data, interval, args, insert_function, final):
# Return the number of rows we've processed
warn.reset(last_inserted_timestamp)
print "Marked", num_zc, "zero-crossings in", start, "rows"
if last_inserted_timestamp:
now = timestamp_to_human(seconds_to_timestamp(
last_inserted_timestamp)) + ": "
else:
now = ""
printf("%sMarked %d zero-crossings in %d rows\n", now, num_zc, start)
return start
def sfit4(data, fs):