From a6c62f376be6db94101d60544694173c313a7198 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 22 Dec 2022 16:55:04 +0100 Subject: [PATCH] ZH: invert sign for baseline phase diff a[j,i] When building the matrix, make sure to introduce a minus sign such that a[i,j] = - a[j,i] --- .../bd_antenna_phase_deltas.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/simulations/airshower_beacon_simulation/bd_antenna_phase_deltas.py b/simulations/airshower_beacon_simulation/bd_antenna_phase_deltas.py index fc0fe6d..37bd41e 100755 --- a/simulations/airshower_beacon_simulation/bd_antenna_phase_deltas.py +++ b/simulations/airshower_beacon_simulation/bd_antenna_phase_deltas.py @@ -43,20 +43,20 @@ if __name__ == "__main__": N_base = len(basenames) N_ant = len(antennas) - # reshape time_diffs into N_ant x N_ant array + # reshape time_diffs into N_ant x N_ant matrix sigma_phase_matrix = np.full( (N_ant, N_ant), np.nan, dtype=float) - #sigma_phase_matrix = np.arange(0, N_ant**2, dtype=float).reshape( (N_ant,N_ant)) + ## set i=i terms to 0 + for i in range(N_ant): + sigma_phase_matrix[i,i] = 0 + + ## fill matrix name2idx = lambda name: int(name)-1 for i, b in enumerate(basenames): idx = (name2idx(b[0]), name2idx(b[1])) - if idx[0] == idx[1]: - # hopefully 0 - pass - sigma_phase_matrix[(idx[0], idx[1])] = lib.phase_mod(true_phase_diffs[i]) - sigma_phase_matrix[(idx[1], idx[0])] = lib.phase_mod(true_phase_diffs[i]) + sigma_phase_matrix[(idx[1], idx[0])] = lib.phase_mod(-1*true_phase_diffs[i]) mat_kwargs = dict( norm = Normalize(vmin=-np.pi, vmax=+np.pi), @@ -82,7 +82,7 @@ if __name__ == "__main__": if True: # for each row j subtract the 0,j element from the whole row # and apply phase_mod - first_row = (sigma_phase_matrix[0,:] * np.ones_like(sigma_phase_matrix)).T + first_row = -1*(sigma_phase_matrix[0,:] * np.ones_like(sigma_phase_matrix)).T # Show subtraction Matrix as figure if True: