def read_connections(file_name, point_names):
connections = []<EOL>fid = open(file_name, '<STR_LIT:r>')<EOL>line=fid.readline()<EOL>while(line):<EOL><INDENT>connections.append(np.array(line.split('<STR_LIT:U+002C>')))<EOL>connections[-<NUM_LIT:1>][<NUM_LIT:0>] = connections[-<NUM_LIT:1>][<NUM_LIT:0>].strip()<EOL>connections[-<NUM_LIT:1>][<NUM_LIT:1>] = connections[-<NUM_LIT:1>][<NUM_LIT:1>].strip()<EOL>line = fid.readline()<EOL><DEDENT>connect = np.zeros((len(point_names), len(point_names)),dtype=bool)<EOL>for i in range(len(point_names)):<EOL><INDENT>for j in range(len(point_names)):<EOL><INDENT>for k in range(len(connections)):<EOL><INDENT>if connections[k][<NUM_LIT:0>] == point_names[i] and connections[k][<NUM_LIT:1>] == point_names[j]:<EOL><INDENT>connect[i,j]=True<EOL>connect[j,i]=True<EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return connect<EOL>
Read a file detailing which markers should be connected to which for motion capture data.