Compare commits
1 Commits
nilmtools-
...
python2
Author | SHA1 | Date | |
---|---|---|---|
0cf2db6c5e |
@@ -96,8 +96,11 @@ def process(data, interval, args, insert_function, final):
|
|||||||
rows = data.shape[0]
|
rows = data.shape[0]
|
||||||
|
|
||||||
# Estimate sampling frequency from timestamps
|
# Estimate sampling frequency from timestamps
|
||||||
fs = (rows-1) / (timestamp_to_seconds(data[-1][0]) -
|
ts_min = timestamp_to_seconds(data[0][0])
|
||||||
timestamp_to_seconds(data[0][0]))
|
ts_max = timestamp_to_seconds(data[-1][0])
|
||||||
|
if ts_min >= ts_max:
|
||||||
|
return 0
|
||||||
|
fs = (rows-1) / (ts_max - ts_min)
|
||||||
|
|
||||||
# Pull out about 3.5 periods of data at once;
|
# Pull out about 3.5 periods of data at once;
|
||||||
# we'll expect to match 3 zero crossings in each window
|
# we'll expect to match 3 zero crossings in each window
|
||||||
|
Reference in New Issue
Block a user