ZH: phase deltas correct for two antennas with ref_ant

Multiple baselines do not work yet..
This commit is contained in:
Eric Teunis de Boone 2022-12-21 18:30:06 +01:00
parent e8ff828120
commit 1a61f84157

View file

@ -102,7 +102,7 @@ if __name__ == "__main__":
if True: if True:
# show means and std # show means and std
fig, axs = plt.subplots(1,2, sharey=True) fig, axs = plt.subplots(1,2, sharey=True)
axs[0].set_title("") fig.suptitle("Comparison Measured and Actual Phases")
axs[0].set_xlabel("Antenna no.") axs[0].set_xlabel("Antenna no.")
axs[0].set_ylabel("Antenna Phase $\\Delta_\\varphi$") axs[0].set_ylabel("Antenna Phase $\\Delta_\\varphi$")
axs[1].set_xlabel("#") axs[1].set_xlabel("#")
@ -112,17 +112,17 @@ if __name__ == "__main__":
secax = axs[1].secondary_yaxis('right', functions=(forward, inverse)) secax = axs[1].secondary_yaxis('right', functions=(forward, inverse))
secax.set_ylabel('Time $\\Delta\\varphi/(2\\pi f_{beac})$ [ns]') secax.set_ylabel('Time $\\Delta\\varphi/(2\\pi f_{beac})$ [ns]')
l = axs[0].errorbar(np.arange(N_ant), mean_sigma_phase, yerr=std_sigma_phase, marker='.', alpha=0.7) l = axs[0].errorbar(np.arange(N_ant), mean_sigma_phase, yerr=std_sigma_phase, marker='4', alpha=0.7, ls='none')
axs[1].hist(mean_sigma_phase, bins='sqrt', density=False, orientation='horizontal', color=l[0].get_color(), histtype='step') axs[1].hist(mean_sigma_phase, bins='sqrt', density=False, orientation='horizontal', color=l[0].get_color(), histtype='step')
# Actual time shifts # Actual time shifts
if True: if True:
actual_phase_shifts = [ -1*lib.phase_mod(2*np.pi*f_beacon*v) for k,v in antenna_time_shifts.items() ] actual_phase_shifts = [ -1*lib.phase_mod(2*np.pi*f_beacon*v) for k,v in antenna_time_shifts.items() ]
antenna_names = [int(k) for k,v in antenna_time_shifts.items() ] antenna_names = [int(k)-1 for k,v in antenna_time_shifts.items() ]
# make sure to keep the same offset # make sure to keep the same offset
if True: if False:
phase_offset = mean_sigma_phase[0] - actual_phase_shifts[0] phase_offset = mean_sigma_phase[0] - actual_phase_shifts[0]
actual_phase_shifts += phase_offset actual_phase_shifts += phase_offset