Modified plotting scripts for thesis

This commit is contained in:
yosata committed 2022-06-17 10:41:02 +02:00
1 parent 914910e684
commit 1b3a1e0821
20 files changed
+76 -33

No files matched your search

+17 -6
View File
@@ -32,10 +32,11 @@ def plot_colourline(x,y,c, ax):
if __name__ == '__main__':
plt.rc('font', family='serif')
plt.rc('text', usetex=True)
plt.rc('axes', labelsize='large')
# Load in the results from centroid_shift_analysis.py
rms_zern_nm, r_airy_zern_mas, r_err_zern_airy_mas, strehl_list_zern = load_variable('./data/centroid_shift_zernikes.pkl')
rms_psd_nm, r_airy_psd_mas, r_err_psd_airy_mas, strehl_list_psd = load_variable('./data/centroid_shift_psd.pkl')
rms_zern_nm, r_airy_zern_mas, r_err_zern_airy_mas, strehl_list_zern = load_variable('./data/WFE frequency analysis/centroid_shift_zernikes.pkl')
rms_psd_nm, r_airy_psd_mas, r_err_psd_airy_mas, strehl_list_psd = load_variable('./data/WFE frequency analysis/centroid_shift_psd.pkl')
# Convert the errors to logarithmic space, assuming small errors.
log_err_zern_airy_mas = 0.434 * r_err_zern_airy_mas / r_airy_zern_mas
@@ -43,7 +44,7 @@ if __name__ == '__main__':
# Plot the resulting WFE scaling relation
fig = plt.figure(figsize=(9,7))
fig = plt.figure(figsize=(6.4,4.8))
ax1 = fig.add_subplot(111)
ax1.errorbar((0.8138)*rms_zern_nm, r_airy_zern_mas, yerr=log_err_zern_airy_mas, color='k',
linestyle='none', capsize=3,
@@ -66,13 +67,23 @@ if __name__ == '__main__':
ax1.legend(fontsize=18)
ax1.grid(True, alpha=0.3, which='major')
ax1.grid(True, alpha=0.1, which='minor')
ax1.tick_params(labelsize=18)
ax1.tick_params(axis='both', which='both', direction='in', labelsize=16, zorder=-1,)
cb = fig.colorbar(im, ax=ax1)
cb.set_label(label='Strehl', size=18)
cb.ax.tick_params(labelsize=18)
plt.savefig('./figures/WFE_scaling_relation_obscured_airy.png', bbox_inches='tight', transparent=True)
plt.savefig('./figures/WFE_scaling_relation_obscured_airy.pdf', bbox_inches='tight', transparent=True)
# plt.savefig('./figures/WFE_scaling_relation_obscured_airy.png', bbox_inches='tight', transparent=True)
# plt.savefig('./figures/WFE_scaling_relation_obscured_airy.pdf', bbox_inches='tight', transparent=True)
plt.tight_layout()
figtitle = 'new_WFE_scaling_relation_obscured_airy'
if figtitle:
plt.savefig('{}.pdf'.format(figtitle),
bbox_inches='tight',
transparent=False,
facecolor=(1, 1, 0, 0.0))
plt.savefig('{}.png'.format(figtitle),
bbox_inches='tight',
transparent=False,
facecolor=(1, 1, 0, 0.0))
plt.show()