Skip to content

Commit c103829

Browse files
committed
test axicon added
LgBeams become LgBasis
1 parent df7ab26 commit c103829

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
@author: Mohamed
4+
"""
5+
6+
# beam propagation through an axicon
7+
8+
from opencavity.beams import HgBasis
9+
from opencavity.propagators import FresnelProp
10+
import numpy as np
11+
import matplotlib.pylab as plt
12+
13+
# generate the beam
14+
15+
wavelength=1
16+
waist=200 #wasit of the laser beam
17+
H=HgBasis(wavelength,waist,waist) #creating the Hermite-Gauss basis with initial waist equals to 100 microns
18+
z0=1e-8
19+
20+
x=np.linspace(-500, 500,500); # abscissa
21+
tem00=H.generate_hg(0,0, x,0, z0) # the TEM00 gaussian beam for y=0 so no y component and for z=0 so at the waist.
22+
#plt.plot(x,np.abs(tem00)**2,'r')
23+
24+
k=2*np.pi/wavelength
25+
theta=0.5*3.14/180;# 0.5 deg axicon (induced phase not real angle)
26+
# theta can be approximated : (axicon_index-1)*axicon_base_angle
27+
T_axicon=np.exp((+1j*k)*theta*(np.sign(x))*x)
28+
29+
L=10*1e3;
30+
M=np.array([[1, L],[0, 1]]);
31+
32+
prop=FresnelProp(wavelength)
33+
prop.set_start_beam(tem00,x)
34+
prop.set_ABCD(M)
35+
prop.apply_mask1D(T_axicon)
36+
prop.propagate1D_ABCD()
37+
prop.show_result_beam('intensity')
38+
plt.show()
39+
40+
#plot at several successive planes
41+
prop.yz_prop_chart(3e3,50e3,100,2*x)
42+
plt.set_cmap('hot')
43+
prop.show_prop_yz()
44+
plt.show()

opencavity/beams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def generate_hg(self,m,p,x,y,z):
100100
y=y1*y2*y3*y4
101101
return y
102102

103-
class LGbeam(object):
103+
class LgBasis(object):
104104
'''
105105
Generation of Hermite Gauss beams
106106
'''

0 commit comments

Comments
 (0)