From 278d029f8ef9561717644e1099683197e89bafa6 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Mon, 1 May 2023 17:21:56 +0200 Subject: [PATCH] ZH: k-find: only correlate against strongest signal The summing of the first antennas can bias the k's for later antennas. Since the set of k's is limited to -3,-2,..,3 this influences the amount of 'correct' k's to try. It is better to use the strongest signal only to keep the same reference point --- airshower_beacon_simulation/ca_period_from_shower.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/airshower_beacon_simulation/ca_period_from_shower.py b/airshower_beacon_simulation/ca_period_from_shower.py index e5d33f2..32185d3 100755 --- a/airshower_beacon_simulation/ca_period_from_shower.py +++ b/airshower_beacon_simulation/ca_period_from_shower.py @@ -68,6 +68,7 @@ def find_best_period_shifts_summing_at_location(test_loc, antennas, allowed_ks, t_sum = np.arange(t_min+max_neg_shift, t_max+max_pos_shift, dt) a_sum = np.zeros(len(t_sum)) + a_first = np.zeros(len(t_sum)) best_period_shifts = np.zeros( (len(antennas)) ,dtype=int) for i, (t_r, E_) in enumerate(zip(t_, a_)): @@ -75,6 +76,7 @@ def find_best_period_shifts_summing_at_location(test_loc, antennas, allowed_ks, if i == 0: a_sum += f(t_sum) + a_first = a_sum best_period_shifts[i] = period_shift_first_trace continue @@ -94,14 +96,14 @@ def find_best_period_shifts_summing_at_location(test_loc, antennas, allowed_ks, ax2.set_title("Maxima at {}; i={i}/{tot}".format(title_location, i=i, tot=N_ant)) ax2.set_xlabel("$k$th Period") ax2.set_ylabel("Summed Amplitude") - ax2.plot(0, np.max(a_sum), marker='*', label='trace_sum', ls='none', ms=20) + ax2.plot(0, np.max(a_first), marker='*', label='strongest trace', ls='none', ms=20) # find the maxima for each period shift k shift_maxima = np.zeros( len(allowed_ks) ) for j, k in enumerate(allowed_ks): augmented_a = f(t_sum + k*period) - shift_maxima[j] = np.max(augmented_a + a_sum) + shift_maxima[j] = np.max(augmented_a + a_first) if i in plot_iteration_with_shifted_trace and abs(k) <= 3: ax.plot(t_sum, augmented_a, alpha=0.7, ls='dashed', label=f'{k:g}')