From b11e6f375654b576357fa286911cef0006ed58b2 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 8 Dec 2022 11:22:33 +0100 Subject: [PATCH] ZH: remove time delay from actual phase_sigma --- .../bc_phase_sigmas.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/simulations/airshower_beacon_simulation/bc_phase_sigmas.py b/simulations/airshower_beacon_simulation/bc_phase_sigmas.py index 3b277ca..b567e1f 100755 --- a/simulations/airshower_beacon_simulation/bc_phase_sigmas.py +++ b/simulations/airshower_beacon_simulation/bc_phase_sigmas.py @@ -75,19 +75,22 @@ if __name__ == "__main__": # save phase difference with antenna names phase_diffs[i] = [f_beacon, true_phases_diff] - # Read actual phases from antenna hdf5 - actual_antenna_phases = { a.name: 2*np.pi*a.attrs['clock_offset']*f_beacon for a in antennas } + beacon.write_baseline_time_diffs_hdf5(time_diffs_fname, baselines, phase_diffs[:,1], [0]*len(phase_diffs), phase_diffs[:,0]) + # Read actual phases from antenna hdf5 + actual_antenna_measured_phases = { a.name: 2*np.pi*a.attrs['clock_offset']*f_beacon for a in antennas } # Compare actual time shifts my_phase_diffs = [] for i,b in enumerate(baselines): - actual_phase_diff = lib.phase_mod( lib.phase_mod(actual_antenna_phases[b[1].name]) - lib.phase_mod(actual_antenna_phases[b[0].name])) + actual_phase_measured_diff = lib.phase_mod( lib.phase_mod(actual_antenna_measured_phases[b[1].name]) - lib.phase_mod(actual_antenna_measured_phases[b[0].name])) - if True: # remove time axis phase difference - t0s = np.array([ant.t_AxB[0] for ant in base]) - delta_t0 = t0s[1] - t0s[1] - actual_phase_diff = lib.phase_mod( actual_phase_diff - lib.phase_mod(delta_t0*2*np.pi*f_beacon)) + # remove phase due to time delay from transmitter difference + tds = np.array([ lib.geometry_time(tx, ant, c_light=c_light) for ant in base]) + delta_td = tds[1] - tds[0] + delta_td_phase = lib.phase_mod(delta_td*2*np.pi*f_beacon) + + actual_phase_diff = lib.phase_mod( actual_phase_measured_diff - delta_td_phase) my_phase_diffs.append(actual_phase_diff) # Make a plot