Skip to content

Commit

Permalink
Update generate_Laguerre_Gauss_SLM.py
Browse files Browse the repository at this point in the history
Function that generates grating is corrected.
  • Loading branch information
totesalaz authored Sep 28, 2016
1 parent 4b9598c commit f675150
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generate_Laguerre_Gauss_SLM.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def generate_displaced_LG_Mask(beamCharge, gratingPeriod):
image = np.zeros([ImgResY, ImgResX])
# if period > 0 ... shift beam to the RIGHT wrt period = 0
elif gratingPeriod > 0:
image = np.angle(np.exp((2*np.pi*X/gratingPeriod)*1j)+np.exp((beamCharge*np.angle(X+Y*1j))*1j))
image = np.angle(np.exp((2*np.pi*X/gratingPeriod)*1j)*np.exp((beamCharge*np.angle(X+Y*1j))*1j))
# if period < 0 ... shift beam to the LEFT wrt period = 0
elif gratingPeriod < 0:
image = np.angle(np.exp((2*np.pi*X/gratingPeriod+np.pi)*1j)+np.exp((beamCharge*np.angle(X+Y*1j))*1j))
image = np.angle(np.exp((2*np.pi*X/gratingPeriod+np.pi)*1j)*np.exp((beamCharge*np.angle(X+Y*1j))*1j))

image8bit = normalize_image(image)

Expand Down

0 comments on commit f675150

Please sign in to comment.