ZH: remove time delay from actual phase_sigma

This commit is contained in:
Eric Teunis de Boone 2022-12-08 11:22:33 +01:00
parent 4c9e91489d
commit b11e6f3756

View file

@ -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