PRO pistonbatch, bname=bname, dGSL=dGSL, $ nbit=nbit, xpix=xpix, ypix=ypix, maxGSL=maxGSL, path=path ; ; Creates a series of images with UNIFORM grayscale level ; If these are to be displayed via PowerPoint, ; use the INSERT >> Photo Album. ; ; bname: the base name for the image files to be output ; ; 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) ; ; maxGSL: the grayscale level corresponding to 2pi of phase, ; default setting is 2^nbit-1 ; ; path: a string describing where you want to save your files IF NOT keyword_set(bname) THEN bname = 'piston' IF NOT keyword_set(dGSL) THEN dGSL = 5 IF NOT keyword_set(nbit) THEN nbit = 8 IF NOT keyword_set(maxGSL) THEN maxGSL = 2^nbit-1 IF NOT keyword_set(xpix) THEN xpix = 1920 IF NOT keyword_set(ypix) THEN ypix = 1080 IF NOT keyword_set(path) THEN path = 'C:\Users\Physics Student\Desktop\Piston\' FOR GSL = 0, maxGSL, dGSL DO BEGIN image = make_array(xpix, ypix, /byte, VALUE = GSL) name = bname+strcompress(string(GSL), /REMOVE_ALL)+".bmp" write_bmp, path+name, image ENDFOR end