diff --git a/kisli.py b/kisli.py index bd507d6..b5165ab 100644 --- a/kisli.py +++ b/kisli.py @@ -190,34 +190,6 @@ if args.fromfile: print() - if args.view == "N": - neighview = np.zeros(shape=(30,32)) - - i = 0 - for row in full_matrix: - point_specific_matrix=get_mapped(row) - - #coordinates of specific point - y_pos = channels.map[i][1] - 1 - x_pos = channels.map[i][0] - 1 - - if(x_pos+1 < 9): - neighview[(x_pos*3)+2][(y_pos*3)+1] = point_specific_matrix[x_pos+1][y_pos] - - if(x_pos-1 >= 0): - neighview[(x_pos*3)+0][(y_pos*3)+1] = point_specific_matrix[x_pos-1][y_pos] - - if(y_pos+1 < 10): - neighview[(x_pos*3)+1][(y_pos*3)+2] = point_specific_matrix[x_pos][y_pos+1] - - if(y_pos-1 >= 0): - neighview[(x_pos*3)+1][(y_pos*3)+0] = point_specific_matrix[x_pos][y_pos-1] - - i+=1 - - viewer = liveview.ResistanceView(maximum=4000) - viewer.updateView(neighview) - else: s = socket.socket() # Establish a TCP/IP socket object instrConnect(s, ip_address, port, 20000, 0, 0) @@ -245,6 +217,35 @@ else: # Close the socket connection instrDisconnect(s) +if args.view == "N": + neighview = np.zeros(shape=(30,32)) + + i = 0 + for row in full_matrix: + point_specific_matrix=get_mapped(row) + + #coordinates of specific point + y_pos = channels.map[i][1] - 1 + x_pos = channels.map[i][0] - 1 + + if(x_pos+1 < 9): + neighview[(x_pos*3)+2][(y_pos*3)+1] = point_specific_matrix[x_pos+1][y_pos] + + if(x_pos-1 >= 0): + neighview[(x_pos*3)+0][(y_pos*3)+1] = point_specific_matrix[x_pos-1][y_pos] + + if(y_pos+1 < 10): + neighview[(x_pos*3)+1][(y_pos*3)+2] = point_specific_matrix[x_pos][y_pos+1] + + if(y_pos-1 >= 0): + neighview[(x_pos*3)+1][(y_pos*3)+0] = point_specific_matrix[x_pos][y_pos-1] + + i+=1 + + viewer = liveview.ResistanceView(maximum=full_matrix.max()) + viewer.updateView(neighview) + + if args.view == "M": viewer = liveview.ResistanceView(maximum=full_matrix.max()) viewer.updateView(get_mapped(np.mean(full_matrix, axis = 0)))