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
+24
-21
@@ -1,17 +1,19 @@
|
||||
#!/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 pickle
|
||||
import sys
|
||||
sys.path.insert(0, '/Users/joost/Dropbox/Werk/PhD/Analyses/Python/Analytical/Fourier Optics')
|
||||
sys.path.insert(0, '/Users/joost/Dropbox/Werk/PhD/Documents/Published/FourierOptics GitHub release/')
|
||||
from fourierOptics import *
|
||||
|
||||
|
||||
'''
|
||||
@ Author: Joost van den Born
|
||||
@ Description: Script for analysing WFEs produced using either Zernike polynomials or
|
||||
a PSD description. It also compares the shift in centroid position as the
|
||||
complexity of the WFE increases through spatial frequency filtering.
|
||||
'''
|
||||
def saveVariable(var, filename):
|
||||
# Saving the objects:
|
||||
@@ -80,7 +82,7 @@ if __name__ == '__main__':
|
||||
|
||||
|
||||
plt.imshow(np.abs(Exyz_og), cmap='hot');plt.colorbar();plt.show()
|
||||
set_trace()
|
||||
|
||||
zernikeAnalysis = True
|
||||
PSDAnalysis = True
|
||||
|
||||
@@ -97,7 +99,8 @@ if __name__ == '__main__':
|
||||
# and more modes.
|
||||
|
||||
# Calculate the maximum mode that we want to fit the zernike modes to.
|
||||
nmax, mmax = 80, 80
|
||||
# nmax, mmax = 80, 80
|
||||
nmax, mmax = 20,20
|
||||
zernikeLimit = int((nmax*(nmax+2)+mmax)/2)
|
||||
|
||||
# Fit the zernike coefficients for all modes up to zernikeLimit
|
||||
@@ -147,15 +150,15 @@ if __name__ == '__main__':
|
||||
eef_zern_list.append(eef_zern.tolist())
|
||||
zernImageResponse.append(Exyz_zern)
|
||||
|
||||
saveVariable(x0zern, './data/x0zern.pck')
|
||||
saveVariable(y0zern, './data/y0zern.pck')
|
||||
saveVariable(x0zern_var, './data/x0zern_var.pck')
|
||||
saveVariable(y0zern_var, './data/y0zern_var.pck')
|
||||
saveVariable(zernCouplingList, './data/zernCouplingList.pck')
|
||||
saveVariable(eef_zern_list, './data/eef_zern_list.pck')
|
||||
saveVariable(zernImageResponse, './data/zernImageResponse.pck')
|
||||
saveVariable(psd1d_list_zern, './data/psd1d_list_zern.pck')
|
||||
saveVariable(zernikeCoefficients, './data/zernikeCoefficients.pcks')
|
||||
# saveVariable(x0zern, './data/x0zern.pck')
|
||||
# saveVariable(y0zern, './data/y0zern.pck')
|
||||
# saveVariable(x0zern_var, './data/x0zern_var.pck')
|
||||
# saveVariable(y0zern_var, './data/y0zern_var.pck')
|
||||
# saveVariable(zernCouplingList, './data/zernCouplingList.pck')
|
||||
# saveVariable(eef_zern_list, './data/eef_zern_list.pck')
|
||||
# saveVariable(zernImageResponse, './data/zernImageResponse.pck')
|
||||
# saveVariable(psd1d_list_zern, './data/psd1d_list_zern.pck')
|
||||
# saveVariable(zernikeCoefficients, './data/zernikeCoefficients.pcks')
|
||||
|
||||
if PSDAnalysis:
|
||||
# For each spatial frequency, perform the analysis
|
||||
@@ -208,14 +211,14 @@ if __name__ == '__main__':
|
||||
eef_psd_list.append(eef_psd)
|
||||
psdImageResponse.append(Exyz_psd)
|
||||
|
||||
saveVariable(x0psd, './data/x0psd.pck')
|
||||
saveVariable(y0psd, './data/y0psd.pck')
|
||||
saveVariable(x0psd_var, './data/x0psd_var.pck')
|
||||
saveVariable(y0psd_var, './data/y0psd_var.pck')
|
||||
saveVariable(psdCouplingList, './data/psdCouplingList.pck')
|
||||
saveVariable(eef_psd_list, './data/eef_psd_list.pck')
|
||||
saveVariable(psdImageResponse, './data/psdImageResponse.pck')
|
||||
saveVariable(psd1d_list_psd, './data/psd1d_list_psd.pck')
|
||||
# saveVariable(x0psd, './data/x0psd.pck')
|
||||
# saveVariable(y0psd, './data/y0psd.pck')
|
||||
# saveVariable(x0psd_var, './data/x0psd_var.pck')
|
||||
# saveVariable(y0psd_var, './data/y0psd_var.pck')
|
||||
# saveVariable(psdCouplingList, './data/psdCouplingList.pck')
|
||||
# saveVariable(eef_psd_list, './data/eef_psd_list.pck')
|
||||
# saveVariable(psdImageResponse, './data/psdImageResponse.pck')
|
||||
# saveVariable(psd1d_list_psd, './data/psd1d_list_psd.pck')
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user