__author__ = 'smathias' import os import pandas import solarpy.py2solar.parse as parse import solarpy.utils.paths as paths from make_asym_jobs import structures path = paths.pj(paths.OUTPUTS_DIR, 'asymmetries_mpi') data = [] for structure in structures: dic = {'name': structure} for x in ['Bilateral_', 'Left_', 'Right_', 'Asym_', 'Abs_Asym_']: _f = x + structure + '.sub' f = paths.pj(path, [f for f in os.listdir(path) if _f == f[:len(_f)]][0]) _dic = {x + k: v for k, v in parse.uni_polyg(f).iteritems()} dic.update(_dic) _f = 'rhog_' + structure + '.sub' f = paths.pj(path, [f for f in os.listdir(path) if _f in f][0]) _dic = parse.biv_polyg(f) dic.update(_dic) data.append(dic) df = pandas.DataFrame(data) df.to_csv('results.csv')
""" Grab the sats. """ __author__ = 'smathias' import os import pandas import solarpy.py2solar.parse as parse import solarpy.utils.paths as paths outputs_dir = paths.pj(paths.OUTPUTS_DIR, 'braincog') output_files = os.listdir(outputs_dir) entries = {} print len(output_files) for f in output_files: dic = parse.uni_polyg(paths.pj(outputs_dir, f)) entries[f.split('.')[0]] = dic df = pandas.DataFrame(entries).T df = df.drop(['f', 'trait', 'n', 'se'], axis=1) df.to_csv('h2rs.csv')