Does "psfcaculator" really related with z, which is Distance from exit pupil to image plane?
Opened this issue · 3 comments
For zernike.py:
def __psfcaculator__(self,r=1,lambda_1=632*10**(-9),z=0.1):
"""
pupil: Exit pupil diameter
z: Distance from exit pupil to image plane
r: pupil radius, in unit of lambda
"""
pupil = l1 = 200 # exit pupil sample points
x = __np__.linspace(-r, r, l1)
[X,Y] = __np__.meshgrid(x,x)
Z = __interferometer__.__zernikecartesian__(self.__coefficients__,X,Y)
for i in range(len(Z)):
for j in range(len(Z)):
if x[i]**2+x[j]**2>r**2:
Z[i][j] = 0
d = 400 # background
A = __np__.zeros([d,d])
A[d//2-l1//2+1:d//2+l1//2+1,d//2-l1//2+1:d//2+l1//2+1] = Z
axis_1 = d//pupil*r
fig = __plt__.figure()
# ax = fig.gca()
# __plt__.imshow(A,extent=[-axis_1,axis_1,-axis_1,axis_1],cmap=__cm__.RdYlGn)
# ax.set_xlabel('mm',fontsize=14)
# __plt__.colorbar()
# __plt__.show()
I don't see any code effected by z=0.1
noticed the same! A PSF would be incredibly awesome, there is some really big stuff upcoming in single molecule localisation microscopy, concerning beamshaping using deformable mirrors. If my python skills would just be better..
Hey @akurz-wue ,
I've been writing an optics library in Python for some time now, which has robust PSF tools. It's at https://github.com/brandondube/prysm and may be of some value to you.
FYI, most optics libraries (including paid softwares, like Code V or Zemax!) use a Fresnel transform to compute a PSF. For large NA systems, this method isn't very accurate and you would need to do e.g. an angular spectrum calculation. PROPER ( https://sourceforge.net/projects/proper-library/ ) can do that sort of thing, but you may find it unwieldy to use.