Modified plotting scripts for thesis
No files matched your search
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 815 KiB |
|
After Width: | Height: | Size: 707 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 187 KiB |
@@ -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()
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ def append_to_existing_data(A, filename):
|
||||
|
||||
|
||||
def plot_some_stuff():
|
||||
fig = plt.figure(figsize=(9,7))
|
||||
fig = plt.figure(figsize=(6.4,4.8))
|
||||
ax = fig.add_subplot(111)
|
||||
ax2 = ax.twiny()
|
||||
|
||||
@@ -52,11 +52,21 @@ def plot_some_stuff():
|
||||
ax2.set_xlabel('$\\sigma/\\lambda$', fontsize=18)
|
||||
ax.legend(fontsize=18)
|
||||
ax.grid(True, alpha=0.3)
|
||||
ax.tick_params(labelsize=18)
|
||||
ax2.tick_params(labelsize=18)
|
||||
ax.tick_params(axis='both', which='both', direction='in', labelsize=16, zorder=-1,)
|
||||
ax2.tick_params(axis='both', which='both', direction='in', labelsize=16, zorder=-1,)
|
||||
plt.tight_layout()
|
||||
plt.savefig('./figures/SR_relation_WFE_on_ADC_p1_obscured.png', bbox_inches='tight', transparent=True)
|
||||
plt.savefig('./figures/SR_relation_WFE_on_ADC_p1_obscured.pdf', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/SR_relation_WFE_on_ADC_p1_obscured.png', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/SR_relation_WFE_on_ADC_p1_obscured.pdf', bbox_inches='tight', transparent=True)
|
||||
figtitle = 'new_SR_relation_WFE_on_ADC_p1_obscured'
|
||||
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()
|
||||
|
||||
if __name__ == '__main__':
|
||||
@@ -65,11 +75,11 @@ if __name__ == '__main__':
|
||||
plt.rc('axes', labelsize='large')
|
||||
|
||||
l = 1.49e-3
|
||||
rmsList = load_variable('./data/SR_RMS_values_obscured.pkl')
|
||||
strehl_zern_complete = load_variable('./data/SR_strehl_zern_obscured.pkl')
|
||||
strehl_psd_complete = load_variable('./data/SR_strehl_psd_obscured.pkl')
|
||||
rms_zern_list_complete = load_variable('./data/SR_rms_zern_complete_obscured.pkl')
|
||||
rms_psd_list_complete = load_variable('./data/SR_rms_psd_complete_obscured.pkl')
|
||||
rmsList = load_variable('./data/Strehl relation analysis/SR_RMS_values_obscured.pkl')
|
||||
strehl_zern_complete = load_variable('./data/Strehl relation analysis/SR_strehl_zern_obscured.pkl')
|
||||
strehl_psd_complete = load_variable('./data/Strehl relation analysis/SR_strehl_psd_obscured.pkl')
|
||||
rms_zern_list_complete = load_variable('./data/Strehl relation analysis/SR_rms_zern_complete_obscured.pkl')
|
||||
rms_psd_list_complete = load_variable('./data/Strehl relation analysis/SR_rms_psd_complete_obscured.pkl')
|
||||
|
||||
mean_strehl_zern = np.mean(strehl_zern_complete, axis=0)
|
||||
err_strehl_zern = np.std(strehl_zern_complete, axis=0)
|
||||
|
||||
@@ -27,8 +27,8 @@ if __name__ == '__main__':
|
||||
###############################
|
||||
|
||||
# Load in the data
|
||||
r_airy, r_err_airy = load_variable('./data/lowpass_frequency_filter_airy_distance.pkl')
|
||||
x0_airy, y0_airy, x0_airy_err, y0_airy_err = load_variable('./data/lowpass_frequency_filter_airy_locations.pkl')
|
||||
r_airy, r_err_airy = load_variable('./data/WFE frequency analysis/lowpass_frequency_filter_airy_distance.pkl')
|
||||
x0_airy, y0_airy, x0_airy_err, y0_airy_err = load_variable('./data/WFE frequency analysis/lowpass_frequency_filter_airy_locations.pkl')
|
||||
central_frequencies = np.asarray([0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 25,
|
||||
30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 120, 140, 160, 180, 200,
|
||||
220, 250, 280, 310, 340, 370, 400, 450, 500])
|
||||
@@ -37,19 +37,30 @@ if __name__ == '__main__':
|
||||
r_err_airy_mas = r_err_airy * platescale
|
||||
|
||||
# Plotting the centroid shift for all bandpasses
|
||||
fig = plt.figure(figsize=(9,7))
|
||||
fig = plt.figure(figsize=(6.4,4.8))
|
||||
ax1 = fig.add_subplot(111)
|
||||
ax1.scatter(central_frequencies, r_airy_mas, edgecolor='k', facecolors='none', alpha=0.7)
|
||||
ax1.set_xscale('log')
|
||||
ax1.set_xlabel('Cut-off Frequency of the lowpass filter ($\\rho/\\rho_c$)', fontsize=18)
|
||||
ax1.set_ylabel('Centroid shift (mas)', fontsize=18)
|
||||
ax1.tick_params(labelsize=18)
|
||||
ax1.tick_params(axis='both', which='both', direction='in', labelsize=16, zorder=-1,)
|
||||
ax1.grid(True, alpha=0.3, which='major')
|
||||
ax1.grid(True, alpha=0.1, which='minor')
|
||||
ax1.set_xlim([0.3,550])
|
||||
plt.tight_layout()
|
||||
plt.savefig('./figures/wfe_frequency_analysis/lowpass_spatial_freq_distance.png', bbox_inches='tight', transparent=True)
|
||||
plt.savefig('./figures/wfe_frequency_analysis/lowpass_spatial_freq_distance.pdf', bbox_inches='tight', transparent=True)
|
||||
figtitle = 'new_lowpass_spatial_freq_distance'
|
||||
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()
|
||||
# plt.savefig('./figures/wfe_frequency_analysis/lowpass_spatial_freq_distance.png', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/wfe_frequency_analysis/lowpass_spatial_freq_distance.pdf', bbox_inches='tight', transparent=True)
|
||||
|
||||
|
||||
|
||||
@@ -60,9 +71,9 @@ if __name__ == '__main__':
|
||||
################################
|
||||
|
||||
# Load in the data
|
||||
r_airy, r_err_airy = load_variable('./data/bandpass_frequency_filter_airy_distance.pkl')
|
||||
x0_airy, y0_airy, x0_airy_err, y0_airy_err = load_variable('./data/bandpass_frequency_filter_airy_locations.pkl')
|
||||
central_frequencies = load_variable('./data/bandpass_frequency_filter_central_frequencies.pkl')
|
||||
r_airy, r_err_airy = load_variable('./data/WFE frequency analysis/bandpass_frequency_filter_airy_distance.pkl')
|
||||
x0_airy, y0_airy, x0_airy_err, y0_airy_err = load_variable('./data/WFE frequency analysis/bandpass_frequency_filter_airy_locations.pkl')
|
||||
central_frequencies = load_variable('./data/WFE frequency analysis/bandpass_frequency_filter_central_frequencies.pkl')
|
||||
print(central_frequencies, len(central_frequencies), len(r_airy))
|
||||
r_airy_mas = r_airy * platescale
|
||||
r_err_airy_mas = r_err_airy * platescale
|
||||
@@ -77,7 +88,7 @@ if __name__ == '__main__':
|
||||
|
||||
|
||||
# Plotting the centroid shift for all bandpasses
|
||||
fig = plt.figure(figsize=(9,7))
|
||||
fig = plt.figure(figsize=(6.4,4.8))
|
||||
ax1 = fig.add_subplot(111)
|
||||
ax1.scatter(central_frequencies, r_airy_mas, edgecolor='k', facecolors='none', alpha=0.7)
|
||||
ax1.plot(central_frequencies[2:], 10**best_fit_y[2:], 'b-', alpha=0.5, label='Best fit: $y = 0.030 x^{-0.602}$')
|
||||
@@ -85,13 +96,23 @@ if __name__ == '__main__':
|
||||
ax1.set_yscale('log')
|
||||
ax1.set_xlabel('Central Frequency of the bandpass filter ($\\rho/\\rho_c$)', fontsize=18)
|
||||
ax1.set_ylabel('Centroid shift (mas)', fontsize=18)
|
||||
ax1.tick_params(labelsize=18)
|
||||
ax1.tick_params(axis='both', which='both', direction='in', labelsize=16, zorder=-1,)
|
||||
ax1.grid(True, alpha=0.3, which='major')
|
||||
ax1.grid(True, alpha=0.1, which='minor')
|
||||
ax1.set_xlim([0.3,550])
|
||||
ax1.set_ylim([10**-6, 10**0])
|
||||
ax1.legend(fontsize=18)
|
||||
plt.tight_layout()
|
||||
plt.savefig('./figures/wfe_frequency_analysis/bandpass_spatial_freq_distance.png', bbox_inches='tight', transparent=True)
|
||||
plt.savefig('./figures/wfe_frequency_analysis/bandpass_spatial_freq_distance.pdf', bbox_inches='tight', transparent=True)
|
||||
figtitle = 'bandpass_spatial_freq_distance'
|
||||
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.savefig('./figures/wfe_frequency_analysis/bandpass_spatial_freq_distance.png', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/wfe_frequency_analysis/bandpass_spatial_freq_distance.pdf', bbox_inches='tight', transparent=True)
|
||||
plt.show()
|
||||