summaryrefslogtreecommitdiffstats
path: root/data/combined/height.py
diff options
context:
space:
mode:
authorJon Whiteaker <jbw@berkeley.edu>2012-02-22 17:03:09 -0800
committerJon Whiteaker <jbw@berkeley.edu>2012-02-22 17:03:09 -0800
commit80fa7033e12b896f314757ccd2067268d08dd2d5 (patch)
tree6c9e6dc4c58f942696177b01642dae16cf902768 /data/combined/height.py
parentd9c41d3c4ad0e006e719892a00bdb40874830ae2 (diff)
downloadkinect-80fa7033e12b896f314757ccd2067268d08dd2d5.tar.gz
added height
Diffstat (limited to 'data/combined/height.py')
-rwxr-xr-xdata/combined/height.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/data/combined/height.py b/data/combined/height.py
new file mode 100755
index 0000000..5a8dd02
--- /dev/null
+++ b/data/combined/height.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+
+import sys
+
+sk_file = open(sys.argv[1])
+labels = sk_file.readline().strip().split(',')
+end = labels.index('h-sc')
+print(','.join(labels[0:end] + ["height"]))
+for line in sk_file:
+ line = line.strip().split(',')
+ out = line[0:end]
+ height = 0.0
+ for limb in map(lambda x: float(line[labels.index(x)]), ['h-sc','sc-s','s-hc','hi-kn','kn-an']):
+ if limb > 0:
+ height += limb
+ else:
+ height = -1
+ break
+ out += [str(height)]
+ print(','.join(out))
+
+