diff --git a/simulations/airshower_beacon_simulation/ca_period_from_shower.py b/simulations/airshower_beacon_simulation/ca_period_from_shower.py index bea9d7e..8015253 100755 --- a/simulations/airshower_beacon_simulation/ca_period_from_shower.py +++ b/simulations/airshower_beacon_simulation/ca_period_from_shower.py @@ -93,18 +93,23 @@ def find_best_sample_shifts_summing_at_location(test_loc, antennas, allowed_samp shift_maxima[j] = np.max(augmented_a + a_sum) if i in plot_iteration_with_shifted_trace: - ax.plot(t_sum, augmented_a, alpha=0.8, label=f'{shift}') + ax.plot(t_sum, augmented_a, alpha=0.7, ls='dashed', label=f'{shift}') # transform maximum into best_sample_shift best_idx = np.argmax(shift_maxima) best_sample_shifts[i] = allowed_sample_shifts[best_idx] - a_sum += np.roll(a_int, best_sample_shifts[i]) + best_augmented_a = np.roll(a_int, best_sample_shifts[i]) + a_sum += best_augmented_a # cleanup figure if i in plot_iteration_with_shifted_trace: - ax.legend( ncol=5) + if True: # plot best k again + ax.plot(t_sum, augmented_a, alpha=0.8, label=f'best k={best_sample_shifts[i]}', lw=2) + + ax.legend( ncol=5 ) if fig_dir: + fig.tight_layout() fname = path.join(fig_dir, __file__ + f'.{fig_distinguish}i{i}' + '.loc{:.1f}-{:.1f}-{:.1f}'.format(*test_loc)) if True: old_xlim = ax.get_xlim() @@ -117,7 +122,7 @@ def find_best_sample_shifts_summing_at_location(test_loc, antennas, allowed_samp if True: # zoomed on peak of this trace x = t_r[np.argmax(E_)] - wx = 10 + max(best_sample_shifts) - min(best_sample_shifts) + wx = 50 + (max(best_sample_shifts) - min(best_sample_shifts))*dt ax.set_xlim(x-wx, x+wx) fig.savefig(fname + ".zoomed.peak.pdf")