mirror of
https://github.com/yosata/fourierOptics.git
synced 2026-10-29 20:51:10 +00:00
Added descriptions to all scripts, checked functioning
This commit is contained in:
1 parent
9ce4b7045f
commit
7cbaec6ff9
48 files changed
+262
-255
No files matched your search
@@ -6,8 +6,16 @@ from matplotlib.ticker import FormatStrFormatter
|
||||
from matplotlib.colors import LogNorm
|
||||
import time
|
||||
import sys
|
||||
sys.path.insert(0, '/Users/joost/Dropbox/Werk/PhD/Analyses/Python/Analytical/Fourier Optics')
|
||||
from fourierOptics_new import *
|
||||
# sys.path.insert(0, '/Users/joost/Dropbox/Werk/PhD/Analyses/Python/Analytical/Fourier Optics')
|
||||
# from fourierOptics_new import *
|
||||
sys.path.insert(0, '/Users/joost/Dropbox/Werk/PhD/Documents/Published/FourierOptics GitHub release/')
|
||||
from fourierOptics import *
|
||||
|
||||
'''
|
||||
2022-08-02:
|
||||
Description: Old script where I build a simple lens system and added WFEs to the lens surface.
|
||||
'''
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
plt.rc('font', family='serif')
|
||||
@@ -41,7 +49,7 @@ if __name__ == '__main__':
|
||||
|
||||
|
||||
# Create a lens with a focal length ~100 mm, with a clear aperture radius of 4 mm and thickness of 1 mm.
|
||||
L1 = LensObject('N-BK7', 1, 4, name='L1')
|
||||
L1 = LensObject(glass='N-BK7', thickness=1, CA=4, name='L1')
|
||||
L1.set_first_surface('EVEN ASPHERE', R=11.65, k=-1.10, a=[0.0, 3.69067205091E-5, -1.285461192617E-8, -1.400167659754E-10,
|
||||
-2.51311664812E-13, 5.01789877647E-16, 5.855871513042E-18, -1.127794407419E-20])
|
||||
L1.set_second_surface('SPHERICAL', R=1e99)
|
||||
@@ -76,7 +84,7 @@ if __name__ == '__main__':
|
||||
zern2 = np.pad(zern, ((750,751),(750,751)), 'constant', constant_values=(0))
|
||||
zern = zern2 * prof.top_hat(4, n,m, dpix)
|
||||
|
||||
L1 = LensObject('N-BK7', 1, 4, name='L1')
|
||||
L1 = LensObject(glass='N-BK7', thickness=1, CA=4, name='L1')
|
||||
L1.set_first_surface('EVEN ASPHERE', R=11.65, k=-1.10, a=[0.0, 3.69067205091E-5, -1.285461192617E-8, -1.400167659754E-10,
|
||||
-2.51311664812E-13, 5.01789877647E-16, 5.855871513042E-18, -1.127794407419E-20])
|
||||
L1.set_second_surface('SPHERICAL', R=1e99)
|
||||
@@ -107,14 +115,14 @@ if __name__ == '__main__':
|
||||
plt.xlim(-10,10)
|
||||
plt.ylim(-10,10)
|
||||
plt.colorbar()
|
||||
plt.savefig('./figures/PSF_with_psd_error.png', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/PSF_with_psd_error.png', bbox_inches='tight', transparent=True)
|
||||
plt.close()
|
||||
|
||||
# Wavefront error
|
||||
plt.figure()
|
||||
plt.imshow(h_data, cmap='jet')
|
||||
plt.colorbar()
|
||||
plt.savefig('./figures/psd_error.png', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/psd_error.png', bbox_inches='tight', transparent=True)
|
||||
plt.close()
|
||||
|
||||
# Original PSF
|
||||
@@ -123,7 +131,7 @@ if __name__ == '__main__':
|
||||
plt.xlim(-10,10)
|
||||
plt.ylim(-10,10)
|
||||
plt.colorbar()
|
||||
plt.savefig('./figures/PSF_no_psd_error.png', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/PSF_no_psd_error.png', bbox_inches='tight', transparent=True)
|
||||
plt.close()
|
||||
|
||||
# Zernike PSF (some coma and also astigmatism)
|
||||
@@ -132,7 +140,7 @@ if __name__ == '__main__':
|
||||
plt.xlim(-10,10)
|
||||
plt.ylim(-10,10)
|
||||
plt.colorbar()
|
||||
plt.savefig('./figures/PSF_with_zernike_error.png', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/PSF_with_zernike_error.png', bbox_inches='tight', transparent=True)
|
||||
plt.close()
|
||||
|
||||
# Wavefront error, zernike
|
||||
@@ -141,7 +149,7 @@ if __name__ == '__main__':
|
||||
plt.xlim(500,1500)
|
||||
plt.ylim(500,1500)
|
||||
plt.colorbar()
|
||||
plt.savefig('./figures/zernike_error.png', bbox_inches='tight', transparent=True)
|
||||
# plt.savefig('./figures/zernike_error.png', bbox_inches='tight', transparent=True)
|
||||
plt.close()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user