From 0c6d3629e10363016e4a53d25bd9da37088b4588 Mon Sep 17 00:00:00 2001 From: Eggert Jung Date: Sat, 27 Aug 2022 02:30:18 +0200 Subject: [PATCH] fix bug --- kisli.py | 8 ++++++-- liveview.py | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kisli.py b/kisli.py index a482238..34daf35 100644 --- a/kisli.py +++ b/kisli.py @@ -138,13 +138,15 @@ def done(): def calc_vector(px, py, point_specific_matrix): vect = [0, 0] + print("spcific point = {}, {}".format(px, py)) for x in range(9): for y in range(10): if(px != x or py != y): - diff = [px-x, py-y] #Abstandsvektor + diff = [x-px, y-py] #Abstandsvektor mag = np.sqrt(diff[0]**2 + diff[1]**2) #betrag vect[0] += point_specific_matrix[x][y]*diff[0] / mag vect[1] += point_specific_matrix[x][y]*diff[1] / mag + print("{}: vect += {} / {} == {}".format([x,y],diff, mag, vect)) return vect """ ============================================================================================================== @@ -181,9 +183,11 @@ if args.fromfile: vectormap = np.zeros(shape=(90, 2)) i = 0 for row in full_matrix: + print(i) point_specific_matrix=get_mapped(row) - vectormap[i] = calc_vector(0, 0, point_specific_matrix) + vectormap[i] = calc_vector(channels.map[i][0], channels.map[i][1], point_specific_matrix) i+=1 + print() mapped_vectormap = get_vector_mapped(vectormap) mapped_vectormap /= max(mapped_vectormap.min(), mapped_vectormap.max(), key=abs) diff --git a/liveview.py b/liveview.py index 71c2ed2..3aa9209 100644 --- a/liveview.py +++ b/liveview.py @@ -26,8 +26,8 @@ class VectorView: pyplot.title('Single Vector') ## x-lim and y-lim - #pyplot.xlim(-2, 5) - #pyplot.ylim(-2, 2.5) + pyplot.xlim(-1, 10) + pyplot.ylim(-2, 11) # Show plot with grid pyplot.grid()