]> git.treefish.org Git - phys/latscripts.git/commitdiff
...
authorALEXANDER_SCHMIDT <05schmid@frodo.(none)>
Fri, 24 Jan 2014 12:47:29 +0000 (13:47 +0100)
committerALEXANDER_SCHMIDT <05schmid@frodo.(none)>
Fri, 24 Jan 2014 12:47:29 +0000 (13:47 +0100)
meanstep.py [new file with mode: 0755]

diff --git a/meanstep.py b/meanstep.py
new file mode 100755 (executable)
index 0000000..64f28f0
--- /dev/null
@@ -0,0 +1,35 @@
+#!/usr/bin/python
+
+""" meanstep.py
+ ...
+"""
+
+import sys
+import os
+
+results = {}
+
+if len(sys.argv) != 4:
+    print "usage: ./meanstep.py <datadir> <matching col 1>,...,<matching col n> <mean col 1>,...,<mean col n>"
+    exit(0)
+
+matchcols = sys.argv[2].split(",")
+
+for root, dirs, filenames in os.walk(sys.argv[1]):
+    for f in filenames:
+        if f[-4:] != ".dat":
+            continue
+
+        with open(root + "/" + f) as inf:
+            for line in inf:
+                if line[0:1] == "#":
+                    continue
+
+                linecols = line.split()
+                matchkey = ""
+                for imatchcol in range(0,len(matchcols)):
+                    matchkey = matchkey + linecols[int(matchcols[imatchcol])]
+                
+                
+
+        #results[f[:-4]] = "tefds"