-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bessel Beam Simulation from an annulus of light #78
Comments
Hi DerKamin, I had a look at your code and I think I managed to get an acceptable solution. Some quick comments first:
As you noticed, using the A second problem I noticed is that independent of the method I tested, your So I increased the from LightPipes import *
import matplotlib.pyplot as plt
import numpy as np
from tifffile import imsave
from tqdm import tqdm # fancy progress bar, recomment installing if you don't have it yet
GridSize= 10*mm
GridDimension=200
BesselGridSize = 1*mm #0.2*mm
lambda_=800*nm
innerR_m = 2.333*mm
outerR_m = 2.5333*mm
f=20*cm
dz=0.05*mm
nsteps=400
#Create field
Field=Begin(GridSize,lambda_,GridDimension)
#Create an annulus of light
Field = CircAperture(Field, outerR_m)
Field = CircScreen(Field, innerR_m)
plt.figure()
plt.title('Field before lens')
plt.imshow(Intensity(Field))
plt.show()
#propagate field some distance before focus
dist_z = 190*mm
f1 = GridSize/(GridSize - BesselGridSize)*dist_z
f2 = f1*f/(f1-f) # since 1/f = 1/f1 + 1/f2 (two thin lenses)
Field = Lens(Field,f2) # new syntax, easier and shorter
Field = LensFresnel(Field, f1, dist_z)
Field = Convert(Field) # need to convert back from spherical coords
plt.figure()
plt.title(f'Field after distance {dist_z/mm:.1f}mm')
plt.imshow(Intensity(Field))
plt.show()
#Go through Bessel region and safe Intensity profile
FocusInten=np.zeros([nsteps,Field.N,Field.N])
for a in tqdm(range(0,nsteps)):
Field=Steps(dz, Field)
I=Intensity(Field) # flag 0 is default anyway
FocusInten[a,:,:]=I
plt.figure()
plt.title(f'Field after final step')
plt.imshow(Intensity(Field))
plt.show()
#Normalizing and save
Focusnormalized = FocusInten / FocusInten.max()
FocusInten=(Focusnormalized*65535).astype(np.uint16)
imsave('BesselRegion.tiff',FocusInten) The calculation of Hope this helps, greetings from Munich, Lenny [1] https://opticspy.github.io/lightpipes/manual.html#spherical-coordinates |
Hi Lenny, thanks a lot for your answer, it really helped me alot! :) Also having the progress bar feels so much better. I understand the importance of the gridsize much better now. Still i have got some questions for this simulation:
Why is the the second lens called weak phase mask? Thanks and greetings, |
Hi Lenny and Hannes, Hannes, do you like to make a contribution to our documentation-examples when finished? See: https://opticspy.github.io/lightpipes/examples.html#non-diffractive-bessel-beam Here is my code:
Greetings from, |
Hi,
I have some difficulties with the simulation of the Bessel Beam simulation. It would be glad if you could help me out or give a few tips.
Here is what I try to achieve:
My goal is to investigate the propagation of a bessel beam resulting from the focusing of an annulus of light. Especially the width of the central lobe and the propagation distance dependent on the ring width and diameter is very interesting for me. Meanwhile I create a collimated annulus of light with some axicons lenses / and an SLM in the lab and will see if the results are comparable…
Here is my Code so far:
Thank you very much in advance.
Greetings from Hannover😊
Edited by ldoyle: used code markup
The text was updated successfully, but these errors were encountered: