Commit f29c8233 authored by dhomm's avatar dhomm
Browse files

change placement finder

parent b686ed7c
......@@ -7,6 +7,8 @@ the placement and
"""
from av.io import read
import numpy as np
from numpy import mean, sqrt, square, var, corrcoef, std, quantile, percentile
from scipy.stats import skew, kurtosis
def placement_finder(walking_acc, walking_gyro, freq=100):
"""
......@@ -139,7 +141,7 @@ def placement_finder_one_file(file, position_key):
walking_acc = acc[start:end]
walking_gyro = gyr[start:end]
placement = placement_finder(walking_acc, walking_gyro, freq=freq)
print("For the metadata palcement:\t", acc.info.metadata[position_key], "was the:\t", placement, "chosen")
print("For the metadata placement:\t", acc.info.metadata[position_key], " \twas the: ", placement, " \tchosen")
if __name__ == "__main__":
......
......@@ -241,8 +241,7 @@ def sensor_decider(sensors, placement, position_key):
shin = [("mean_acc", "gt", 10.2), ("pps_acc", "gt", 0.5), ("mean_gyr", "gt", 1.5), ("pps_gyr", "gt", 0.2)]
thigh = [("mean_acc", "gt", 10), ("pps_acc", "gt", 0.5), ("mean_gyr", "gt", 1.1), ("pps_gyr", "gt", 0.05)]
p_s = []
!# use placement_recognition to know what sensors are in the restrictions
if placement == "chest":
s = get_n_min_max(sensors, "mean_gyr", 3, "min") # muss überprüft werden sollte aber passen
p_s = [sensors[i[0]] for i in s]
......@@ -396,3 +395,6 @@ def sensor_decider(sensors, placement, position_key):
else:
return "This placement is not in a subset of the used data set"
if __name__ == "__main__":
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment