;+ ; NAME: ; airyb ; ; PURPOSE: ; For creating a cubic phase profile ; ; CATEGORY: ; Hologram/DOE Generator ; ; CALLING SEQUENCE: ; AiryBeam = airyb() ; ; INPUTS: (none yet required) ; ; OPTIONAL INPUTS (KEYWORD PARAMETERS): ; ; scl: provides a lengthscale (floating point) ; (default = 30.0) ; ; nbit: provides 2^nbit levels of phase, ; default setting is 8 (valid for most SLMs) ; ; xpix: number of pixels on a horizontal side, ; default setting is 1920 (for JDC EDK SLM) ; (Set to 1280 for our Cambridge Correlators SLM) ; (Set to 1024 or 768 for our Hamamatsu SLM) ; ; ypix: number of pixels on a horizontal side, ; default setting is 1080 (for JDC EDK SLM) ; (Set to 1024 for our Cambridge Correlators SLM) ; (Set to 768 for our Hamamatsu SLM) ; ; OUTPUTS: ; Airyb: an xpix x ypix byte array giving a cubic phase plate ; ; SIDE EFFECTS: ; ; REQUIRES: ; Calibration of the phase levels of the SLM used, for the desired ; operating conditions, in terms of the 'greyscale' levels used here. ; An appropriate look-up table (LUT) would allow the images generated ; by this program to be used directly by the SLM. ; ; RESTRICTIONS: ; Extremely large phase gradients will be "aliased" due to the ; discretization of the SLM (the number of phase levels and the size ; of the pixels). ; ; MODIFICATION HISTORY: ; Created by Gabe Spalding, March, 2024 ;- FUNCTION airyb,scl=scl, $ nbit=nbit, xpix=xpix, ypix=ypix IF NOT keyword_set(scl) THEN scl = 30.0 IF NOT keyword_set(nbit) THEN nbit = 8 IF NOT keyword_set(xpix) THEN xpix = 1920 IF NOT keyword_set(ypix) THEN ypix = 1080 im = fltarr(xpix,ypix) xoffset = long(0.5 * xpix) yoffset = long(0.5 * ypix) FOR i=0,xpix-1 DO BEGIN FOR j=0,ypix-1 DO BEGIN im(i,j) = ((i-xoffset)/scl)^3.0 + ((j-yoffset)/scl)^3.0 ENDFOR ENDFOR WHILE ( min(im)LT 0 ) DO im = im + (2^nbit) modulo = (2^nbit) im = im -(modulo * long(im/modulo)) im = bytscl(im) return,im END