def main(return_final=False):
    N = r_[2**21, 2]  # Number of pixels (different resolution for demo)
    DX = 60 * mm  # physical size in the important direction
    wavelength = 780 * nm  # Wavelength
    gaussian_size = 1.0 / sqrt(
        2) * mm  # 1/e Intensity width of beam; (note, it's not the 1/e^2)
    L_propagate = 25 * mm  # distance from initial lens to 2D-MOT

    # grating parameters
    grating_period = mm / 900
    grating_lambda = 1200 * nm  # for the blazed grating

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

    side_length = DX * r_[1, N[1] / float(N[0])]  # physical size

    ####### Create grating
    G = grating.phase.Blazed(grating_period / m, wavelength / m,
                             grating_lambda / m)
    ####### END Create grating

    propagate = Propagate1D(N, side_length, window_size=511)

    #####  With the knife edge between the SLM (at SLM focus) relay:1,lens:1.
    #####  In this case, we relay the knife edge to the MOT and not the SLM plane.
    F = Field(N, side_length / m, wavelength / m)  # beginning field
    F.gaussian_aperture(gaussian_size / m, 1e300)

    G.apply(F)

    if return_final:
        F.forvard(L_propagate / m)
        plot((F.value * F.value.conj()).real[:, N[1] / 2])
        return F
    else:
        propagate(F, L_propagate / m, L_propagate / m / 75.)

    print 'press enter to exit'
    raw_input()
예제 #2
0
####### 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.axicon(axicon_angle, axicon_n1)
#F4 = propagate(13.*cm, step_size,               F3,0,0,4);
F.forvard(7.5 * cm)
F.axicon(axicon_angle, axicon_n1)

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

print 'applying slm'
F.value[:] *= lg
propagate(F, z=50. * cm, dz=2 * cm)
print 'press enter to exit'
raw_input()
예제 #3
0
#!/usr/bin/env python
"""
LightPipes for Python Optical Toolbox
"""

import common
from lightpipes import Field
from pylab import *


phi = 178 * (pi/180.)


F = Field(256, 512*15e-6, 780e-9)
F.gaussian_aperture(.75e-3) 
F.axicon(phi, 1.5,   0e-6, 0)
F.forvard(25e-2)

imshow( abs(F.value)**2 )
show()

F.axicon(phi, 1.5,   0e-6, 0)
F.forvard(100e-2)

imshow( abs(F.value)**2 )
show()


#F.lens(-20e-2)
#F.forvard(3e-2)
#    gsplot F7.F.*conj(F7.F);
예제 #4
0
  return phi


x = y = grid_dx * r_[-255.5:256:1.]
[xx, yy] = meshgrid(x,y)
torus_phase = tlens(xx,yy,R0,f_torus,wavelength) + phase_ring(xx,yy,R1,w1)

propagate = Propagate()

#print 'press enter to continue'
#propagate.imshow( torus_phase )
#raw_input()

# propagate the field from the SLM and take a look
F = Field( N, side_length, wavelength)     # initial field
F.gaussian_aperture(w)                     # gaussian input
F.circular_aperture(side_length/2.)        # Iris in front of SLM
F.value[:] *= exp(1j * torus_phase )       # apply SLM phase
F.forvard(f_torus)
propagate(F, z=f_torus, dz=f_torus/25.)

print 'press enter to show final phase...'
raw_input()
propagate.imshow( angle(F.value) )

print 'press enter to show final intensity...'
raw_input()
propagate.imshow( (F.value * F.value.conj()).real )

print 'press enter to exit'
raw_input()