mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-11-13 18:13:31 +01:00
ZH: plotting improvements
This commit is contained in:
parent
ee13fe91f9
commit
1130f2c679
4 changed files with 12 additions and 7 deletions
|
@ -211,7 +211,7 @@ if __name__ == "__main__":
|
||||||
p2t = lambda phase: phase/(2*np.pi*f_beacon)
|
p2t = lambda phase: phase/(2*np.pi*f_beacon)
|
||||||
|
|
||||||
fig, ax = plt.subplots(figsize=figsize)
|
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_xlabel("t [ns]")
|
||||||
ax.set_ylabel("Amplitude")
|
ax.set_ylabel("Amplitude")
|
||||||
|
|
||||||
|
|
|
@ -137,10 +137,10 @@ if __name__ == "__main__":
|
||||||
axs[0].legend(title=snr_str)
|
axs[0].legend(title=snr_str)
|
||||||
|
|
||||||
if plot_residuals:
|
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]")
|
axs[-1].set_xlabel("Baseline Phase Residual $\\Delta\\varphi_{ij_{meas}} - \\Delta\\varphi_{ij_{true}}$ [rad]")
|
||||||
else:
|
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]")
|
axs[-1].set_xlabel("Baseline Phase $\\Delta\\varphi_{ij}$ [rad]")
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -152,6 +152,8 @@ if __name__ == "__main__":
|
||||||
i=1
|
i=1
|
||||||
axs[i].set_ylabel("Baseline no.")
|
axs[i].set_ylabel("Baseline no.")
|
||||||
|
|
||||||
|
fig.tight_layout()
|
||||||
|
|
||||||
if fig_dir:
|
if fig_dir:
|
||||||
extra_name = "measured"
|
extra_name = "measured"
|
||||||
if plot_residuals:
|
if plot_residuals:
|
||||||
|
|
|
@ -105,7 +105,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
axs = fig.get_axes()
|
axs = fig.get_axes()
|
||||||
|
|
||||||
axs.legend(title=snr_str)
|
axs[0].legend(title=snr_str)
|
||||||
|
|
||||||
if plot_residuals:
|
if plot_residuals:
|
||||||
fig.suptitle("Difference between Measured and Actual clock offsets")
|
fig.suptitle("Difference between Measured and Actual clock offsets")
|
||||||
|
|
|
@ -283,17 +283,20 @@ if __name__ == "__main__":
|
||||||
fig, axs = rit.slice_figure(ev, X, xx, yy, p, mode='sp', scatter_kwargs=dict(
|
fig, axs = rit.slice_figure(ev, X, xx, yy, p, mode='sp', scatter_kwargs=dict(
|
||||||
vmax=1e5,
|
vmax=1e5,
|
||||||
vmin=0,
|
vmin=0,
|
||||||
s=150,
|
s=250,
|
||||||
cmap='inferno',
|
cmap='inferno',
|
||||||
# edgecolor='black',
|
# edgecolor='black',
|
||||||
))
|
))
|
||||||
|
|
||||||
suptitle = fig._suptitle.get_text()
|
suptitle = fig._suptitle.get_text()
|
||||||
fig.suptitle("")
|
fig.suptitle("")
|
||||||
axs.set_title(suptitle +"\n" +plot_titling[case])
|
axs.set_title("Shower plane slice\n" + plot_titling[case] + "\n" + suptitle)
|
||||||
#axs.set_aspect('equal', 'datalim')
|
axs.set_aspect('equal', 'datalim')
|
||||||
axs.legend(title=snr_str)
|
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:
|
if fig_dir:
|
||||||
fig.tight_layout()
|
fig.tight_layout()
|
||||||
fig.savefig(path.join(fig_dir, path.basename(__file__) + f'.X{X}.{case}.{scalename}.pdf'))
|
fig.savefig(path.join(fig_dir, path.basename(__file__) + f'.X{X}.{case}.{scalename}.pdf'))
|
||||||
|
|
Loading…
Reference in a new issue