mirror of
https://github.com/yosata/fourierOptics.git
synced 2026-10-29 20:51:10 +00:00
Added scripts folder with old scripts
This commit is contained in:
1 parent
f4cc304953
commit
4007525275
22 files changed
+5986
No files matched your search
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env Python3
|
||||
import numpy as np
|
||||
from pdb import set_trace
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.ticker import FormatStrFormatter
|
||||
from matplotlib.colors import LogNorm
|
||||
import sys
|
||||
sys.path.insert(0, '/Users/joost/Dropbox/Werk/PhD/Analyses/Python/Analytical/Fourier Optics')
|
||||
from fourierOptics import *
|
||||
|
||||
plt.rc('font', family='serif')
|
||||
plt.rc('axes', labelsize='large')
|
||||
|
||||
# Parameters
|
||||
dpix = 160
|
||||
n, m = 1001, 1001
|
||||
oC = [-2.5, 2.5, -2.5, 2.5]
|
||||
l = 1.49e-3 # wavelength
|
||||
lList = np.linspace(1.49e-3, 1.78e-3, 11).tolist()
|
||||
|
||||
dispMax = 17.9e-3 / 3600 # degrees
|
||||
dispersion = np.linspace(0, dispMax, len(lList)).tolist()
|
||||
|
||||
Exyz_list = []
|
||||
|
||||
print ('Your resolution is {}x{} with a pixel size of {}'.format(n,m,dpix))
|
||||
# Start of the ELT-lens system
|
||||
# Initiate Fourier Optics, profile and wavefront error objects
|
||||
for l in lList:
|
||||
i = lList.index(l)
|
||||
print(l, dispersion[i])
|
||||
fou = FourierOptics(l=l)
|
||||
prof = Profiles()
|
||||
wfe = WavefrontError(n,m)
|
||||
|
||||
|
||||
# A = prof.top_hat(38854/2, n, m, dpix=dpix, oversample=1)
|
||||
A = prof.ELT_pupil(n,m,dpix)
|
||||
|
||||
# Create an input grid, equivalent to the size of ELT-M1
|
||||
x, y = np.meshgrid(np.linspace(-n/2*dpix, n/2*dpix, n), np.linspace(-m/2*dpix, m/2*dpix, m))
|
||||
|
||||
# Create a ELT-M1 parabolic mirror
|
||||
M1 = ParabolicMirror(dx=0, dy=0, name='ELT-M1', CA=38854/2, f=679945)
|
||||
t_l = M1.phase_delay(x,y,l)
|
||||
U_in = A * t_l
|
||||
|
||||
z = wfe.generate_sine_pattern(1e-4, 1e-4, 180, 180)
|
||||
dispersion_tilt = wfe.generate_tilt(x,y,tx=0, ty=dispersion[i])
|
||||
# psd_surface = wfe.generate_height_map(30e-6, 2, 1)
|
||||
|
||||
M1.add_wavefront_error(z+dispersion_tilt)# + psd_surface)
|
||||
t_l = M1.phase_delay(x,y,l)
|
||||
U_in2 = A * t_l
|
||||
|
||||
|
||||
# Propagating the original, unperturbed, system and calculating encircled energy
|
||||
Exyz_s,xs,ys = fou.fresnel_propagation(U_in2, x, y, dz=M1.f, show=False, outputCoordinates=oC)
|
||||
|
||||
Exyz_list.append(Exyz_s)
|
||||
|
||||
Exyz_s = np.asarray(Exyz_list).sum(axis=0)
|
||||
plt.imshow(np.abs(Exyz_s), cmap='hot');plt.colorbar();plt.show()
|
||||
plt.imshow(np.abs(Exyz_s)**2, cmap='hot', norm=LogNorm(vmin=1e-7));plt.colorbar();plt.show()
|
||||
Reference in new issue
Block a user