Pro batch_egain,dirlist,outps=outps ; NAME: ; pro batch_egain.pro ; ; PURPOSE: ; This program is a batch procedure for egain.pro ; ; CALLING SEQUENCE: ; batch_egain,dirlist [,/outps] ; ; INPUTS: ; dirlist file name for file containing list of input directories ; outps switch to turn on PostScript output ; ; KEYWORD PARAMETERS: ; outps - Write postscript output ; ; EXAMPLE ; Run egain to reduce results from an electronic gain experiment. Make PostScript output ; egain, filelist, /outps ; ; REFERENCE: ; ; ; MODIFICATION HISTORY: ; Written by: D. Figer, IDTL, April 1, 2003 ; ;- ; Set directory string according to handle UNIX and Windows if (!version.os_family eq 'unix') then begin slashstring='/' endif else begin slashstring='\' endelse ; Set default file list if (not (keyword_set(dirlist))) then dirlist='batch_egain_dirlist.txt' ; Set defaults if (not keyword_set(outps)) then outps = 0 ; Default does not write PostScript ; read in list of directories readcol, dirlist, indir, skipfirstflag, format='(A,I)' ; process data in each directory for i=0,n_elements(indir)-1 do begin ; add a slash to the directory names if the last character is not one. if (strlen(indir(i)) ne strpos(indir(i),slashstring,/reverse_search)+1) then indir(i)=indir(i)+slashstring print,'Processing data in directory '+indir(i) ; call egain egain, indir(i), indir(i), skipfirst=skipfirstflag(i), /outps endfor End