diff --git a/simulations/airshower_beacon_simulation/lib/tests/test_calculated_phase_measurement.py b/simulations/airshower_beacon_simulation/lib/tests/test_calculated_phase_measurement.py index f36619e..83cbb38 100755 --- a/simulations/airshower_beacon_simulation/lib/tests/test_calculated_phase_measurement.py +++ b/simulations/airshower_beacon_simulation/lib/tests/test_calculated_phase_measurement.py @@ -18,6 +18,7 @@ dt = 1 # ns frequency = 45e-3 # GHz N = 5e2 c_light = lib.c_light +t_clock = 3/4 * 1/frequency t = np.arange(0, 10*int(1e3), dt, dtype=float) rng = np.random.default_rng(seed) @@ -48,16 +49,21 @@ for i in range(int(N)): blank_low, blank_high = 2*int(1e3), 4*int(1e3) beacon[blank_low:blank_high] = 0 + # Introduce clock errors + t += t_clock measured = lib.find_beacon_in_traces([beacon], t, frequency, frequency_fit=False) + t -= t_clock calculated_phase = lib.remove_antenna_geometry_phase(tx, rx, frequency, measured[1][0], c_light=c_light) phase_res[i] = lib.phase_mod(calculated_phase - phase) +# Make the figure fig, ax = plt.subplots() ax.set_title("Measured phase at Antenna - geometrical phase") ax.set_xlabel("$\\varphi_{meas} - \\varphi_{true}$ [rad]") ax.set_ylabel("#") -ax.hist(phase_res, bins='sqrt') +ax.hist(phase_res, bins='sqrt', density=False) +ax.axvline( -1*lib.phase_mod(t_clock*frequency*2*np.pi), color='red', lw=5, alpha=0.8, label='true t_clock') +ax.legend() plt.show() -