ZH: plotting improvements

This commit is contained in:
Eric Teunis de Boone 2023-04-13 12:28:04 +02:00
parent ee13fe91f9
commit 1130f2c679
4 changed files with 12 additions and 7 deletions

View file

@ -211,7 +211,7 @@ if __name__ == "__main__":
p2t = lambda phase: phase/(2*np.pi*f_beacon)
fig, ax = plt.subplots(figsize=figsize)
ax.set_title(f"Beacon at antenna {h5ant.attrs['name']}\nF:{frequency:.2e}, P:{beacon_phase:.4f}, A:{amplitude:.1e}")
ax.set_title(f"Beacon at antenna {h5ant.attrs['name']}\nF:{frequency:.2e}GHz, $\\varphi$:{beacon_phase:.4f}rad")
ax.set_xlabel("t [ns]")
ax.set_ylabel("Amplitude")

View file

@ -137,10 +137,10 @@ if __name__ == "__main__":
axs[0].legend(title=snr_str)
if plot_residuals:
fig.suptitle("Difference between Measured and Actual phase difference\n for Baselines (i,j" + (')' if not ref_ant_id else '='+str([ int(a.name) for a in ref_ants])+')'))
axs[0].set_title("Difference between Measured and Actual phase difference\n for Baselines (i,j" + (')' if not ref_ant_id else '='+str([ int(a.name) for a in ref_ants])+')'))
axs[-1].set_xlabel("Baseline Phase Residual $\\Delta\\varphi_{ij_{meas}} - \\Delta\\varphi_{ij_{true}}$ [rad]")
else:
fig.suptitle("Comparison Measured and Actual phase difference\n for Baselines (i,j" + (')' if not ref_ant_id else '='+str([ int(a.name) for a in ref_ants])+')'))
axs[0].set_title("Comparison Measured and Actual phase difference\n for Baselines (i,j" + (')' if not ref_ant_id else '='+str([ int(a.name) for a in ref_ants])+')'))
axs[-1].set_xlabel("Baseline Phase $\\Delta\\varphi_{ij}$ [rad]")
#
@ -152,6 +152,8 @@ if __name__ == "__main__":
i=1
axs[i].set_ylabel("Baseline no.")
fig.tight_layout()
if fig_dir:
extra_name = "measured"
if plot_residuals:

View file

@ -105,7 +105,7 @@ if __name__ == "__main__":
axs = fig.get_axes()
axs.legend(title=snr_str)
axs[0].legend(title=snr_str)
if plot_residuals:
fig.suptitle("Difference between Measured and Actual clock offsets")

View file

@ -283,17 +283,20 @@ if __name__ == "__main__":
fig, axs = rit.slice_figure(ev, X, xx, yy, p, mode='sp', scatter_kwargs=dict(
vmax=1e5,
vmin=0,
s=150,
s=250,
cmap='inferno',
# edgecolor='black',
))
suptitle = fig._suptitle.get_text()
fig.suptitle("")
axs.set_title(suptitle +"\n" +plot_titling[case])
#axs.set_aspect('equal', 'datalim')
axs.set_title("Shower plane slice\n" + plot_titling[case] + "\n" + suptitle)
axs.set_aspect('equal', 'datalim')
axs.legend(title=snr_str)
axs.set_xlim(1.1*min(xx)/1e3, 1.1*max(xx)/1e3)
axs.set_ylim(1.1*min(yy)/1e3, 1.1*max(yy)/1e3)
if fig_dir:
fig.tight_layout()
fig.savefig(path.join(fig_dir, path.basename(__file__) + f'.X{X}.{case}.{scalename}.pdf'))