ZH: improve final time comparison plot

This commit is contained in:
Eric Teunis de Boone 2023-01-11 16:52:05 +01:00
parent 1968814e06
commit 317f73b60d

View file

@ -249,17 +249,26 @@ if __name__ == "__main__":
if True: # indicate single beacon period span if True: # indicate single beacon period span
ax.plot((-1, -1), (-1/(2*f_beacon), 1/(2*f_beacon)), marker='3', ms=10, label='1/f_beacon') ax.plot((-1, -1), (-1/(2*f_beacon), 1/(2*f_beacon)), marker='3', ms=10, label='1/f_beacon')
if i == 0: if i == 0:
ax.plot(np.arange(N_base), actual_baseline_time_shifts, marker='+', label='actual time shifts') ax.plot(np.arange(N_base), actual_baseline_time_shifts, ls='none', marker='h', alpha=0.8, label='actual time shifts')
else: else:
ax.plot(np.arange(N_base), (actual_baseline_time_shifts+1/(2*f_beacon))%(1/f_beacon) - 1/(2*f_beacon), marker='+', label='actual time shifts') ax.plot(np.arange(N_base), (actual_baseline_time_shifts+1/(2*f_beacon))%(1/f_beacon) - 1/(2*f_beacon), ls='none', marker='h', label='actual time shifts', alpha=0.8)
ax.plot(np.arange(N_base), measured_baseline_time_diffs, marker='x', label='calculated') ax.plot(np.arange(N_base), measured_baseline_time_diffs, ls='none', alpha=0.8, marker='x', label='calculated')
ax.legend() ax.legend()
if fig_dir: if fig_dir:
extra_name = '' extra_name = ''
if i == 1: if i == 1:
extra_name = '.wrapped' extra_name = '.wrapped'
fig.savefig(path.join(fig_dir, path.basename(__file__) + f".time_comparison{extra_name}.pdf"))
old_lims = (ax.get_xlim(), ax.get_ylim())
for j in range(2):
if j == 1:
ax.set_xlim(-5, 50)
extra_name += '.n50'
fig.savefig(path.join(fig_dir, path.basename(__file__) + f".time_comparison{extra_name}.pdf"))
ax.set_xlim(*old_lims[0])
ax.set_ylim(*old_lims[1])
if show_plots: if show_plots:
plt.show() plt.show()