コード例 #1
0
[xx, yy] = meshgrid(x, y)

lg = lg.LG_xy(l=l, p=0, xx=xx, yy=yy, omega0=2 / sqrt(l))
# normalize lg; we only want the phase information
lg /= abs(lg)
#imshow (x,y,arg(lg))
####### END Create LG order

propagate = Propagate()

if False:
    #####  Just the hollow beam relayed.
    F = Field(N, side_length, wavelength)  # beginning field
    F.gaussian_aperture(gaussian_size)
    F.value[:] *= lg  # SLM LG phase
    F.lens(fslm)  # 'SLM' lens
    F.forvard(fslmR)
    F.lens(fslmR)  # relay:1 lens:1
    F.forvard(2 * fslmR)
    F.lens(fslmR)  # relay:1 lens:2
    F.forvard(fslmR + fslm)  # MOT (1st pass)

    imshow((F.value * F.value.conj()).real)
    print 'press enter to continue'
    raw_input()

    F.forvard(fr1)
    F.lens(fr1, )  # relay:2 lens:1
    F.forvard(fr1 + fr2)
    F.lens(fr2, )  # relay:2 lens:2
    F.forvard(2 * fr2)
コード例 #2
0
ファイル: hollow_beam.py プロジェクト: olsonse/lightpipes
wavelength = 780 * nm  # Wavelength
gaussian_size = 1.00 / sqrt(
    2) * mm  # 1/e Intensity width of beam; (note, it's not the 1/e^2)
step_size = 5. * mm  # LPForvard step size
f = 20 * cm  # focal length of SLM lens
l = 8  # azimuthal order of LG beam

######## END Param ##############

####### Create LG order
dx = (2 / (N - 1.))
x = y = 3 * r_[-1:(1 + dx):dx]
[xx, yy] = meshgrid(x, y)

lg = lg.LG_xy(l=l, p=0, xx=xx, yy=yy, omega0=2 / sqrt(l))
# normalize lg; we only want the phase information
lg /= abs(lg)
#imshow (x,y,arg(lg))
####### END Create LG order

propagate = Propagate()

F = Field(N, side_length, wavelength)
F.gaussian_aperture(gaussian_size)
F.lens(f)
F.value[:] *= lg
propagate(F, z=f + cm, dz=.5 * cm)
#F.forvard(18.0*cm)
#F5 = propagate(4.*cm,.5*cm,                F4,0,0,4)
#F5 = propagate(13.*cm, step_size,               F4,0,0,4)
コード例 #3
0
lg /= abs(lg)
#imshow (x,y,angle(lg))
####### END Create LG order

propagate = Propagate()

F = Field(N, side_length, wavelength)
F.gaussian_aperture(gaussian_size)

Pf = P / sum(F.value * F.value.conj())  # power per grid cell [ W ]
Ef = sqrt(Pf / grid_dx**2)  # sqrt(I) [ sqrt(W/m^2) ]
Ef /= sqrt(mW / cm**2)  # put Ef in units [ sqrt(mW/cm^2) ]
F.value[:] *= Ef  # put F in units of sqrt(I)

print 'writing SLM phase...'
F.lens(f)  # apply lens (physical lens)
Fb = F.copy()  # store the undeflected beam
Fb.value[:] *= sqrt(0.2)  # undeflected light
F.value[:] *= lg  # apply lg phase
grating.phase.perfect(F, 32, 0)  # apply a perfect grating phase.
F.value[:] *= sqrt(0.8)  # deflection efficiency of SLM
F.value[:] += Fb.value  # mix the beams back together.
print 'finished writing SLM phase.'

F.forvard(lf * f)

# traverse a piece of glass and interfere primary beam with 1st internally
# reflected+transmitted beam.
Fr = F.copy()
Fr.interpolate(side_length, N, dx0)
Fr.value[:] *= exp(1j * dphi)  # add phase delay to secondary beam
コード例 #4
0
ファイル: FarField.py プロジェクト: olsonse/lightpipes
#!/usr/bin/env python
"""
LightPipes for Python Optical Toolbox
Calculates the Fraunhofer diffraction of a round hole.
"""

import common
from lightpipes import Field
from pylab import *

m = 1
nm = 1e-9 * m
mm = 1e-3 * m
cm = 1e-2 * m

wavelength = 1000 * nm
size = 10 * cm
N = 150
R = 10 * mm
z = 1000 * m
f1 = 200 * m
f2 = -200 * m

F = Field(N, size, wavelength)
F.circular_aperture(R)
F.lens(f1)
F.lens_forvard(f2, z)

imshow(abs(F.value)**2)  # plot intensity
show()
コード例 #5
0
ファイル: testaxicon_lens.py プロジェクト: olsonse/lightpipes
#imshow (x,y,arg(lg))
####### END Create LG order

propagate = Propagate()

F = Field(N, side_length, wavelength)
F.gaussian_aperture(gaussian_size)
F.axicon(axicon_angle, axicon_n1)
#propagate(F, z=13.*cm, dz=step_size)
F.forvard(7.5 * cm)
F.axicon(axicon_angle, axicon_n1)

print 'moving towards slm'
#F.forvard(40*cm)
propagate(F, z=75. * cm, dz=5 * cm)

print 'first lens'
F.lens(-75 * cm)
propagate(F, z=100. * cm, dz=5 * cm)

print 'second lens'
F.lens(-25 * cm)
propagate(F, z=25. * cm, dz=1 * cm)

print 'applying slm'
F.value[:] *= lg
propagate(F, z=50. * cm, dz=2 * cm)

print 'press enter to exit'
raw_input()