;+ ; NAME: ; vortex ; ; PURPOSE: ; Returns a phase hologram encoding a helical mode. ; ; CATEGORY: ; Computer-generated holography ; ; CALLING SEQUENCE: ; phi = vortex( l, [dim] ) ; ; INPUTS: ; l : [integer] topological charge for the vortex ; ; KEYWORDS: ; cal: [xc,yc,xfac] coordinates of optical axis on SLM face ; and scale factor for x-coordinate. ; Default: [0,0,1], i.e. geometric center with ; square pixels. ; Returned by CCDCAL. ; dim : one- or two-component specification of the phase-mask's ; dimensions. Default: [768,768] ; nomod: If set, then return phi, rather than phi mod 2 pi. ; ; OUTPUTS: ; phi : vortex-forming phase mask: $\phi(\rho) = \ell \theta$. ; Result is positive and modded by 2 pi. ; ; RESTRICTIONS: ; ; PROCEDURE: ; Uses atan(y,x) to calculate theta ; ; EXAMPLE: ; phi = vortex( 60, 512 ) ; 512 x 512 charge 60 vortex ; phi = vortex( -60 ) ; 768 x 768 charge -60 vortex ; phi = vortex( 11, [512,768] ) ; 512 x 768 ... ; ; MODIFICATION HISTORY: ; 2/7/2002: David G. Grier, The University of Chicago, Created. ; 2/28/2002: DGG added CENTER keyword to move center of pattern ; on face of SLM. Useful for correcting for misaligned optics. ; 9/23/2003: DGG moved DIM to a keyword for consistency with ; related routines. Retired CENTER in favor of CAL, which ; includes rescaling of the x-axis for square projected pixels. ; 10/1/2003: DGG added NOMOD keyword. ; 4/22/2004: DGG modifed to call MAKETHETA. ; ; Copyright (c) 2004 David G. Grier ; ; LICENSE ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License as ; published by the Free Software Foundation; either version 2 of the ; License, or (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ; General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ; 02111-1307 USA ; ; If the Internet and WWW are still functional when you are using ; this, you shold be able to access the GPL here: ; http://www.gnu.org/copyleft/gpl.html ;- function vortex, ell, dim = dim, cal = cal, nomod = nomod theta = maketheta(dim = dim, cal = cal) phi = ell * theta phi -= min(phi) if not keyword_set(nomod) then $ phi = temporary(phi) mod (2.*!dpi) return, phi end