def parse_text(file_name):
<EOL>fid = open(file_name, '<STR_LIT:r>')<EOL>point_names = np.array(fid.readline().split())[<NUM_LIT:2>:-<NUM_LIT:1>:<NUM_LIT:3>]<EOL>fid.close()<EOL>for i in range(len(point_names)):<EOL><INDENT>point_names[i] = point_names[i][<NUM_LIT:0>:-<NUM_LIT:2>]<EOL><DEDENT>S = np.loadtxt(file_name, skiprows=<NUM_LIT:1>)<EOL>field = np.uint(S[:, <NUM_LIT:0>])<EOL>times = S[:, <NUM_LIT:1>]<EOL>S = S[:, <NUM_LIT:2>:]<EOL>S[S==-<NUM_LIT>] = np.NaN<EOL>points = []<EOL>points.append(S[:, <NUM_LIT:0>:-<NUM_LIT:1>:<NUM_LIT:3>])<EOL>points.append(S[:, <NUM_LIT:1>:-<NUM_LIT:1>:<NUM_LIT:3>])<EOL>points.append(S[:, <NUM_LIT:2>:-<NUM_LIT:1>:<NUM_LIT:3>])<EOL>return points, point_names, times<EOL>
Parse data from Ohio State University text mocap files (http://accad.osu.edu/research/mocap/mocap_data.htm).