ZH: rotate antenna clock_phase figures

This commit is contained in:
Eric Teunis de Boone 2022-12-22 12:06:34 +01:00
parent a8ddc6b662
commit 9dd5e30488

View file

@ -106,42 +106,43 @@ if __name__ == "__main__":
plot_residuals = i == 1
colors = ['blue', 'orange']
fig, axs = plt.subplots(1,2, sharey=True)
fig, axs = plt.subplots(2, 1, sharex=True)
if True:
forward = lambda x: x/(2*np.pi*f_beacon)
inverse = lambda x: 2*np.pi*x*f_beacon
secax = axs[-1].secondary_yaxis('right', functions=(forward, inverse))
secax.set_ylabel('Time $\\Delta\\varphi/(2\\pi f_{beac})$ [ns]')
secax = axs[0].secondary_xaxis('top', functions=(forward, inverse))
secax.set_xlabel('Time $\\Delta\\varphi/(2\\pi f_{beac})$ [ns]')
if plot_residuals:
phase_residuals = lib.phase_mod(mean_sigma_phase - actual_phase_shifts)
fig.suptitle("Difference between Measured and Actual phases\n for Antenna $i$")
axs[0].set_ylabel("Antenna Phase Residual $\\Delta_\\varphi$")
axs[-1].set_xlabel("Antenna Phase Residual $\\Delta_\\varphi$")
else:
fig.suptitle("Comparison Measured and Actual phases\n for Antenna $i$")
axs[0].set_ylabel("Antenna Phase $\\Delta_\\varphi$")
axs[-1].set_xlabel("Antenna Phase $\\Delta_\\varphi$")
i=0
axs[i].set_xlabel("Antenna no.")
axs[i].set_ylabel("#")
if plot_residuals:
axs[i].plot(np.arange(N_ant), phase_residuals, alpha=0.6, ls='none', marker='x', color=colors[0])
axs[i].hist(phase_residuals, bins='sqrt', alpha=0.8, color=colors[0])
else:
axs[i].errorbar(np.arange(N_ant), mean_sigma_phase, yerr=std_sigma_phase, marker='4', alpha=0.7, ls='none', color=colors[0], label='Measured')
axs[i].plot(antenna_names, actual_phase_shifts, ls='none', marker='3', alpha=0.8, color=colors[1], label='Actual')
axs[i].legend()
axs[i].hist(mean_sigma_phase, bins='sqrt', density=False, alpha=0.8, color=colors[0], ls='solid' , histtype='step', label='Measured')
axs[i].hist(actual_phase_shifts, bins='sqrt', density=False, alpha=0.8, color=colors[1], ls='dashed', histtype='step', label='Actual')
i=1
axs[i].set_xlabel("#")
axs[i].set_ylabel("Antenna no.")
if plot_residuals:
axs[i].hist(phase_residuals, bins='sqrt', alpha=0.8, color=colors[0], orientation='horizontal')
axs[i].plot(phase_residuals, np.arange(N_ant), alpha=0.6, ls='none', marker='x', color=colors[0])
else:
axs[i].hist(mean_sigma_phase, bins='sqrt', density=False, orientation='horizontal', color=colors[0], histtype='step', label='Measured')
axs[i].hist(actual_phase_shifts, bins='sqrt', density=False, orientation='horizontal', ls='dashed', color=colors[1], histtype='step', label='Actual')
axs[i].errorbar(mean_sigma_phase, np.arange(N_ant), yerr=std_sigma_phase, marker='4', alpha=0.7, ls='none', color=colors[0], label='Measured')
axs[i].plot(actual_phase_shifts, antenna_names, ls='none', marker='3', alpha=0.8, color=colors[1], label='Actual')
axs[i].legend()
fig.tight_layout()
if fig_dir:
extra_name = "measured"
if plot_residuals: